Snap for 12153359 from 691c0c3f6a to 24Q4-release
Change-Id: I44ea5f99f362fbc3fb75ed078ddbd52b4fc67b1d
This commit is contained in:
@@ -31,3 +31,13 @@ flag {
|
|||||||
description: "Gates whether to enable bluetooth device details polish"
|
description: "Gates whether to enable bluetooth device details polish"
|
||||||
bug: "343317785"
|
bug: "343317785"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flag {
|
||||||
|
name: "disable_bonding_cancellation_for_orientation_change"
|
||||||
|
namespace: "cross_device_experiences"
|
||||||
|
description: "Stop cancelling bonding process when there is an orientation change"
|
||||||
|
bug: "349542301"
|
||||||
|
metadata {
|
||||||
|
purpose: PURPOSE_BUGFIX
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12238,11 +12238,11 @@
|
|||||||
<!-- Default title for the settings panel [CHAR LIMIT=NONE] -->
|
<!-- Default title for the settings panel [CHAR LIMIT=NONE] -->
|
||||||
<string name="settings_panel_title">Settings Panel</string>
|
<string name="settings_panel_title">Settings Panel</string>
|
||||||
|
|
||||||
<!-- Title for a toggle that enables freeform windowing experiences. Freeform windowing experiences are features involving apps running in resizable windows. [CHAR LIMIT=50] -->
|
<!-- Title for a toggle that enables freeform windows. Freeform windows enables users to freely arrange and resize overlapping apps. [CHAR LIMIT=50] -->
|
||||||
<string name="enable_desktop_mode">Enable freeform windowing experiences</string>
|
<string name="enable_desktop_mode">Enable freeform windows</string>
|
||||||
|
|
||||||
<!-- Title for a toggle that enables desktop mode on secondary display. [CHAR LIMIT=50] -->
|
<!-- Title for a toggle that enables freeform windows on secondary display. Freeform windows enables users to freely arrange and resize overlapping apps. [CHAR LIMIT=50] -->
|
||||||
<string name="enable_desktop_mode_on_secondary_display">Enable desktop mode on secondary display</string>
|
<string name="enable_desktop_mode_on_secondary_display">Enable freeform windows on secondary display</string>
|
||||||
|
|
||||||
<!-- UI debug setting: enable non-resizables in multi window [CHAR LIMIT=60] -->
|
<!-- UI debug setting: enable non-resizables in multi window [CHAR LIMIT=60] -->
|
||||||
<string name="enable_non_resizable_multi_window">Enable non-resizable in multi window</string>
|
<string name="enable_non_resizable_multi_window">Enable non-resizable in multi window</string>
|
||||||
@@ -13202,12 +13202,12 @@
|
|||||||
<!-- The content description for accessibility tools of the customize button. It specifies which screensaver the user is customizing [CHAR LIMIT=NONE] -->
|
<!-- The content description for accessibility tools of the customize button. It specifies which screensaver the user is customizing [CHAR LIMIT=NONE] -->
|
||||||
<string name="customize_button_description">Customize <xliff:g id="screensaver_name" example="Art Gallery">%1$s</xliff:g></string>
|
<string name="customize_button_description">Customize <xliff:g id="screensaver_name" example="Art Gallery">%1$s</xliff:g></string>
|
||||||
|
|
||||||
<!-- Dialog body text used to explain a reboot is required after enabling freeform window support for it to work. Freeform window is when an app runs in a resizable window. [CHAR LIMIT=none] -->
|
<!-- Dialog body text used to explain a reboot is required after enabling freeform window support for it to work. Freeform windows enables users to freely arrange and resize overlapping apps. [CHAR LIMIT=none] -->
|
||||||
<string name="reboot_dialog_enable_freeform_support">A reboot is required to enable freeform window support.</string>
|
<string name="reboot_dialog_enable_freeform_support">A reboot is required to enable freeform window support.</string>
|
||||||
<!-- Dialog body text used to explain a reboot is required after updating availability of freeform windowing experiences. Freeform windowing experiences are features involving apps running in resizable windows. [CHAR LIMIT=none] -->
|
<!-- Dialog body text used to explain a reboot is required after updating availability of freeform windows. Freeform windows enables users to freely arrange and resize overlapping apps. [CHAR LIMIT=none] -->
|
||||||
<string name="reboot_dialog_override_desktop_mode">A reboot is required to update availability of freeform windowing experiences.</string>
|
<string name="reboot_dialog_override_desktop_mode">A reboot is required to update availability of freeform windows.</string>
|
||||||
<!-- Dialog body text used to explain a reboot is required after enabling desktop mode on secondary displays. [CHAR LIMIT=none] -->
|
<!-- Dialog body text used to explain a reboot is required after enabling freeform windows on secondary displays. Freeform windows enables users to freely arrange and resize overlapping apps. [CHAR LIMIT=none] -->
|
||||||
<string name="reboot_dialog_enable_desktop_mode_on_secondary_display">A reboot is required to enable desktop mode on secondary displays.</string>
|
<string name="reboot_dialog_enable_desktop_mode_on_secondary_display">A reboot is required to enable freeform windows on secondary displays.</string>
|
||||||
<!-- Text on the dialog button to reboot the device now [CHAR LIMIT=50] -->
|
<!-- Text on the dialog button to reboot the device now [CHAR LIMIT=50] -->
|
||||||
<string name="reboot_dialog_reboot_now">Reboot now</string>
|
<string name="reboot_dialog_reboot_now">Reboot now</string>
|
||||||
<!-- Text on the dialog button to reboot the device later [CHAR LIMIT=50] -->
|
<!-- Text on the dialog button to reboot the device later [CHAR LIMIT=50] -->
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ public class MainClear extends InstrumentedFragment implements OnGlobalLayoutLis
|
|||||||
false /* biometricsAuthenticationRequested */,
|
false /* biometricsAuthenticationRequested */,
|
||||||
userId)) {
|
userId)) {
|
||||||
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRICS_REQUEST,
|
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRICS_REQUEST,
|
||||||
userId);
|
userId, false /* hideBackground */);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
|
|||||||
import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
|
import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
|
||||||
|
|
||||||
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_AUTHENTICATORS;
|
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_AUTHENTICATORS;
|
||||||
|
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_HIDE_BACKGROUND;
|
||||||
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_NEGATIVE_BUTTON_TEXT;
|
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_NEGATIVE_BUTTON_TEXT;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
@@ -1522,9 +1523,10 @@ public final class Utils extends com.android.settingslib.Utils {
|
|||||||
* @param fragment corresponding fragment of the surface
|
* @param fragment corresponding fragment of the surface
|
||||||
* @param requestCode for starting the new activity
|
* @param requestCode for starting the new activity
|
||||||
* @param userId user id for the authentication request
|
* @param userId user id for the authentication request
|
||||||
|
* @param hideBackground if the background activity screen needs to be hidden
|
||||||
*/
|
*/
|
||||||
public static void launchBiometricPromptForMandatoryBiometrics(@NonNull Fragment fragment,
|
public static void launchBiometricPromptForMandatoryBiometrics(@NonNull Fragment fragment,
|
||||||
int requestCode, int userId) {
|
int requestCode, int userId, boolean hideBackground) {
|
||||||
final Intent intent = new Intent();
|
final Intent intent = new Intent();
|
||||||
intent.putExtra(BIOMETRIC_PROMPT_AUTHENTICATORS,
|
intent.putExtra(BIOMETRIC_PROMPT_AUTHENTICATORS,
|
||||||
BiometricManager.Authenticators.MANDATORY_BIOMETRICS);
|
BiometricManager.Authenticators.MANDATORY_BIOMETRICS);
|
||||||
@@ -1534,6 +1536,7 @@ public final class Utils extends com.android.settingslib.Utils {
|
|||||||
fragment.getString(R.string.mandatory_biometrics_prompt_description));
|
fragment.getString(R.string.mandatory_biometrics_prompt_description));
|
||||||
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_ALLOW_ANY_USER, true);
|
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_ALLOW_ANY_USER, true);
|
||||||
intent.putExtra(EXTRA_USER_ID, userId);
|
intent.putExtra(EXTRA_USER_ID, userId);
|
||||||
|
intent.putExtra(BIOMETRIC_PROMPT_HIDE_BACKGROUND, hideBackground);
|
||||||
intent.setClassName(SETTINGS_PACKAGE_NAME,
|
intent.setClassName(SETTINGS_PACKAGE_NAME,
|
||||||
ConfirmDeviceCredentialActivity.InternalActivity.class.getName());
|
ConfirmDeviceCredentialActivity.InternalActivity.class.getName());
|
||||||
fragment.startActivityForResult(intent, requestCode);
|
fragment.startActivityForResult(intent, requestCode);
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public abstract class BiometricsSettingsBase extends DashboardFragment {
|
|||||||
mBiometricsAuthenticationRequested, mUserId)) {
|
mBiometricsAuthenticationRequested, mUserId)) {
|
||||||
mBiometricsAuthenticationRequested = true;
|
mBiometricsAuthenticationRequested = true;
|
||||||
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
||||||
mUserId);
|
mUserId, true /* hideBackground */);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUnlockPhonePreferenceSummary();
|
updateUnlockPhonePreferenceSummary();
|
||||||
@@ -166,7 +166,7 @@ public abstract class BiometricsSettingsBase extends DashboardFragment {
|
|||||||
&& mGkPwHandle != 0L) {
|
&& mGkPwHandle != 0L) {
|
||||||
mBiometricsAuthenticationRequested = true;
|
mBiometricsAuthenticationRequested = true;
|
||||||
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
||||||
mUserId);
|
mUserId, true /* hideBackground */);
|
||||||
}
|
}
|
||||||
if (!mConfirmCredential) {
|
if (!mConfirmCredential) {
|
||||||
mDoNotFinishActivity = false;
|
mDoNotFinishActivity = false;
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ public class FaceSettings extends DashboardFragment {
|
|||||||
mUserId)) {
|
mUserId)) {
|
||||||
mBiometricsAuthenticationRequested = true;
|
mBiometricsAuthenticationRequested = true;
|
||||||
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
||||||
mUserId);
|
mUserId, true /* hideBackground */);
|
||||||
} else {
|
} else {
|
||||||
mAttentionController.setToken(mToken);
|
mAttentionController.setToken(mToken);
|
||||||
mEnrollController.setToken(mToken);
|
mEnrollController.setToken(mToken);
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
mUserId)) {
|
mUserId)) {
|
||||||
mBiometricsAuthenticationRequested = true;
|
mBiometricsAuthenticationRequested = true;
|
||||||
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
||||||
mUserId);
|
mUserId, true /* hideBackground */);
|
||||||
} else if (!mHasFirstEnrolled) {
|
} else if (!mHasFirstEnrolled) {
|
||||||
mIsEnrolling = true;
|
mIsEnrolling = true;
|
||||||
addFirstFingerprint(null);
|
addFirstFingerprint(null);
|
||||||
@@ -784,7 +784,7 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
mUserId)) {
|
mUserId)) {
|
||||||
mBiometricsAuthenticationRequested = true;
|
mBiometricsAuthenticationRequested = true;
|
||||||
Utils.launchBiometricPromptForMandatoryBiometrics(this,
|
Utils.launchBiometricPromptForMandatoryBiometrics(this,
|
||||||
BIOMETRIC_AUTH_REQUEST, mUserId);
|
BIOMETRIC_AUTH_REQUEST, mUserId, true /* hideBackground */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import androidx.appcompat.app.AlertDialog;
|
|||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||||
|
import com.android.settings.flags.Flags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A dialogFragment used by {@link BluetoothPairingDialog} to create an appropriately styled dialog
|
* A dialogFragment used by {@link BluetoothPairingDialog} to create an appropriately styled dialog
|
||||||
@@ -87,14 +88,17 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if (mPairingController.getDialogType()
|
/* Cancel pairing unless 1) explicitly accepted by user 2) the event is triggered by
|
||||||
!= BluetoothPairingController.DISPLAY_PASSKEY_DIALOG) {
|
* orientation change. */
|
||||||
/* Cancel pairing unless explicitly accepted by user */
|
boolean shouldCancelPairing =
|
||||||
if (!mPositiveClicked) {
|
Flags.disableBondingCancellationForOrientationChange()
|
||||||
|
? !mPositiveClicked && !getActivity().isChangingConfigurations()
|
||||||
|
: !mPositiveClicked;
|
||||||
|
if (mPairingController.getDialogType() != BluetoothPairingController.DISPLAY_PASSKEY_DIALOG
|
||||||
|
&& shouldCancelPairing) {
|
||||||
mPairingController.onCancel();
|
mPairingController.onCancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import android.app.settings.SettingsEnums
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.telephony.SubscriptionManager
|
import android.telephony.SubscriptionManager
|
||||||
|
import android.view.View
|
||||||
import com.android.settings.R
|
import com.android.settings.R
|
||||||
import com.android.settings.SettingsActivity
|
import com.android.settings.SettingsActivity
|
||||||
import com.android.settings.dashboard.DashboardFragment
|
import com.android.settings.dashboard.DashboardFragment
|
||||||
@@ -45,8 +46,8 @@ class DataSaverSummary : DashboardFragment() {
|
|||||||
dataSaverBackend = DataSaverBackend(requireContext())
|
dataSaverBackend = DataSaverBackend(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onActivityCreated(savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
switchBar = (activity as SettingsActivity).switchBar.apply {
|
switchBar = (activity as SettingsActivity).switchBar.apply {
|
||||||
setTitle(getString(R.string.data_saver_switch_title))
|
setTitle(getString(R.string.data_saver_switch_title))
|
||||||
show()
|
show()
|
||||||
|
|||||||
@@ -67,6 +67,12 @@ public class DesktopModeSecondaryDisplayPreferenceController extends
|
|||||||
Settings.Global.putInt(mContext.getContentResolver(),
|
Settings.Global.putInt(mContext.getContentResolver(),
|
||||||
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
|
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
|
||||||
isEnabled ? SETTING_VALUE_ON : SETTING_VALUE_OFF);
|
isEnabled ? SETTING_VALUE_ON : SETTING_VALUE_OFF);
|
||||||
|
// Update freeform window support on device.
|
||||||
|
// DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT setting enables freeform support on device
|
||||||
|
// where it's not present by default.
|
||||||
|
Settings.Global.putInt(mContext.getContentResolver(),
|
||||||
|
Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT,
|
||||||
|
isEnabled ? SETTING_VALUE_ON : SETTING_VALUE_OFF);
|
||||||
if (isEnabled && mFragment != null) {
|
if (isEnabled && mFragment != null) {
|
||||||
RebootConfirmationDialogFragment.show(
|
RebootConfirmationDialogFragment.show(
|
||||||
mFragment, R.string.reboot_dialog_enable_desktop_mode_on_secondary_display,
|
mFragment, R.string.reboot_dialog_enable_desktop_mode_on_secondary_display,
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ public class Enable16kUtils {
|
|||||||
try (BufferedReader br = new BufferedReader(new FileReader("/proc/mounts"))) {
|
try (BufferedReader br = new BufferedReader(new FileReader("/proc/mounts"))) {
|
||||||
String line;
|
String line;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
Log.i(TAG, line);
|
|
||||||
final String[] fields = line.split(" ");
|
final String[] fields = line.split(" ");
|
||||||
final String partition = fields[1];
|
final String partition = fields[1];
|
||||||
final String fsType = fields[2];
|
final String fsType = fields[2];
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ import java.util.Map;
|
|||||||
* containing links to each individual mode. This is a central controller that populates and updates
|
* containing links to each individual mode. This is a central controller that populates and updates
|
||||||
* all the preferences that then lead to a mode configuration page.
|
* all the preferences that then lead to a mode configuration page.
|
||||||
*/
|
*/
|
||||||
class ZenModesListPreferenceController extends BasePreferenceController {
|
class ZenModesListPreferenceController extends BasePreferenceController
|
||||||
|
implements BasePreferenceController.UiBlocker {
|
||||||
protected static final String KEY = "zen_modes_list";
|
protected static final String KEY = "zen_modes_list";
|
||||||
|
|
||||||
protected ZenModesBackend mBackend;
|
protected ZenModesBackend mBackend;
|
||||||
@@ -48,11 +49,6 @@ class ZenModesListPreferenceController extends BasePreferenceController {
|
|||||||
mBackend = backend;
|
mBackend = backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getPreferenceKey() {
|
|
||||||
return KEY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@AvailabilityStatus
|
@AvailabilityStatus
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
@@ -97,6 +93,8 @@ class ZenModesListPreferenceController extends BasePreferenceController {
|
|||||||
for (String key : originalPreferences.keySet()) {
|
for (String key : originalPreferences.keySet()) {
|
||||||
category.removePreferenceRecursively(key);
|
category.removePreferenceRecursively(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setUiBlockerFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Provide search data for the modes, which will allow users to reach the modes page if they
|
// Provide search data for the modes, which will allow users to reach the modes page if they
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
mBiometricsAuthSuccessful, mWaitingForConfirmation, mUserId)) {
|
mBiometricsAuthSuccessful, mWaitingForConfirmation, mUserId)) {
|
||||||
mWaitingForConfirmation = true;
|
mWaitingForConfirmation = true;
|
||||||
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
|
||||||
mUserId);
|
mUserId, true /* hideBackground */);
|
||||||
}
|
}
|
||||||
} else if (requestCode == BIOMETRIC_AUTH_REQUEST) {
|
} else if (requestCode == BIOMETRIC_AUTH_REQUEST) {
|
||||||
if (resultCode == Activity.RESULT_OK) {
|
if (resultCode == Activity.RESULT_OK) {
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
public static final String BIOMETRIC_PROMPT_AUTHENTICATORS = "biometric_prompt_authenticators";
|
public static final String BIOMETRIC_PROMPT_AUTHENTICATORS = "biometric_prompt_authenticators";
|
||||||
public static final String BIOMETRIC_PROMPT_NEGATIVE_BUTTON_TEXT =
|
public static final String BIOMETRIC_PROMPT_NEGATIVE_BUTTON_TEXT =
|
||||||
"biometric_prompt_negative_button_text";
|
"biometric_prompt_negative_button_text";
|
||||||
|
public static final String BIOMETRIC_PROMPT_HIDE_BACKGROUND =
|
||||||
|
"biometric_prompt_hide_background";
|
||||||
|
|
||||||
public static class InternalActivity extends ConfirmDeviceCredentialActivity {
|
public static class InternalActivity extends ConfirmDeviceCredentialActivity {
|
||||||
}
|
}
|
||||||
@@ -165,15 +167,20 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
final Intent intent = getIntent();
|
||||||
|
if (intent.getBooleanExtra(BIOMETRIC_PROMPT_HIDE_BACKGROUND, false)) {
|
||||||
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
||||||
|
getWindow().setDimAmount(1);
|
||||||
|
intent.removeExtra(BIOMETRIC_PROMPT_HIDE_BACKGROUND);
|
||||||
|
} else {
|
||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||||
getWindow().setStatusBarColor(Color.TRANSPARENT);
|
getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||||
|
}
|
||||||
|
|
||||||
mDevicePolicyManager = getSystemService(DevicePolicyManager.class);
|
mDevicePolicyManager = getSystemService(DevicePolicyManager.class);
|
||||||
mUserManager = UserManager.get(this);
|
mUserManager = UserManager.get(this);
|
||||||
mTrustManager = getSystemService(TrustManager.class);
|
mTrustManager = getSystemService(TrustManager.class);
|
||||||
mLockPatternUtils = new LockPatternUtils(this);
|
mLockPatternUtils = new LockPatternUtils(this);
|
||||||
|
|
||||||
Intent intent = getIntent();
|
|
||||||
mContext = this;
|
mContext = this;
|
||||||
mCheckDevicePolicyManager = intent
|
mCheckDevicePolicyManager = intent
|
||||||
.getBooleanExtra(KeyguardManager.EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS, false);
|
.getBooleanExtra(KeyguardManager.EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS, false);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import static android.hardware.biometrics.SensorProperties.STRENGTH_WEAK;
|
|||||||
|
|
||||||
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
||||||
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_AUTHENTICATORS;
|
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_AUTHENTICATORS;
|
||||||
|
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_HIDE_BACKGROUND;
|
||||||
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_NEGATIVE_BUTTON_TEXT;
|
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_NEGATIVE_BUTTON_TEXT;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
@@ -581,7 +582,8 @@ public class UtilsTest {
|
|||||||
|
|
||||||
final int requestCode = 1;
|
final int requestCode = 1;
|
||||||
final ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class);
|
final ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class);
|
||||||
Utils.launchBiometricPromptForMandatoryBiometrics(mFragment, requestCode, USER_ID);
|
Utils.launchBiometricPromptForMandatoryBiometrics(mFragment, requestCode, USER_ID,
|
||||||
|
false /* hideBackground */);
|
||||||
|
|
||||||
verify(mFragment).startActivityForResult(intentArgumentCaptor.capture(), eq(requestCode));
|
verify(mFragment).startActivityForResult(intentArgumentCaptor.capture(), eq(requestCode));
|
||||||
|
|
||||||
@@ -593,6 +595,8 @@ public class UtilsTest {
|
|||||||
assertThat(intent.getExtra(KeyguardManager.EXTRA_DESCRIPTION)).isNotNull();
|
assertThat(intent.getExtra(KeyguardManager.EXTRA_DESCRIPTION)).isNotNull();
|
||||||
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_ALLOW_ANY_USER, false))
|
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_ALLOW_ANY_USER, false))
|
||||||
.isTrue();
|
.isTrue();
|
||||||
|
assertThat(intent.getBooleanExtra(BIOMETRIC_PROMPT_HIDE_BACKGROUND, true))
|
||||||
|
.isFalse();
|
||||||
assertThat(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).isEqualTo(USER_ID);
|
assertThat(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).isEqualTo(USER_ID);
|
||||||
assertThat(intent.getComponent().getPackageName()).isEqualTo(SETTINGS_PACKAGE_NAME);
|
assertThat(intent.getComponent().getPackageName()).isEqualTo(SETTINGS_PACKAGE_NAME);
|
||||||
assertThat(intent.getComponent().getClassName()).isEqualTo(
|
assertThat(intent.getComponent().getClassName()).isEqualTo(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.settings.development;
|
package com.android.settings.development;
|
||||||
|
|
||||||
|
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT;
|
||||||
import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS;
|
import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS;
|
||||||
|
|
||||||
import static com.android.settings.development.DesktopModeSecondaryDisplayPreferenceController.SETTING_VALUE_OFF;
|
import static com.android.settings.development.DesktopModeSecondaryDisplayPreferenceController.SETTING_VALUE_OFF;
|
||||||
@@ -55,6 +56,7 @@ public class DesktopModeSecondaryDisplayPreferenceControllerTest {
|
|||||||
|
|
||||||
private static final String ENG_BUILD_TYPE = "eng";
|
private static final String ENG_BUILD_TYPE = "eng";
|
||||||
private static final String USER_BUILD_TYPE = "user";
|
private static final String USER_BUILD_TYPE = "user";
|
||||||
|
private static final int SETTING_VALUE_INVALID = -1;
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
private SwitchPreference mPreference;
|
private SwitchPreference mPreference;
|
||||||
@@ -102,21 +104,41 @@ public class DesktopModeSecondaryDisplayPreferenceControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onPreferenceChange_switchEnabled_enablesDesktopModeOnSecondaryDisplay() {
|
public void onPreferenceChange_switchEnabled_enablesDesktopModeOnSecondaryDisplay() {
|
||||||
mController.onPreferenceChange(mPreference, true /* new value */);
|
mController.onPreferenceChange(mPreference, /* newValue= */ true);
|
||||||
|
|
||||||
final int mode = Settings.Global.getInt(mContext.getContentResolver(),
|
final int mode = Settings.Global.getInt(mContext.getContentResolver(),
|
||||||
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS, -1 /* default */);
|
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
|
||||||
|
/* def= */ SETTING_VALUE_INVALID);
|
||||||
assertThat(mode).isEqualTo(SETTING_VALUE_ON);
|
assertThat(mode).isEqualTo(SETTING_VALUE_ON);
|
||||||
|
|
||||||
verify(mTransaction).add(any(RebootConfirmationDialogFragment.class), any());
|
verify(mTransaction).add(any(RebootConfirmationDialogFragment.class), any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onPreferenceChange_switchDisabled_disablesDesktopModeOnSecondaryDisplay() {
|
public void onPreferenceChange_switchEnabled_enablesFreeformSupport() {
|
||||||
mController.onPreferenceChange(mPreference, false /* new value */);
|
mController.onPreferenceChange(mPreference, /* newValue= */ true);
|
||||||
|
|
||||||
final int mode = Settings.Global.getInt(mContext.getContentResolver(),
|
final int mode = Settings.Global.getInt(mContext.getContentResolver(),
|
||||||
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS, -1 /* default */);
|
DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, /* def= */ SETTING_VALUE_INVALID);
|
||||||
|
assertThat(mode).isEqualTo(SETTING_VALUE_ON);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onPreferenceChange_switchDisabled_disablesDesktopModeOnSecondaryDisplay() {
|
||||||
|
mController.onPreferenceChange(mPreference, /* newValue= */ false);
|
||||||
|
|
||||||
|
final int mode = Settings.Global.getInt(mContext.getContentResolver(),
|
||||||
|
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
|
||||||
|
/* def= */ SETTING_VALUE_INVALID);
|
||||||
|
assertThat(mode).isEqualTo(SETTING_VALUE_OFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onPreferenceChange_switchDisabled_disablesFreeformSupport() {
|
||||||
|
mController.onPreferenceChange(mPreference, /* newValue= */ false);
|
||||||
|
|
||||||
|
final int mode = Settings.Global.getInt(mContext.getContentResolver(),
|
||||||
|
DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, /* def= */ SETTING_VALUE_INVALID);
|
||||||
assertThat(mode).isEqualTo(SETTING_VALUE_OFF);
|
assertThat(mode).isEqualTo(SETTING_VALUE_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +167,8 @@ public class DesktopModeSecondaryDisplayPreferenceControllerTest {
|
|||||||
mController.onDeveloperOptionsSwitchDisabled();
|
mController.onDeveloperOptionsSwitchDisabled();
|
||||||
|
|
||||||
final int mode = Settings.Global.getInt(mContext.getContentResolver(),
|
final int mode = Settings.Global.getInt(mContext.getContentResolver(),
|
||||||
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS, -1 /* default */);
|
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
|
||||||
|
/* def= */ SETTING_VALUE_INVALID);
|
||||||
assertThat(mode).isEqualTo(SETTING_VALUE_OFF);
|
assertThat(mode).isEqualTo(SETTING_VALUE_OFF);
|
||||||
verify(mPreference).setEnabled(false);
|
verify(mPreference).setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user