diff --git a/app/build.gradle b/app/build.gradle index 7dd47aa8..0fee89e3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ ext { // exactly 1 digit versionMinor = 1 // exactly 2 digits - versionBuild = 00 + versionBuild = 02 } android { @@ -120,14 +120,18 @@ private void stripTestOnlyForBuild(flavor, buildType) { } dependencies { + def lifecycle_version = "2.0.0" + implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" implementation 'androidx.enterprise:enterprise-feedback:1.0.0-alpha01' - implementation 'com.android.support:multidex:1.0.1' - implementation 'com.android.support:preference-v14:28.0.0-alpha1' - implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1' - implementation 'com.android.support:support-v13:28.0.0-alpha1' - implementation 'com.android.support.constraint:constraint-layout:1.0.2' + implementation 'androidx.multidex:multidex:2.0.0' + implementation 'androidx.legacy:legacy-preference-v14:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.0.0' + implementation 'androidx.legacy:legacy-support-v13:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation(name: 'setup-wizard-lib-platform-release', ext: 'aar') implementation 'org.bouncycastle:bcpkix-jdk15on:1.56' implementation 'org.bouncycastle:bcprov-jdk15on:1.56' implementation 'com.google.guava:guava:23.6-android' + + annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3cba5493..498dfb0a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -163,7 +163,7 @@ { - try { - Bundle result = accountManagerFuture.getResult(); - String accountNameAdded = result.getString(AccountManager.KEY_ACCOUNT_NAME); - Log.d(TAG, "addAccount - accountNameAdded: " + accountNameAdded); - if (mNextActivityIntent != null) { - startActivity(mNextActivityIntent); - } - final Intent resultIntent = new Intent(); - resultIntent.putExtra(EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE, - new Account(accountNameAdded, GOOGLE_ACCOUNT_TYPE)); - setResult(RESULT_OK, resultIntent); - finish(); - } catch (OperationCanceledException | AuthenticatorException - | IOException e) { - Log.e(TAG, "addAccount - failed", e); - Toast.makeText(AddAccountActivity.this, - R.string.fail_to_add_account, Toast.LENGTH_LONG).show(); - } - }, null); + accountManagerFuture -> { + try { + Bundle result = accountManagerFuture.getResult(); + // This callback executes slightly before the app is back in the foreground + // so we need to wait. + waitForForeground(() -> accountCreated(result), 1000); + } catch (OperationCanceledException | AuthenticatorException | IOException e) { + Log.e(TAG, "addAccount - failed", e); + Toast.makeText(AddAccountActivity.this, + R.string.fail_to_add_account, Toast.LENGTH_LONG).show(); + } + }, null); + } + + private void waitForForeground(Runnable r, long timeout) { + if (timeout <= 0) { + throw new RuntimeException("Timed out waiting for foreground."); + } + boolean isAppInForeground = + ProcessLifecycleOwner.get().getLifecycle().getCurrentState().isAtLeast(STARTED); + if (isAppInForeground) { + r.run(); + } else { + new Handler().postDelayed( + () -> waitForForeground(r, timeout - WAIT_FOR_FOREGROUND_DELAY_MS), + WAIT_FOR_FOREGROUND_DELAY_MS); + } + } + + private void accountCreated(Bundle result) { + String accountNameAdded = result.getString(AccountManager.KEY_ACCOUNT_NAME); + Log.d(TAG, "addAccount - accountNameAdded: " + accountNameAdded); + if (mNextActivityIntent != null) { + startActivity(mNextActivityIntent); + } + final Intent resultIntent = new Intent(); + resultIntent.putExtra(EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE, + new Account(accountNameAdded, GOOGLE_ACCOUNT_TYPE)); + setResult(RESULT_OK, resultIntent); + finish(); + } private void disableUserRestrictions() { diff --git a/app/src/main/java/com/afwsamples/testdpc/DelegatedAdminReceiver.java b/app/src/main/java/com/afwsamples/testdpc/DelegatedAdminReceiver.java index 3d71df37..abb8d184 100644 --- a/app/src/main/java/com/afwsamples/testdpc/DelegatedAdminReceiver.java +++ b/app/src/main/java/com/afwsamples/testdpc/DelegatedAdminReceiver.java @@ -16,13 +16,15 @@ package com.afwsamples.testdpc; +import static com.afwsamples.testdpc.common.Util.Q_VERSION_CODE; + import android.annotation.TargetApi; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Build.VERSION_CODES; -@TargetApi(VERSION_CODES.Q) +@TargetApi(Q_VERSION_CODE) public class DelegatedAdminReceiver extends android.app.admin.DelegatedAdminReceiver { @Override diff --git a/app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java b/app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java index 500647c2..105e9596 100644 --- a/app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java +++ b/app/src/main/java/com/afwsamples/testdpc/DeviceAdminReceiver.java @@ -32,7 +32,7 @@ import android.os.Process; import android.os.UserHandle; import android.os.UserManager; -import android.support.v4.app.NotificationCompat; +import androidx.core.app.NotificationCompat; import android.util.Log; import android.widget.Toast; import com.afwsamples.testdpc.common.NotificationUtil; diff --git a/app/src/main/java/com/afwsamples/testdpc/DeviceAdminService.java b/app/src/main/java/com/afwsamples/testdpc/DeviceAdminService.java index 5d78b65e..e7b852e9 100644 --- a/app/src/main/java/com/afwsamples/testdpc/DeviceAdminService.java +++ b/app/src/main/java/com/afwsamples/testdpc/DeviceAdminService.java @@ -4,7 +4,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.os.Build.VERSION_CODES; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; /** * To allow DPC process to be persistent and foreground. diff --git a/app/src/main/java/com/afwsamples/testdpc/PackageMonitorReceiver.java b/app/src/main/java/com/afwsamples/testdpc/PackageMonitorReceiver.java index eeb14315..e1d8516b 100644 --- a/app/src/main/java/com/afwsamples/testdpc/PackageMonitorReceiver.java +++ b/app/src/main/java/com/afwsamples/testdpc/PackageMonitorReceiver.java @@ -5,7 +5,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import android.support.v4.app.NotificationCompat; +import androidx.core.app.NotificationCompat; import android.text.TextUtils; import com.afwsamples.testdpc.common.NotificationUtil; diff --git a/app/src/main/java/com/afwsamples/testdpc/common/BaseSearchablePolicyPreferenceFragment.java b/app/src/main/java/com/afwsamples/testdpc/common/BaseSearchablePolicyPreferenceFragment.java index d48c5b9e..2b703a17 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/BaseSearchablePolicyPreferenceFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/BaseSearchablePolicyPreferenceFragment.java @@ -2,14 +2,14 @@ import android.content.Context; import android.os.Bundle; -import android.support.v14.preference.PreferenceFragment; -import android.support.v7.preference.Preference; -import android.support.v7.preference.PreferenceGroup; -import android.support.v7.preference.PreferenceGroupAdapter; -import android.support.v7.preference.PreferenceScreen; -import android.support.v7.preference.PreferenceViewHolder; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.preference.PreferenceFragment; +import androidx.preference.Preference; +import androidx.preference.PreferenceGroup; +import androidx.preference.PreferenceGroupAdapter; +import androidx.preference.PreferenceScreen; +import androidx.preference.PreferenceViewHolder; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.text.TextUtils; import android.view.Menu; import android.view.MenuInflater; diff --git a/app/src/main/java/com/afwsamples/testdpc/common/NotificationUtil.java b/app/src/main/java/com/afwsamples/testdpc/common/NotificationUtil.java index 59b83a32..c3d42720 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/NotificationUtil.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/NotificationUtil.java @@ -4,11 +4,10 @@ import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Context; -import android.os.Build; import android.os.Build.VERSION_CODES; -import android.support.annotation.RequiresApi; -import android.support.annotation.StringRes; -import android.support.v4.app.NotificationCompat; +import androidx.annotation.RequiresApi; +import androidx.annotation.StringRes; +import androidx.core.app.NotificationCompat; import com.afwsamples.testdpc.R; public class NotificationUtil { diff --git a/app/src/main/java/com/afwsamples/testdpc/common/ProfileOrParentFragment.java b/app/src/main/java/com/afwsamples/testdpc/common/ProfileOrParentFragment.java index 575993fa..4cdf1081 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/ProfileOrParentFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/ProfileOrParentFragment.java @@ -21,11 +21,10 @@ import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; -import android.os.Build; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.v13.app.FragmentTabHost; -import android.support.v7.preference.PreferenceManager; +import androidx.legacy.app.FragmentTabHost; +import androidx.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/afwsamples/testdpc/common/StringArrayTypeInputAdapter.java b/app/src/main/java/com/afwsamples/testdpc/common/StringArrayTypeInputAdapter.java index 4ebde54a..725cc7ac 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/StringArrayTypeInputAdapter.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/StringArrayTypeInputAdapter.java @@ -16,7 +16,7 @@ package com.afwsamples.testdpc.common; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; diff --git a/app/src/main/java/com/afwsamples/testdpc/common/Util.java b/app/src/main/java/com/afwsamples/testdpc/common/Util.java index 61f7e2f2..b3f65805 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/Util.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/Util.java @@ -26,13 +26,12 @@ import android.content.IntentFilter; import android.graphics.BitmapFactory; import android.net.Uri; -import android.os.Build; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.os.UserHandle; import android.os.UserManager; -import android.support.v14.preference.PreferenceFragment; +import androidx.preference.PreferenceFragment; import android.text.format.DateUtils; import android.util.Log; import android.widget.ImageView; @@ -62,13 +61,15 @@ public class Util { private static final boolean IS_RUNNING_Q = VERSION.CODENAME.length() == 1 && VERSION.CODENAME.charAt(0) == 'Q'; + public static final int Q_VERSION_CODE = 29; + /** * A replacement for {@link VERSION.SDK_INT} that is compatible with pre-release SDKs * *

This will be set to the version SDK, or {@link VERSION_CODES.CUR_DEVELOPMENT} if the SDK * int is not yet assigned. **/ - public static final int SDK_INT = IS_RUNNING_Q ? VERSION_CODES.Q : VERSION.SDK_INT; + public static final int SDK_INT = IS_RUNNING_Q ? Q_VERSION_CODE : VERSION.SDK_INT; /** * Format a friendly datetime for the current locale according to device policy documentation. diff --git a/app/src/main/java/com/afwsamples/testdpc/common/keyvaluepair/KeyValuePairDialogFragment.java b/app/src/main/java/com/afwsamples/testdpc/common/keyvaluepair/KeyValuePairDialogFragment.java index afc7ceb4..6ae94a7c 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/keyvaluepair/KeyValuePairDialogFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/keyvaluepair/KeyValuePairDialogFragment.java @@ -25,9 +25,9 @@ import android.graphics.Color; import android.os.Bundle; import android.os.Parcelable; -import android.support.annotation.StringRes; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.StringRes; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; diff --git a/app/src/main/java/com/afwsamples/testdpc/common/preference/CustomConstraint.java b/app/src/main/java/com/afwsamples/testdpc/common/preference/CustomConstraint.java index 900b41ba..9826bb6a 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/preference/CustomConstraint.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/preference/CustomConstraint.java @@ -16,7 +16,7 @@ package com.afwsamples.testdpc.common.preference; -import android.support.annotation.StringRes; +import androidx.annotation.StringRes; public interface CustomConstraint { diff --git a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcEditTextPreference.java b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcEditTextPreference.java index 71512550..9c9d576b 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcEditTextPreference.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcEditTextPreference.java @@ -17,10 +17,10 @@ package com.afwsamples.testdpc.common.preference; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.preference.EditTextPreference; -import android.support.v7.preference.PreferenceManager; -import android.support.v7.preference.PreferenceViewHolder; +import androidx.annotation.Nullable; +import androidx.preference.EditTextPreference; +import androidx.preference.PreferenceManager; +import androidx.preference.PreferenceViewHolder; import android.util.AttributeSet; /** @@ -41,7 +41,7 @@ public DpcEditTextPreference(Context context, AttributeSet attrs, int defStyleAt } public DpcEditTextPreference(Context context, AttributeSet attrs) { - this(context, attrs, android.support.v7.preference.R.attr.editTextPreferenceStyle); + this(context, attrs, androidx.preference.R.attr.editTextPreferenceStyle); } public DpcEditTextPreference(Context context) { diff --git a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcListPreference.java b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcListPreference.java index 59b15464..2248e7b4 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcListPreference.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcListPreference.java @@ -17,10 +17,10 @@ package com.afwsamples.testdpc.common.preference; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.preference.ListPreference; -import android.support.v7.preference.PreferenceManager; -import android.support.v7.preference.PreferenceViewHolder; +import androidx.annotation.Nullable; +import androidx.preference.ListPreference; +import androidx.preference.PreferenceManager; +import androidx.preference.PreferenceViewHolder; import android.util.AttributeSet; /** @@ -41,7 +41,7 @@ public DpcListPreference(Context context, AttributeSet attrs, int defStyleAttr) } public DpcListPreference(Context context, AttributeSet attrs) { - this(context, attrs, android.support.v7.preference.R.attr.dialogPreferenceStyle); + this(context, attrs, androidx.preference.R.attr.dialogPreferenceStyle); } public DpcListPreference(Context context) { diff --git a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreference.java b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreference.java index 5c054cf7..6fcb996d 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreference.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreference.java @@ -17,10 +17,10 @@ package com.afwsamples.testdpc.common.preference; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.preference.Preference; -import android.support.v7.preference.PreferenceManager; -import android.support.v7.preference.PreferenceViewHolder; +import androidx.annotation.Nullable; +import androidx.preference.Preference; +import androidx.preference.PreferenceManager; +import androidx.preference.PreferenceViewHolder; import android.util.AttributeSet; /** @@ -41,7 +41,7 @@ public DpcPreference(Context context, AttributeSet attrs, int defStyleAttr) { } public DpcPreference(Context context, AttributeSet attrs) { - this(context, attrs, android.support.v7.preference.R.attr.preferenceStyle); + this(context, attrs, androidx.preference.R.attr.preferenceStyle); } public DpcPreference(Context context) { diff --git a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceBase.java b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceBase.java index 3491a2f4..6cf08c92 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceBase.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceBase.java @@ -16,7 +16,7 @@ package com.afwsamples.testdpc.common.preference; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; /** * Common base class for the DpcPreference family of classes. diff --git a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceHelper.java b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceHelper.java index e41e3cc6..7a380489 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceHelper.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcPreferenceHelper.java @@ -19,12 +19,11 @@ import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.res.TypedArray; -import android.os.Build; import android.os.Build.VERSION_CODES; -import android.support.annotation.IntDef; -import android.support.annotation.StringRes; -import android.support.v7.preference.Preference; -import android.support.v7.preference.PreferenceViewHolder; +import androidx.annotation.IntDef; +import androidx.annotation.StringRes; +import androidx.preference.Preference; +import androidx.preference.PreferenceViewHolder; import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; diff --git a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcSwitchPreference.java b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcSwitchPreference.java index dffba406..087f4b37 100644 --- a/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcSwitchPreference.java +++ b/app/src/main/java/com/afwsamples/testdpc/common/preference/DpcSwitchPreference.java @@ -17,10 +17,10 @@ package com.afwsamples.testdpc.common.preference; import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v14.preference.SwitchPreference; -import android.support.v7.preference.PreferenceManager; -import android.support.v7.preference.PreferenceViewHolder; +import androidx.annotation.Nullable; +import androidx.preference.SwitchPreference; +import androidx.preference.PreferenceManager; +import androidx.preference.PreferenceViewHolder; import android.util.AttributeSet; /** @@ -41,7 +41,7 @@ public DpcSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr } public DpcSwitchPreference(Context context, AttributeSet attrs) { - this(context, attrs, android.support.v14.preference.R.attr.switchPreferenceStyle); + this(context, attrs, androidx.preference.R.attr.switchPreferenceStyle); } public DpcSwitchPreference(Context context) { diff --git a/app/src/main/java/com/afwsamples/testdpc/comp/BindDeviceAdminFragment.java b/app/src/main/java/com/afwsamples/testdpc/comp/BindDeviceAdminFragment.java index 7b67a372..d8d48471 100644 --- a/app/src/main/java/com/afwsamples/testdpc/comp/BindDeviceAdminFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/comp/BindDeviceAdminFragment.java @@ -30,9 +30,9 @@ import android.os.Bundle; import android.os.UserHandle; import android.os.UserManager; -import android.support.annotation.StringRes; -import android.support.v7.preference.Preference; -import android.support.v7.preference.Preference.OnPreferenceChangeListener; +import androidx.annotation.StringRes; +import androidx.preference.Preference; +import androidx.preference.Preference.OnPreferenceChangeListener; import android.util.Log; import android.widget.Toast; import com.afwsamples.testdpc.R; diff --git a/app/src/main/java/com/afwsamples/testdpc/comp/OnServiceConnectedListener.java b/app/src/main/java/com/afwsamples/testdpc/comp/OnServiceConnectedListener.java index b4b7b8f3..739ccfdf 100644 --- a/app/src/main/java/com/afwsamples/testdpc/comp/OnServiceConnectedListener.java +++ b/app/src/main/java/com/afwsamples/testdpc/comp/OnServiceConnectedListener.java @@ -1,7 +1,7 @@ package com.afwsamples.testdpc.comp; import android.os.RemoteException; -import android.support.annotation.UiThread; +import androidx.annotation.UiThread; public interface OnServiceConnectedListener { @UiThread diff --git a/app/src/main/java/com/afwsamples/testdpc/comp/ProfileOwnerService.java b/app/src/main/java/com/afwsamples/testdpc/comp/ProfileOwnerService.java index a75eb6d7..a1357985 100644 --- a/app/src/main/java/com/afwsamples/testdpc/comp/ProfileOwnerService.java +++ b/app/src/main/java/com/afwsamples/testdpc/comp/ProfileOwnerService.java @@ -28,7 +28,7 @@ import android.os.IBinder; import android.os.RemoteException; import android.os.UserHandle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.Log; import com.afwsamples.testdpc.DeviceAdminReceiver; diff --git a/app/src/main/java/com/afwsamples/testdpc/feedback/AppStatesService.java b/app/src/main/java/com/afwsamples/testdpc/feedback/AppStatesService.java index c7f42835..9c7aa6fe 100644 --- a/app/src/main/java/com/afwsamples/testdpc/feedback/AppStatesService.java +++ b/app/src/main/java/com/afwsamples/testdpc/feedback/AppStatesService.java @@ -2,11 +2,10 @@ import android.app.NotificationChannel; import android.app.NotificationManager; -import android.os.Build; import android.os.Build.VERSION_CODES; -import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; -import android.support.v7.preference.PreferenceManager; +import androidx.core.app.NotificationCompat; +import androidx.core.app.NotificationManagerCompat; +import androidx.preference.PreferenceManager; import android.util.Log; import androidx.enterprise.feedback.KeyedAppState; import androidx.enterprise.feedback.KeyedAppStatesService; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/BaseStringItemsFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/BaseStringItemsFragment.java index d69cde1b..98053b9a 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/BaseStringItemsFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/BaseStringItemsFragment.java @@ -21,7 +21,7 @@ import android.content.Context; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.annotation.StringRes; +import androidx.annotation.StringRes; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/CrossProfileCalendarFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/CrossProfileCalendarFragment.java index 80df44ad..c82e6ad1 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/CrossProfileCalendarFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/CrossProfileCalendarFragment.java @@ -16,6 +16,8 @@ package com.afwsamples.testdpc.policy; +import static com.afwsamples.testdpc.common.Util.Q_VERSION_CODE; + import android.annotation.TargetApi; import android.app.AlertDialog.Builder; import android.app.admin.DevicePolicyManager; @@ -23,7 +25,7 @@ import android.content.Context; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.v7.preference.Preference; +import androidx.preference.Preference; import android.util.ArraySet; import android.view.View; import android.widget.EditText; @@ -36,7 +38,7 @@ import java.util.Collections; import java.util.Set; -@TargetApi(VERSION_CODES.Q) +@TargetApi(Q_VERSION_CODE) public class CrossProfileCalendarFragment extends BaseSearchablePolicyPreferenceFragment implements Preference.OnPreferenceClickListener, Preference.OnPreferenceChangeListener { @@ -102,7 +104,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { return false; } - @TargetApi(VERSION_CODES.Q) + @TargetApi(Q_VERSION_CODE) private void reloadAllowAllPackagesUi() { final Set packages = mDevicePolicyManager.getCrossProfileCalendarPackages(mAdminComponentName); diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/ManageAffiliationIdsFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/ManageAffiliationIdsFragment.java index 4b66980a..81be335f 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/ManageAffiliationIdsFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/ManageAffiliationIdsFragment.java @@ -22,7 +22,7 @@ import android.content.Context; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.v4.util.ArraySet; +import androidx.collection.ArraySet; import com.afwsamples.testdpc.DeviceAdminReceiver; import com.afwsamples.testdpc.R; import java.util.Collection; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/OverrideApnFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/OverrideApnFragment.java index 4970e055..922ec4b8 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/OverrideApnFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/OverrideApnFragment.java @@ -26,8 +26,8 @@ import android.net.Uri; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.v14.preference.SwitchPreference; -import android.support.v7.preference.Preference; +import androidx.preference.SwitchPreference; +import androidx.preference.Preference; import android.telephony.data.ApnSetting; import android.text.TextUtils; import android.util.Log; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/PolicyManagementFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/PolicyManagementFragment.java index f47817d7..73c88aba 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/PolicyManagementFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/PolicyManagementFragment.java @@ -17,6 +17,7 @@ package com.afwsamples.testdpc.policy; import static android.os.UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES; +import static com.afwsamples.testdpc.common.Util.Q_VERSION_CODE; import static com.afwsamples.testdpc.common.preference.DpcPreferenceHelper.NO_CUSTOM_CONSTRIANT; import android.accessibilityservice.AccessibilityServiceInfo; @@ -58,14 +59,14 @@ import android.security.KeyChain; import android.security.KeyChainAliasCallback; import android.service.notification.NotificationListenerService; -import android.support.annotation.RequiresApi; -import android.support.annotation.StringRes; -import android.support.v14.preference.SwitchPreference; -import android.support.v4.content.FileProvider; -import android.support.v7.preference.EditTextPreference; -import android.support.v7.preference.ListPreference; -import android.support.v7.preference.Preference; -import android.support.v7.preference.PreferenceManager; +import androidx.annotation.RequiresApi; +import androidx.annotation.StringRes; +import androidx.preference.SwitchPreference; +import androidx.core.content.FileProvider; +import androidx.preference.EditTextPreference; +import androidx.preference.ListPreference; +import androidx.preference.Preference; +import androidx.preference.PreferenceManager; import android.telephony.TelephonyManager; import android.text.InputType; import android.text.TextUtils; @@ -398,7 +399,7 @@ public class PolicyManagementFragment extends BaseSearchablePolicyPreferenceFrag private static final SparseIntArray PASSWORD_COMPLEXITY = new SparseIntArray(4); static { - if (Util.SDK_INT >= VERSION_CODES.Q) { + if (Util.SDK_INT >= Q_VERSION_CODE) { final int[] complexityIds = new int[]{ DevicePolicyManager.PASSWORD_COMPLEXITY_NONE, DevicePolicyManager.PASSWORD_COMPLEXITY_LOW, @@ -1141,7 +1142,7 @@ public void onPositiveButtonClicked(String[] lockTaskArray) { return false; } - @TargetApi(VERSION_CODES.Q) + @TargetApi(Q_VERSION_CODE) private void promptInstallUpdate() { new AlertDialog.Builder(getActivity()) .setMessage(R.string.install_update_prompt) @@ -1154,7 +1155,7 @@ private void promptInstallUpdate() { .show(); } - @TargetApi(VERSION_CODES.Q) + @TargetApi(Q_VERSION_CODE) private void installUpdate() { File file = new File(getContext().getFilesDir(), "ota.zip"); Uri uri = FileProvider.getUriForFile( diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/UserRestrictionsDisplayFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/UserRestrictionsDisplayFragment.java index 356cab4b..ac1a3385 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/UserRestrictionsDisplayFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/UserRestrictionsDisplayFragment.java @@ -17,6 +17,7 @@ package com.afwsamples.testdpc.policy; import static android.os.UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES; +import static com.afwsamples.testdpc.common.Util.Q_VERSION_CODE; import android.app.AlertDialog; import android.app.admin.DevicePolicyManager; @@ -25,8 +26,8 @@ import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.os.UserManager; -import android.support.v7.preference.Preference; -import android.support.v7.preference.PreferenceScreen; +import androidx.preference.Preference; +import androidx.preference.PreferenceScreen; import android.util.Log; import android.widget.Toast; import com.afwsamples.testdpc.DeviceAdminReceiver; @@ -150,7 +151,7 @@ private void constrainPreferences() { } for (String restriction: UserRestriction.QT_PLUS_RESTRICTIONS) { DpcPreferenceBase pref = (DpcPreferenceBase) findPreference(restriction); - pref.setMinSdkVersion(VERSION_CODES.Q); + pref.setMinSdkVersion(Q_VERSION_CODE); } for (String restriction : UserRestriction.PRIMARY_USER_ONLY_RESTRICTIONS) { DpcPreferenceBase pref = (DpcPreferenceBase) findPreference(restriction); diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/keyguard/LockScreenPolicyFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/keyguard/LockScreenPolicyFragment.java index 946e3cda..25fb7568 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/keyguard/LockScreenPolicyFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/keyguard/LockScreenPolicyFragment.java @@ -23,12 +23,11 @@ import android.app.Fragment; import android.app.admin.DevicePolicyManager; import android.content.Context; -import android.os.Build; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.v7.preference.EditTextPreference; -import android.support.v7.preference.Preference; -import android.support.v7.preference.TwoStatePreference; +import androidx.preference.EditTextPreference; +import androidx.preference.Preference; +import androidx.preference.TwoStatePreference; import android.util.ArrayMap; import android.widget.Toast; import com.afwsamples.testdpc.R; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/keyguard/PasswordConstraintsFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/keyguard/PasswordConstraintsFragment.java index 96ec8292..0ae636a3 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/keyguard/PasswordConstraintsFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/keyguard/PasswordConstraintsFragment.java @@ -30,9 +30,9 @@ import android.content.ComponentName; import android.content.Context; import android.os.Bundle; -import android.support.v7.preference.EditTextPreference; -import android.support.v7.preference.ListPreference; -import android.support.v7.preference.Preference; +import androidx.preference.EditTextPreference; +import androidx.preference.ListPreference; +import androidx.preference.Preference; import android.widget.Toast; import com.afwsamples.testdpc.DeviceAdminReceiver; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/locktask/SetLockTaskFeaturesFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/locktask/SetLockTaskFeaturesFragment.java index 005059dd..7ac6c258 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/locktask/SetLockTaskFeaturesFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/locktask/SetLockTaskFeaturesFragment.java @@ -29,7 +29,7 @@ import android.content.Context; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.v7.preference.Preference; +import androidx.preference.Preference; import android.util.ArrayMap; import android.util.Log; import android.widget.Toast; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/networking/AlwaysOnVpnFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/networking/AlwaysOnVpnFragment.java index 7b50a80e..2eee4a06 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/networking/AlwaysOnVpnFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/networking/AlwaysOnVpnFragment.java @@ -16,6 +16,8 @@ package com.afwsamples.testdpc.policy.networking; +import static com.afwsamples.testdpc.common.Util.Q_VERSION_CODE; + import android.annotation.TargetApi; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; @@ -83,7 +85,7 @@ public View onCreateView(LayoutInflater layoutInflater, ViewGroup container, Bundle savedInstanceState) { final View view = super.onCreateView(layoutInflater, container, savedInstanceState); - if (Util.SDK_INT >= VERSION_CODES.Q) { + if (Util.SDK_INT >= Q_VERSION_CODE) { final ViewGroup extension = getExtensionLayout(view); extension.setVisibility(View.VISIBLE); layoutInflater.inflate(R.layout.lockdown_settings, extension); @@ -112,12 +114,12 @@ protected List createAppList() { @Override protected void reloadSelectedPackage() { super.reloadSelectedPackage(); - if (Util.SDK_INT >= VERSION_CODES.Q) { + if (Util.SDK_INT >= Q_VERSION_CODE) { updateLockdown(); } } - @TargetApi(VERSION_CODES.Q) + @TargetApi(Q_VERSION_CODE) private void updateLockdown() { mLockdown.setChecked(mDpm.isAlwaysOnVpnLockdownEnabled(mWho)); final Set exemptedPackages = mDpm.getAlwaysOnVpnLockdownWhitelist(mWho); @@ -128,7 +130,7 @@ private void updateLockdown() { @Override protected void setSelectedPackage(String pkg) { try { - if (Util.SDK_INT >= VERSION_CODES.Q) { + if (Util.SDK_INT >= Q_VERSION_CODE) { setAlwaysOnVpnPackageQPlus(pkg); } else { mDpm.setAlwaysOnVpnPackage(mWho, pkg, /* lockdownEnabled */ true); @@ -144,7 +146,7 @@ protected void setSelectedPackage(String pkg) { } } - @TargetApi(VERSION_CODES.Q) + @TargetApi(Q_VERSION_CODE) private void setAlwaysOnVpnPackageQPlus(String pkg) throws PackageManager.NameNotFoundException { final boolean lockdown = mLockdown.isChecked(); diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/networking/PrivateDnsModeFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/networking/PrivateDnsModeFragment.java index c28f9923..d38f1dab 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/networking/PrivateDnsModeFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/networking/PrivateDnsModeFragment.java @@ -16,6 +16,8 @@ package com.afwsamples.testdpc.policy.networking; +import static com.afwsamples.testdpc.common.Util.Q_VERSION_CODE; + import android.annotation.TargetApi; import android.app.Fragment; import android.app.admin.DevicePolicyManager; @@ -35,7 +37,7 @@ import com.afwsamples.testdpc.DeviceAdminReceiver; import com.afwsamples.testdpc.R; -@TargetApi(VERSION_CODES.Q) +@TargetApi(Q_VERSION_CODE) public class PrivateDnsModeFragment extends Fragment implements View.OnClickListener, RadioGroup.OnCheckedChangeListener { private static final String TAG = "PDNS_FRAG"; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/networking/SetPrivateDnsTask.java b/app/src/main/java/com/afwsamples/testdpc/policy/networking/SetPrivateDnsTask.java index 332a2a06..2bb77bde 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/networking/SetPrivateDnsTask.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/networking/SetPrivateDnsTask.java @@ -16,6 +16,8 @@ package com.afwsamples.testdpc.policy.networking; +import static com.afwsamples.testdpc.common.Util.Q_VERSION_CODE; + import android.annotation.TargetApi; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; @@ -25,7 +27,7 @@ import com.afwsamples.testdpc.R; import com.afwsamples.testdpc.policy.keymanagement.ShowToastCallback; -@TargetApi(VERSION_CODES.Q) +@TargetApi(Q_VERSION_CODE) final class SetPrivateDnsTask extends AsyncTask { public static final String TAG = "Networking"; private final ShowToastCallback mCallback; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/resetpassword/ResetPasswordService.java b/app/src/main/java/com/afwsamples/testdpc/policy/resetpassword/ResetPasswordService.java index c6680198..97bf1909 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/resetpassword/ResetPasswordService.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/resetpassword/ResetPasswordService.java @@ -32,7 +32,7 @@ import android.os.Build.VERSION_CODES; import android.os.IBinder; import android.os.UserManager; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.Log; import com.afwsamples.testdpc.DeviceAdminReceiver; import com.afwsamples.testdpc.R; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/systemupdatepolicy/SystemUpdatePolicyFragment.java b/app/src/main/java/com/afwsamples/testdpc/policy/systemupdatepolicy/SystemUpdatePolicyFragment.java index f24be6e1..3660300e 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/systemupdatepolicy/SystemUpdatePolicyFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/systemupdatepolicy/SystemUpdatePolicyFragment.java @@ -26,7 +26,7 @@ import android.content.Context; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/utils/Attestation.java b/app/src/main/java/com/afwsamples/testdpc/policy/utils/Attestation.java index f82aaf3c..e50ca4a6 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/utils/Attestation.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/utils/Attestation.java @@ -17,7 +17,7 @@ package com.afwsamples.testdpc.policy.utils; import android.os.Build.VERSION_CODES; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; import com.google.common.base.CharMatcher; import com.google.common.io.BaseEncoding; import java.security.cert.CertificateParsingException; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/utils/AttestationApplicationId.java b/app/src/main/java/com/afwsamples/testdpc/policy/utils/AttestationApplicationId.java index 1935fed5..f41389ff 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/utils/AttestationApplicationId.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/utils/AttestationApplicationId.java @@ -20,7 +20,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.Signature; import android.os.Build.VERSION_CODES; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateParsingException; diff --git a/app/src/main/java/com/afwsamples/testdpc/policy/utils/AuthorizationList.java b/app/src/main/java/com/afwsamples/testdpc/policy/utils/AuthorizationList.java index 3ea70184..47dfce21 100644 --- a/app/src/main/java/com/afwsamples/testdpc/policy/utils/AuthorizationList.java +++ b/app/src/main/java/com/afwsamples/testdpc/policy/utils/AuthorizationList.java @@ -21,7 +21,7 @@ import android.os.Build.VERSION_CODES; import android.security.keystore.KeyProperties; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; import android.util.Log; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; diff --git a/app/src/main/java/com/afwsamples/testdpc/profilepolicy/ProfilePolicyManagementFragment.java b/app/src/main/java/com/afwsamples/testdpc/profilepolicy/ProfilePolicyManagementFragment.java index 8ab784d2..44f0e4f1 100644 --- a/app/src/main/java/com/afwsamples/testdpc/profilepolicy/ProfilePolicyManagementFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/profilepolicy/ProfilePolicyManagementFragment.java @@ -28,8 +28,8 @@ import android.graphics.Color; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.support.v14.preference.SwitchPreference; -import android.support.v7.preference.Preference; +import androidx.preference.SwitchPreference; +import androidx.preference.Preference; import android.widget.Toast; import com.afwsamples.testdpc.DeviceAdminReceiver; import com.afwsamples.testdpc.R; diff --git a/app/src/main/java/com/afwsamples/testdpc/profilepolicy/delegation/DelegationScopesArrayAdapter.java b/app/src/main/java/com/afwsamples/testdpc/profilepolicy/delegation/DelegationScopesArrayAdapter.java index b1c4707f..adc2a241 100644 --- a/app/src/main/java/com/afwsamples/testdpc/profilepolicy/delegation/DelegationScopesArrayAdapter.java +++ b/app/src/main/java/com/afwsamples/testdpc/profilepolicy/delegation/DelegationScopesArrayAdapter.java @@ -2,7 +2,7 @@ import android.app.admin.DevicePolicyManager; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/afwsamples/testdpc/provision/CheckInState.java b/app/src/main/java/com/afwsamples/testdpc/provision/CheckInState.java index 7ab43d2d..631dcaf6 100644 --- a/app/src/main/java/com/afwsamples/testdpc/provision/CheckInState.java +++ b/app/src/main/java/com/afwsamples/testdpc/provision/CheckInState.java @@ -20,7 +20,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.support.v4.content.LocalBroadcastManager; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; public class CheckInState { private SharedPreferences mSharedPreferences; diff --git a/app/src/main/java/com/afwsamples/testdpc/search/PolicySearchFragment.java b/app/src/main/java/com/afwsamples/testdpc/search/PolicySearchFragment.java index a79a7831..e04e33f0 100644 --- a/app/src/main/java/com/afwsamples/testdpc/search/PolicySearchFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/search/PolicySearchFragment.java @@ -3,9 +3,9 @@ import android.app.Fragment; import android.os.AsyncTask; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; diff --git a/app/src/main/java/com/afwsamples/testdpc/search/SearchItemAdapter.java b/app/src/main/java/com/afwsamples/testdpc/search/SearchItemAdapter.java index befdf4c2..7d0271d6 100644 --- a/app/src/main/java/com/afwsamples/testdpc/search/SearchItemAdapter.java +++ b/app/src/main/java/com/afwsamples/testdpc/search/SearchItemAdapter.java @@ -1,6 +1,6 @@ package com.afwsamples.testdpc.search; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/afwsamples/testdpc/search/XmlIndexableFragment.java b/app/src/main/java/com/afwsamples/testdpc/search/XmlIndexableFragment.java index 11d184a1..ca0dbc66 100644 --- a/app/src/main/java/com/afwsamples/testdpc/search/XmlIndexableFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/search/XmlIndexableFragment.java @@ -1,7 +1,7 @@ package com.afwsamples.testdpc.search; import android.content.Context; -import android.support.annotation.XmlRes; +import androidx.annotation.XmlRes; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Log; diff --git a/app/src/main/java/com/afwsamples/testdpc/transferownership/PickTransferComponentFragment.java b/app/src/main/java/com/afwsamples/testdpc/transferownership/PickTransferComponentFragment.java index 155761b0..0425dfad 100644 --- a/app/src/main/java/com/afwsamples/testdpc/transferownership/PickTransferComponentFragment.java +++ b/app/src/main/java/com/afwsamples/testdpc/transferownership/PickTransferComponentFragment.java @@ -29,7 +29,7 @@ import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.os.PersistableBundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.Log; import android.view.LayoutInflater; import android.view.View; diff --git a/app/src/main/res/layout/basic_key_value_pair.xml b/app/src/main/res/layout/basic_key_value_pair.xml index 6e7870ba..b1b51053 100644 --- a/app/src/main/res/layout/basic_key_value_pair.xml +++ b/app/src/main/res/layout/basic_key_value_pair.xml @@ -123,7 +123,7 @@ android:orientation="vertical" android:visibility="gone"> - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/search_result.xml b/app/src/main/res/layout/search_result.xml index fa5d4e0b..bc56c01d 100644 --- a/app/src/main/res/layout/search_result.xml +++ b/app/src/main/res/layout/search_result.xml @@ -1,5 +1,5 @@ -