From 6ee9f26fb7485e064e94ceaed9e096e3e7035c20 Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Sat, 27 Oct 2018 16:21:03 +0200 Subject: [PATCH] Fix lint issues after build.gradle update (#115) * Update build.gradle Remove unused menu resource Insert constant instead of static string Obey new wakelock tag naming rule * Add annotations - importantForAutofill --- app/build.gradle | 2 +- .../syncthingandroid/service/SyncthingRunnable.java | 10 ++++++++-- app/src/main/res/layout/activity_share.xml | 1 + app/src/main/res/layout/fragment_device.xml | 6 ++++-- .../main/res/layout/fragment_external_versioning.xml | 2 +- app/src/main/res/layout/fragment_folder.xml | 9 ++++++--- app/src/main/res/menu/sync_conditions_settings.xml | 6 ------ 7 files changed, 21 insertions(+), 15 deletions(-) delete mode 100644 app/src/main/res/menu/sync_conditions_settings.xml diff --git a/app/build.gradle b/app/build.gradle index 69b81916..828016ef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ dependencies { implementation 'com.google.zxing:android-integration:3.3.0' implementation 'com.google.code.gson:gson:2.8.2' implementation 'org.mindrot:jbcrypt:0.4' - implementation 'com.google.guava:guava:23.6-android' + implementation 'com.google.guava:guava:24.1-jre' implementation 'com.annimon:stream:1.1.9' implementation 'com.android.volley:volley:1.1.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java index 37ed0398..e1456be7 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java @@ -144,7 +144,13 @@ public class SyncthingRunnable implements Runnable { Boolean useWakeLock = mPreferences.getBoolean(Constants.PREF_USE_WAKE_LOCK, false); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M && useWakeLock) { pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); - wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG); + /** + * Since gradle 4.6, wakelock tags have to obey "app:component" naming convention. + */ + wakeLock = pm.newWakeLock( + PowerManager.PARTIAL_WAKE_LOCK, + mContext.getString(R.string.app_name) + ":" + TAG + ); } Process process = null; @@ -261,7 +267,7 @@ public class SyncthingRunnable implements Runnable { } private void putCustomEnvironmentVariables(Map environment, SharedPreferences sp) { - String customEnvironment = sp.getString("environment_variables", null); + String customEnvironment = sp.getString(Constants.PREF_ENVIRONMENT_VARIABLES, null); if (TextUtils.isEmpty(customEnvironment)) return; diff --git a/app/src/main/res/layout/activity_share.xml b/app/src/main/res/layout/activity_share.xml index ff218c55..ecd2952a 100644 --- a/app/src/main/res/layout/activity_share.xml +++ b/app/src/main/res/layout/activity_share.xml @@ -48,6 +48,7 @@ android:ems="10" android:hint="@string/folder_label" android:inputType="text|textMultiLine" + android:importantForAutofill="no" app:layout_constraintBottom_toTopOf="@+id/folders" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toLeftOf="parent" diff --git a/app/src/main/res/layout/fragment_device.xml b/app/src/main/res/layout/fragment_device.xml index 17da098b..0a04dd8d 100644 --- a/app/src/main/res/layout/fragment_device.xml +++ b/app/src/main/res/layout/fragment_device.xml @@ -62,7 +62,8 @@ android:drawableStart="@drawable/ic_tag_text_outline_black_24dp_active" android:hint="@string/name" android:imeOptions="actionNext" - android:inputType="textCapWords" /> + android:inputType="textCapWords" + android:importantForAutofill="no" /> + android:inputType="textNoSuggestions" + android:importantForAutofill="no" /> + android:importantForAutofill="no" /> + android:inputType="textCapWords|textNoSuggestions" + android:importantForAutofill="no" /> + android:inputType="textCapWords" + android:importantForAutofill="no" /> + android:scrollbars="none" + android:importantForAutofill="no"/> diff --git a/app/src/main/res/menu/sync_conditions_settings.xml b/app/src/main/res/menu/sync_conditions_settings.xml deleted file mode 100644 index ae1a9cec..00000000 --- a/app/src/main/res/menu/sync_conditions_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - -