Snap for 5760827 from 3ed75c8478 to qt-qpr1-release
Change-Id: Ib69e8fa06f6274c6d7930d5fa12aae5a0e941a4f
This commit is contained in:
@@ -10683,13 +10683,11 @@
|
|||||||
<string-array name="game_driver_all_apps_preference_values">
|
<string-array name="game_driver_all_apps_preference_values">
|
||||||
<item>@string/game_driver_app_preference_default</item>
|
<item>@string/game_driver_app_preference_default</item>
|
||||||
<item>@string/game_driver_app_preference_game_driver</item>
|
<item>@string/game_driver_app_preference_game_driver</item>
|
||||||
<item>@string/game_driver_app_preference_prerelease_driver</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
<!-- All the values for Game Driver app preference [CHAR LIMIT=50] -->
|
<!-- All the values for Game Driver app preference [CHAR LIMIT=50] -->
|
||||||
<string-array name="game_driver_app_preference_values">
|
<string-array name="game_driver_app_preference_values">
|
||||||
<item>@string/game_driver_app_preference_default</item>
|
<item>@string/game_driver_app_preference_default</item>
|
||||||
<item>@string/game_driver_app_preference_game_driver</item>
|
<item>@string/game_driver_app_preference_game_driver</item>
|
||||||
<item>@string/game_driver_app_preference_prerelease_driver</item>
|
|
||||||
<item>@string/game_driver_app_preference_system</item>
|
<item>@string/game_driver_app_preference_system</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
|||||||
@@ -119,12 +119,11 @@
|
|||||||
android:fragment="com.android.settings.dream.DreamSettings"
|
android:fragment="com.android.settings.dream.DreamSettings"
|
||||||
settings:searchable="false" />
|
settings:searchable="false" />
|
||||||
|
|
||||||
<com.android.settingslib.RestrictedPreference
|
<Preference
|
||||||
android:key="lockscreen_from_display_settings"
|
android:key="lockscreen_from_display_settings"
|
||||||
android:title="@string/lockscreen_settings_title"
|
android:title="@string/lockscreen_settings_title"
|
||||||
android:fragment="com.android.settings.security.LockscreenDashboardFragment"
|
android:fragment="com.android.settings.security.LockscreenDashboardFragment"
|
||||||
settings:controller="com.android.settings.security.screenlock.LockScreenPreferenceController"
|
settings:controller="com.android.settings.security.screenlock.LockScreenPreferenceController" />
|
||||||
settings:userRestriction="no_ambient_display" />
|
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="camera_gesture"
|
android:key="camera_gesture"
|
||||||
|
|||||||
@@ -53,11 +53,12 @@
|
|||||||
android:title="@string/ambient_display_category_triggers"
|
android:title="@string/ambient_display_category_triggers"
|
||||||
android:order="1000">
|
android:order="1000">
|
||||||
|
|
||||||
<SwitchPreference
|
<com.android.settingslib.RestrictedSwitchPreference
|
||||||
android:key="ambient_display_always_on"
|
android:key="ambient_display_always_on"
|
||||||
android:title="@string/doze_always_on_title"
|
android:title="@string/doze_always_on_title"
|
||||||
android:summary="@string/doze_always_on_summary"
|
android:summary="@string/doze_always_on_summary"
|
||||||
settings:controller="com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController" />
|
settings:controller="com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController"
|
||||||
|
settings:userRestriction="no_ambient_display" />
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="ambient_display_tap"
|
android:key="ambient_display_tap"
|
||||||
|
|||||||
@@ -172,11 +172,11 @@ public abstract class BiometricEnrollBase extends InstrumentedActivity {
|
|||||||
if (mUserId == UserHandle.USER_NULL) {
|
if (mUserId == UserHandle.USER_NULL) {
|
||||||
launchedConfirmationActivity = helper.launchConfirmationActivity(CONFIRM_REQUEST,
|
launchedConfirmationActivity = helper.launchConfirmationActivity(CONFIRM_REQUEST,
|
||||||
getString(titleResId),
|
getString(titleResId),
|
||||||
null, null, challenge);
|
null, null, challenge, true /* foregroundOnly */);
|
||||||
} else {
|
} else {
|
||||||
launchedConfirmationActivity = helper.launchConfirmationActivity(CONFIRM_REQUEST,
|
launchedConfirmationActivity = helper.launchConfirmationActivity(CONFIRM_REQUEST,
|
||||||
getString(titleResId),
|
getString(titleResId),
|
||||||
null, null, challenge, mUserId);
|
null, null, challenge, mUserId, true /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
if (!launchedConfirmationActivity) {
|
if (!launchedConfirmationActivity) {
|
||||||
// This shouldn't happen, as we should only end up at this step if a lock thingy is
|
// This shouldn't happen, as we should only end up at this step if a lock thingy is
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public class FaceSettings extends DashboardFragment {
|
|||||||
mConfirmingPassword = true;
|
mConfirmingPassword = true;
|
||||||
if (!helper.launchConfirmationActivity(CONFIRM_REQUEST,
|
if (!helper.launchConfirmationActivity(CONFIRM_REQUEST,
|
||||||
getString(R.string.security_settings_face_preference_title),
|
getString(R.string.security_settings_face_preference_title),
|
||||||
null, null, challenge, mUserId)) {
|
null, null, challenge, mUserId, true /* foregroundOnly */)) {
|
||||||
Log.e(TAG, "Password not set");
|
Log.e(TAG, "Password not set");
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
|
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
|
||||||
if (!helper.launchConfirmationActivity(CONFIRM_REQUEST,
|
if (!helper.launchConfirmationActivity(CONFIRM_REQUEST,
|
||||||
getString(R.string.security_settings_fingerprint_preference_title),
|
getString(R.string.security_settings_fingerprint_preference_title),
|
||||||
null, null, challenge, mUserId)) {
|
null, null, challenge, mUserId, true /* foregroundOnly */)) {
|
||||||
intent.setClassName(SETTINGS_PACKAGE_NAME, ChooseLockGeneric.class.getName());
|
intent.setClassName(SETTINGS_PACKAGE_NAME, ChooseLockGeneric.class.getName());
|
||||||
intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.MINIMUM_QUALITY_KEY,
|
intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.MINIMUM_QUALITY_KEY,
|
||||||
DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
|
DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
|
||||||
|
|||||||
@@ -58,11 +58,13 @@ public class BiometricFragment extends InstrumentedFragment {
|
|||||||
private Bundle mBundle;
|
private Bundle mBundle;
|
||||||
private BiometricPrompt mBiometricPrompt;
|
private BiometricPrompt mBiometricPrompt;
|
||||||
private CancellationSignal mCancellationSignal;
|
private CancellationSignal mCancellationSignal;
|
||||||
|
private boolean mAuthenticating;
|
||||||
|
|
||||||
private AuthenticationCallback mAuthenticationCallback =
|
private AuthenticationCallback mAuthenticationCallback =
|
||||||
new AuthenticationCallback() {
|
new AuthenticationCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onAuthenticationError(int error, @NonNull CharSequence message) {
|
public void onAuthenticationError(int error, @NonNull CharSequence message) {
|
||||||
|
mAuthenticating = false;
|
||||||
mClientExecutor.execute(() -> {
|
mClientExecutor.execute(() -> {
|
||||||
mClientCallback.onAuthenticationError(error, message);
|
mClientCallback.onAuthenticationError(error, message);
|
||||||
});
|
});
|
||||||
@@ -71,6 +73,7 @@ public class BiometricFragment extends InstrumentedFragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAuthenticationSucceeded(AuthenticationResult result) {
|
public void onAuthenticationSucceeded(AuthenticationResult result) {
|
||||||
|
mAuthenticating = false;
|
||||||
mClientExecutor.execute(() -> {
|
mClientExecutor.execute(() -> {
|
||||||
mClientCallback.onAuthenticationSucceeded(result);
|
mClientCallback.onAuthenticationSucceeded(result);
|
||||||
});
|
});
|
||||||
@@ -134,6 +137,10 @@ public class BiometricFragment extends InstrumentedFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isAuthenticating() {
|
||||||
|
return mAuthenticating;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -180,6 +187,7 @@ public class BiometricFragment extends InstrumentedFragment {
|
|||||||
mCancellationSignal = new CancellationSignal();
|
mCancellationSignal = new CancellationSignal();
|
||||||
|
|
||||||
// TODO: CC doesn't use crypto for now
|
// TODO: CC doesn't use crypto for now
|
||||||
|
mAuthenticating = true;
|
||||||
mBiometricPrompt.authenticateUser(mCancellationSignal, mClientExecutor,
|
mBiometricPrompt.authenticateUser(mCancellationSignal, mClientExecutor,
|
||||||
mAuthenticationCallback, mUserId, mCancelCallback);
|
mAuthenticationCallback, mUserId, mCancelCallback);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public final class ChooseLockSettingsHelper {
|
|||||||
public static final String EXTRA_KEY_FOR_FINGERPRINT = "for_fingerprint";
|
public static final String EXTRA_KEY_FOR_FINGERPRINT = "for_fingerprint";
|
||||||
public static final String EXTRA_KEY_FOR_FACE = "for_face";
|
public static final String EXTRA_KEY_FOR_FACE = "for_face";
|
||||||
public static final String EXTRA_KEY_FOR_CHANGE_CRED_REQUIRED_FOR_BOOT = "for_cred_req_boot";
|
public static final String EXTRA_KEY_FOR_CHANGE_CRED_REQUIRED_FOR_BOOT = "for_cred_req_boot";
|
||||||
|
public static final String EXTRA_KEY_FOREGROUND_ONLY = "foreground_only";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intent extra for passing the requested min password complexity to later steps in the set new
|
* Intent extra for passing the requested min password complexity to later steps in the set new
|
||||||
@@ -105,7 +106,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
null /* header */,
|
null /* header */,
|
||||||
null /* description */,
|
null /* description */,
|
||||||
false /* returnCredentials */,
|
false /* returnCredentials */,
|
||||||
false /* external */);
|
false /* external */,
|
||||||
|
false /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,7 +126,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
null /* header */,
|
null /* header */,
|
||||||
null /* description */,
|
null /* description */,
|
||||||
returnCredentials /* returnCredentials */,
|
returnCredentials /* returnCredentials */,
|
||||||
false /* external */);
|
false /* external */,
|
||||||
|
false /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -148,7 +151,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
false /* external */,
|
false /* external */,
|
||||||
false /* hasChallenge */,
|
false /* hasChallenge */,
|
||||||
0 /* challenge */,
|
0 /* challenge */,
|
||||||
Utils.enforceSameOwner(mActivity, userId) /* userId */);
|
Utils.enforceSameOwner(mActivity, userId) /* userId */,
|
||||||
|
false /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,12 +166,13 @@ public final class ChooseLockSettingsHelper {
|
|||||||
* @param external specifies whether this activity is launched externally, meaning that it will
|
* @param external specifies whether this activity is launched externally, meaning that it will
|
||||||
* get a dark theme, allow fingerprint authentication and it will forward
|
* get a dark theme, allow fingerprint authentication and it will forward
|
||||||
* activity result.
|
* activity result.
|
||||||
|
* @param foregroundOnly if the confirmation activity should be finished if it loses foreground.
|
||||||
* @return true if one exists and we launched an activity to confirm it
|
* @return true if one exists and we launched an activity to confirm it
|
||||||
* @see Activity#onActivityResult(int, int, android.content.Intent)
|
* @see Activity#onActivityResult(int, int, android.content.Intent)
|
||||||
*/
|
*/
|
||||||
boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
||||||
@Nullable CharSequence header, @Nullable CharSequence description,
|
@Nullable CharSequence header, @Nullable CharSequence description,
|
||||||
boolean returnCredentials, boolean external) {
|
boolean returnCredentials, boolean external, boolean foregroundOnly) {
|
||||||
return launchConfirmationActivity(
|
return launchConfirmationActivity(
|
||||||
request /* request */,
|
request /* request */,
|
||||||
title /* title */,
|
title /* title */,
|
||||||
@@ -177,7 +182,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
external /* external */,
|
external /* external */,
|
||||||
false /* hasChallenge */,
|
false /* hasChallenge */,
|
||||||
0 /* challenge */,
|
0 /* challenge */,
|
||||||
Utils.getCredentialOwnerUserId(mActivity) /* userId */);
|
Utils.getCredentialOwnerUserId(mActivity) /* userId */,
|
||||||
|
foregroundOnly /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -207,7 +213,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
external /* external */,
|
external /* external */,
|
||||||
false /* hasChallenge */,
|
false /* hasChallenge */,
|
||||||
0 /* challenge */,
|
0 /* challenge */,
|
||||||
Utils.enforceSameOwner(mActivity, userId) /* userId */);
|
Utils.enforceSameOwner(mActivity, userId) /* userId */,
|
||||||
|
false /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -217,12 +224,13 @@ public final class ChooseLockSettingsHelper {
|
|||||||
* @param header header of the confirmation screen; shown as large text
|
* @param header header of the confirmation screen; shown as large text
|
||||||
* @param description description of the confirmation screen
|
* @param description description of the confirmation screen
|
||||||
* @param challenge a challenge to be verified against the device credential.
|
* @param challenge a challenge to be verified against the device credential.
|
||||||
|
* @param foregroundOnly if the confirmation activity should be finished if it loses foreground.
|
||||||
* @return true if one exists and we launched an activity to confirm it
|
* @return true if one exists and we launched an activity to confirm it
|
||||||
* @see Activity#onActivityResult(int, int, android.content.Intent)
|
* @see Activity#onActivityResult(int, int, android.content.Intent)
|
||||||
*/
|
*/
|
||||||
public boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
public boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
||||||
@Nullable CharSequence header, @Nullable CharSequence description,
|
@Nullable CharSequence header, @Nullable CharSequence description,
|
||||||
long challenge) {
|
long challenge, boolean foregroundOnly) {
|
||||||
return launchConfirmationActivity(
|
return launchConfirmationActivity(
|
||||||
request /* request */,
|
request /* request */,
|
||||||
title /* title */,
|
title /* title */,
|
||||||
@@ -232,7 +240,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
false /* external */,
|
false /* external */,
|
||||||
true /* hasChallenge */,
|
true /* hasChallenge */,
|
||||||
challenge /* challenge */,
|
challenge /* challenge */,
|
||||||
Utils.getCredentialOwnerUserId(mActivity) /* userId */);
|
Utils.getCredentialOwnerUserId(mActivity) /* userId */,
|
||||||
|
foregroundOnly /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -243,12 +252,13 @@ public final class ChooseLockSettingsHelper {
|
|||||||
* @param description description of the confirmation screen
|
* @param description description of the confirmation screen
|
||||||
* @param challenge a challenge to be verified against the device credential.
|
* @param challenge a challenge to be verified against the device credential.
|
||||||
* @param userId The userId for whom the lock should be confirmed.
|
* @param userId The userId for whom the lock should be confirmed.
|
||||||
|
* @param foregroundOnly if the confirmation activity should be finished if it loses foreground.
|
||||||
* @return true if one exists and we launched an activity to confirm it
|
* @return true if one exists and we launched an activity to confirm it
|
||||||
* @see Activity#onActivityResult(int, int, android.content.Intent)
|
* @see Activity#onActivityResult(int, int, android.content.Intent)
|
||||||
*/
|
*/
|
||||||
public boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
public boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
||||||
@Nullable CharSequence header, @Nullable CharSequence description,
|
@Nullable CharSequence header, @Nullable CharSequence description,
|
||||||
long challenge, int userId) {
|
long challenge, int userId, boolean foregroundOnly) {
|
||||||
return launchConfirmationActivity(
|
return launchConfirmationActivity(
|
||||||
request /* request */,
|
request /* request */,
|
||||||
title /* title */,
|
title /* title */,
|
||||||
@@ -258,7 +268,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
false /* external */,
|
false /* external */,
|
||||||
true /* hasChallenge */,
|
true /* hasChallenge */,
|
||||||
challenge /* challenge */,
|
challenge /* challenge */,
|
||||||
Utils.enforceSameOwner(mActivity, userId) /* userId */);
|
Utils.enforceSameOwner(mActivity, userId) /* userId */,
|
||||||
|
foregroundOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -287,7 +298,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
external /* external */,
|
external /* external */,
|
||||||
true /* hasChallenge */,
|
true /* hasChallenge */,
|
||||||
challenge /* challenge */,
|
challenge /* challenge */,
|
||||||
Utils.enforceSameOwner(mActivity, userId) /* userId */);
|
Utils.enforceSameOwner(mActivity, userId) /* userId */,
|
||||||
|
false /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -316,7 +328,7 @@ public final class ChooseLockSettingsHelper {
|
|||||||
private boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
private boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
||||||
@Nullable CharSequence header, @Nullable CharSequence description,
|
@Nullable CharSequence header, @Nullable CharSequence description,
|
||||||
boolean returnCredentials, boolean external, boolean hasChallenge,
|
boolean returnCredentials, boolean external, boolean hasChallenge,
|
||||||
long challenge, int userId) {
|
long challenge, int userId, boolean foregroundOnly) {
|
||||||
return launchConfirmationActivity(
|
return launchConfirmationActivity(
|
||||||
request /* request */,
|
request /* request */,
|
||||||
title /* title */,
|
title /* title */,
|
||||||
@@ -328,7 +340,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
challenge /* challenge */,
|
challenge /* challenge */,
|
||||||
userId /* userId */,
|
userId /* userId */,
|
||||||
null /* alternateButton */,
|
null /* alternateButton */,
|
||||||
null /* extras */);
|
null /* extras */,
|
||||||
|
foregroundOnly /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
private boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
||||||
@@ -346,7 +359,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
challenge /* challenge */,
|
challenge /* challenge */,
|
||||||
userId /* userId */,
|
userId /* userId */,
|
||||||
null /* alternateButton */,
|
null /* alternateButton */,
|
||||||
extras /* extras */);
|
extras /* extras */,
|
||||||
|
false /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean launchFrpConfirmationActivity(int request, @Nullable CharSequence header,
|
public boolean launchFrpConfirmationActivity(int request, @Nullable CharSequence header,
|
||||||
@@ -362,13 +376,15 @@ public final class ChooseLockSettingsHelper {
|
|||||||
0 /* challenge */,
|
0 /* challenge */,
|
||||||
LockPatternUtils.USER_FRP /* userId */,
|
LockPatternUtils.USER_FRP /* userId */,
|
||||||
alternateButton /* alternateButton */,
|
alternateButton /* alternateButton */,
|
||||||
null /* extras */);
|
null /* extras */,
|
||||||
|
false /* foregroundOnly */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
private boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
|
||||||
@Nullable CharSequence header, @Nullable CharSequence description,
|
@Nullable CharSequence header, @Nullable CharSequence description,
|
||||||
boolean returnCredentials, boolean external, boolean hasChallenge,
|
boolean returnCredentials, boolean external, boolean hasChallenge,
|
||||||
long challenge, int userId, @Nullable CharSequence alternateButton, Bundle extras) {
|
long challenge, int userId, @Nullable CharSequence alternateButton, Bundle extras,
|
||||||
|
boolean foregroundOnly) {
|
||||||
final int effectiveUserId = UserManager.get(mActivity).getCredentialOwnerProfile(userId);
|
final int effectiveUserId = UserManager.get(mActivity).getCredentialOwnerProfile(userId);
|
||||||
boolean launched = false;
|
boolean launched = false;
|
||||||
|
|
||||||
@@ -378,7 +394,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
returnCredentials || hasChallenge
|
returnCredentials || hasChallenge
|
||||||
? ConfirmLockPattern.InternalActivity.class
|
? ConfirmLockPattern.InternalActivity.class
|
||||||
: ConfirmLockPattern.class, returnCredentials, external,
|
: ConfirmLockPattern.class, returnCredentials, external,
|
||||||
hasChallenge, challenge, userId, alternateButton, extras);
|
hasChallenge, challenge, userId, alternateButton, extras,
|
||||||
|
foregroundOnly);
|
||||||
break;
|
break;
|
||||||
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
|
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
|
||||||
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
|
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
|
||||||
@@ -390,7 +407,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
returnCredentials || hasChallenge
|
returnCredentials || hasChallenge
|
||||||
? ConfirmLockPassword.InternalActivity.class
|
? ConfirmLockPassword.InternalActivity.class
|
||||||
: ConfirmLockPassword.class, returnCredentials, external,
|
: ConfirmLockPassword.class, returnCredentials, external,
|
||||||
hasChallenge, challenge, userId, alternateButton, extras);
|
hasChallenge, challenge, userId, alternateButton, extras,
|
||||||
|
foregroundOnly);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return launched;
|
return launched;
|
||||||
@@ -399,7 +417,8 @@ public final class ChooseLockSettingsHelper {
|
|||||||
private boolean launchConfirmationActivity(int request, CharSequence title, CharSequence header,
|
private boolean launchConfirmationActivity(int request, CharSequence title, CharSequence header,
|
||||||
CharSequence message, Class<?> activityClass, boolean returnCredentials,
|
CharSequence message, Class<?> activityClass, boolean returnCredentials,
|
||||||
boolean external, boolean hasChallenge, long challenge,
|
boolean external, boolean hasChallenge, long challenge,
|
||||||
int userId, @Nullable CharSequence alternateButton, Bundle extras) {
|
int userId, @Nullable CharSequence alternateButton, Bundle extras,
|
||||||
|
boolean foregroundOnly) {
|
||||||
final Intent intent = new Intent();
|
final Intent intent = new Intent();
|
||||||
intent.putExtra(ConfirmDeviceCredentialBaseFragment.TITLE_TEXT, title);
|
intent.putExtra(ConfirmDeviceCredentialBaseFragment.TITLE_TEXT, title);
|
||||||
intent.putExtra(ConfirmDeviceCredentialBaseFragment.HEADER_TEXT, header);
|
intent.putExtra(ConfirmDeviceCredentialBaseFragment.HEADER_TEXT, header);
|
||||||
@@ -414,6 +433,7 @@ public final class ChooseLockSettingsHelper {
|
|||||||
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, challenge);
|
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, challenge);
|
||||||
intent.putExtra(Intent.EXTRA_USER_ID, userId);
|
intent.putExtra(Intent.EXTRA_USER_ID, userId);
|
||||||
intent.putExtra(KeyguardManager.EXTRA_ALTERNATE_BUTTON_LABEL, alternateButton);
|
intent.putExtra(KeyguardManager.EXTRA_ALTERNATE_BUTTON_LABEL, alternateButton);
|
||||||
|
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOREGROUND_ONLY, foregroundOnly);
|
||||||
if (extras != null) {
|
if (extras != null) {
|
||||||
intent.putExtras(extras);
|
intent.putExtras(extras);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,8 +251,11 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
if (!isChangingConfigurations()) {
|
if (!isChangingConfigurations()) {
|
||||||
mGoingToBackground = true;
|
mGoingToBackground = true;
|
||||||
if (mBiometricFragment != null) {
|
if (mBiometricFragment != null) {
|
||||||
|
Log.d(TAG, "Authenticating: " + mBiometricFragment.isAuthenticating());
|
||||||
|
if (mBiometricFragment.isAuthenticating()) {
|
||||||
mBiometricFragment.cancel();
|
mBiometricFragment.cancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mIsFallback && !mCCLaunched) {
|
if (mIsFallback && !mCCLaunched) {
|
||||||
mBiometricManager.onConfirmDeviceCredentialError(
|
mBiometricManager.onConfirmDeviceCredentialError(
|
||||||
|
|||||||
@@ -172,6 +172,10 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
|
|||||||
mBiometricManager.onConfirmDeviceCredentialError(
|
mBiometricManager.onConfirmDeviceCredentialError(
|
||||||
BiometricConstants.BIOMETRIC_ERROR_USER_CANCELED,
|
BiometricConstants.BIOMETRIC_ERROR_USER_CANCELED,
|
||||||
getString(com.android.internal.R.string.biometric_error_user_canceled));
|
getString(com.android.internal.R.string.biometric_error_user_canceled));
|
||||||
|
if (getIntent().getBooleanExtra(
|
||||||
|
ChooseLockSettingsHelper.EXTRA_KEY_FOREGROUND_ONLY, false)) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,8 +56,7 @@ public class GameDriverAppPreferenceControllerTest {
|
|||||||
|
|
||||||
private static final int DEFAULT = 0;
|
private static final int DEFAULT = 0;
|
||||||
private static final int GAME_DRIVER = 1;
|
private static final int GAME_DRIVER = 1;
|
||||||
private static final int PRERELEASE_DRIVER = 2;
|
private static final int SYSTEM = 2;
|
||||||
private static final int SYSTEM = 3;
|
|
||||||
private static final String TEST_APP_NAME = "testApp";
|
private static final String TEST_APP_NAME = "testApp";
|
||||||
private static final String TEST_PKG_NAME = "testPkg";
|
private static final String TEST_PKG_NAME = "testPkg";
|
||||||
|
|
||||||
@@ -80,6 +79,7 @@ public class GameDriverAppPreferenceControllerTest {
|
|||||||
private GameDriverAppPreferenceController mController;
|
private GameDriverAppPreferenceController mController;
|
||||||
private CharSequence[] mValueList;
|
private CharSequence[] mValueList;
|
||||||
private String mDialogTitle;
|
private String mDialogTitle;
|
||||||
|
private String mPreferencePrereleaseDriver;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
@@ -89,6 +89,8 @@ public class GameDriverAppPreferenceControllerTest {
|
|||||||
mValueList =
|
mValueList =
|
||||||
mContext.getResources().getStringArray(R.array.game_driver_app_preference_values);
|
mContext.getResources().getStringArray(R.array.game_driver_app_preference_values);
|
||||||
mDialogTitle = mContext.getResources().getString(R.string.game_driver_app_preference_title);
|
mDialogTitle = mContext.getResources().getString(R.string.game_driver_app_preference_title);
|
||||||
|
mPreferencePrereleaseDriver =
|
||||||
|
mContext.getResources().getString(R.string.game_driver_app_preference_prerelease_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -207,9 +209,7 @@ public class GameDriverAppPreferenceControllerTest {
|
|||||||
assertThat(preference.getDialogTitle()).isEqualTo(mDialogTitle);
|
assertThat(preference.getDialogTitle()).isEqualTo(mDialogTitle);
|
||||||
assertThat(preference.getEntries()).isEqualTo(mValueList);
|
assertThat(preference.getEntries()).isEqualTo(mValueList);
|
||||||
assertThat(preference.getEntryValues()).isEqualTo(mValueList);
|
assertThat(preference.getEntryValues()).isEqualTo(mValueList);
|
||||||
assertThat(preference.getEntry()).isEqualTo(mValueList[PRERELEASE_DRIVER]);
|
assertThat(preference.getSummary()).isEqualTo(mPreferencePrereleaseDriver);
|
||||||
assertThat(preference.getValue()).isEqualTo(mValueList[PRERELEASE_DRIVER]);
|
|
||||||
assertThat(preference.getSummary()).isEqualTo(mValueList[PRERELEASE_DRIVER]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user