Snap for 12153359 from 691c0c3f6a to 24Q4-release

Change-Id: I44ea5f99f362fbc3fb75ed078ddbd52b4fc67b1d
This commit is contained in:
Android Build Coastguard Worker
2024-07-29 23:21:20 +00:00
16 changed files with 101 additions and 46 deletions

View File

@@ -31,3 +31,13 @@ flag {
description: "Gates whether to enable bluetooth device details polish"
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
}
}

View File

@@ -12238,11 +12238,11 @@
<!-- Default title for the settings panel [CHAR LIMIT=NONE] -->
<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] -->
<string name="enable_desktop_mode">Enable freeform windowing experiences</string>
<!-- 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 windows</string>
<!-- Title for a toggle that enables desktop mode on secondary display. [CHAR LIMIT=50] -->
<string name="enable_desktop_mode_on_secondary_display">Enable desktop mode on secondary display</string>
<!-- 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 freeform windows on secondary display</string>
<!-- 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>
@@ -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] -->
<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>
<!-- 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] -->
<string name="reboot_dialog_override_desktop_mode">A reboot is required to update availability of freeform windowing experiences.</string>
<!-- Dialog body text used to explain a reboot is required after enabling desktop mode on secondary displays. [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>
<!-- 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 windows.</string>
<!-- 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 freeform windows on secondary displays.</string>
<!-- Text on the dialog button to reboot the device now [CHAR LIMIT=50] -->
<string name="reboot_dialog_reboot_now">Reboot now</string>
<!-- Text on the dialog button to reboot the device later [CHAR LIMIT=50] -->

View File

@@ -188,7 +188,7 @@ public class MainClear extends InstrumentedFragment implements OnGlobalLayoutLis
false /* biometricsAuthenticationRequested */,
userId)) {
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRICS_REQUEST,
userId);
userId, false /* hideBackground */);
return;
}
}

View File

@@ -25,6 +25,7 @@ import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
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_HIDE_BACKGROUND;
import static com.android.settings.password.ConfirmDeviceCredentialActivity.BIOMETRIC_PROMPT_NEGATIVE_BUTTON_TEXT;
import android.app.ActionBar;
@@ -1519,12 +1520,13 @@ public final class Utils extends com.android.settingslib.Utils {
* to check if all requirements for mandatory biometrics is satisfied
* before launching biometric prompt.
*
* @param fragment corresponding fragment of the surface
* @param requestCode for starting the new activity
* @param userId user id for the authentication request
* @param fragment corresponding fragment of the surface
* @param requestCode for starting the new activity
* @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,
int requestCode, int userId) {
int requestCode, int userId, boolean hideBackground) {
final Intent intent = new Intent();
intent.putExtra(BIOMETRIC_PROMPT_AUTHENTICATORS,
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));
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_ALLOW_ANY_USER, true);
intent.putExtra(EXTRA_USER_ID, userId);
intent.putExtra(BIOMETRIC_PROMPT_HIDE_BACKGROUND, hideBackground);
intent.setClassName(SETTINGS_PACKAGE_NAME,
ConfirmDeviceCredentialActivity.InternalActivity.class.getName());
fragment.startActivityForResult(intent, requestCode);

View File

@@ -147,7 +147,7 @@ public abstract class BiometricsSettingsBase extends DashboardFragment {
mBiometricsAuthenticationRequested, mUserId)) {
mBiometricsAuthenticationRequested = true;
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
mUserId);
mUserId, true /* hideBackground */);
}
updateUnlockPhonePreferenceSummary();
@@ -166,7 +166,7 @@ public abstract class BiometricsSettingsBase extends DashboardFragment {
&& mGkPwHandle != 0L) {
mBiometricsAuthenticationRequested = true;
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
mUserId);
mUserId, true /* hideBackground */);
}
if (!mConfirmCredential) {
mDoNotFinishActivity = false;

View File

@@ -293,7 +293,7 @@ public class FaceSettings extends DashboardFragment {
mUserId)) {
mBiometricsAuthenticationRequested = true;
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
mUserId);
mUserId, true /* hideBackground */);
} else {
mAttentionController.setToken(mToken);
mEnrollController.setToken(mToken);

View File

@@ -489,7 +489,7 @@ public class FingerprintSettings extends SubSettings {
mUserId)) {
mBiometricsAuthenticationRequested = true;
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
mUserId);
mUserId, true /* hideBackground */);
} else if (!mHasFirstEnrolled) {
mIsEnrolling = true;
addFirstFingerprint(null);
@@ -784,7 +784,7 @@ public class FingerprintSettings extends SubSettings {
mUserId)) {
mBiometricsAuthenticationRequested = true;
Utils.launchBiometricPromptForMandatoryBiometrics(this,
BIOMETRIC_AUTH_REQUEST, mUserId);
BIOMETRIC_AUTH_REQUEST, mUserId, true /* hideBackground */);
}
}

View File

@@ -41,6 +41,7 @@ import androidx.appcompat.app.AlertDialog;
import com.android.settings.R;
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
@@ -87,12 +88,15 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
@Override
public void onDestroy() {
super.onDestroy();
if (mPairingController.getDialogType()
!= BluetoothPairingController.DISPLAY_PASSKEY_DIALOG) {
/* Cancel pairing unless explicitly accepted by user */
if (!mPositiveClicked) {
mPairingController.onCancel();
}
/* Cancel pairing unless 1) explicitly accepted by user 2) the event is triggered by
* orientation change. */
boolean shouldCancelPairing =
Flags.disableBondingCancellationForOrientationChange()
? !mPositiveClicked && !getActivity().isChangingConfigurations()
: !mPositiveClicked;
if (mPairingController.getDialogType() != BluetoothPairingController.DISPLAY_PASSKEY_DIALOG
&& shouldCancelPairing) {
mPairingController.onCancel();
}
}

View File

@@ -19,6 +19,7 @@ import android.app.settings.SettingsEnums
import android.content.Context
import android.os.Bundle
import android.telephony.SubscriptionManager
import android.view.View
import com.android.settings.R
import com.android.settings.SettingsActivity
import com.android.settings.dashboard.DashboardFragment
@@ -45,8 +46,8 @@ class DataSaverSummary : DashboardFragment() {
dataSaverBackend = DataSaverBackend(requireContext())
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
switchBar = (activity as SettingsActivity).switchBar.apply {
setTitle(getString(R.string.data_saver_switch_title))
show()

View File

@@ -67,6 +67,12 @@ public class DesktopModeSecondaryDisplayPreferenceController extends
Settings.Global.putInt(mContext.getContentResolver(),
DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
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) {
RebootConfirmationDialogFragment.show(
mFragment, R.string.reboot_dialog_enable_desktop_mode_on_secondary_display,

View File

@@ -78,7 +78,6 @@ public class Enable16kUtils {
try (BufferedReader br = new BufferedReader(new FileReader("/proc/mounts"))) {
String line;
while ((line = br.readLine()) != null) {
Log.i(TAG, line);
final String[] fields = line.split(" ");
final String partition = fields[1];
final String fsType = fields[2];

View File

@@ -38,7 +38,8 @@ import java.util.Map;
* 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.
*/
class ZenModesListPreferenceController extends BasePreferenceController {
class ZenModesListPreferenceController extends BasePreferenceController
implements BasePreferenceController.UiBlocker {
protected static final String KEY = "zen_modes_list";
protected ZenModesBackend mBackend;
@@ -48,11 +49,6 @@ class ZenModesListPreferenceController extends BasePreferenceController {
mBackend = backend;
}
@Override
public String getPreferenceKey() {
return KEY;
}
@Override
@AvailabilityStatus
public int getAvailabilityStatus() {
@@ -97,6 +93,8 @@ class ZenModesListPreferenceController extends BasePreferenceController {
for (String key : originalPreferences.keySet()) {
category.removePreferenceRecursively(key);
}
setUiBlockerFinished(true);
}
// Provide search data for the modes, which will allow users to reach the modes page if they

View File

@@ -495,7 +495,7 @@ public class ChooseLockGeneric extends SettingsActivity {
mBiometricsAuthSuccessful, mWaitingForConfirmation, mUserId)) {
mWaitingForConfirmation = true;
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
mUserId);
mUserId, true /* hideBackground */);
}
} else if (requestCode == BIOMETRIC_AUTH_REQUEST) {
if (resultCode == Activity.RESULT_OK) {

View File

@@ -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_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 {
}
@@ -165,15 +167,20 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow().setStatusBarColor(Color.TRANSPARENT);
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().setStatusBarColor(Color.TRANSPARENT);
}
mDevicePolicyManager = getSystemService(DevicePolicyManager.class);
mUserManager = UserManager.get(this);
mTrustManager = getSystemService(TrustManager.class);
mLockPatternUtils = new LockPatternUtils(this);
Intent intent = getIntent();
mContext = this;
mCheckDevicePolicyManager = intent
.getBooleanExtra(KeyguardManager.EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS, false);

View File

@@ -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.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.google.common.truth.Truth.assertThat;
@@ -581,7 +582,8 @@ public class UtilsTest {
final int requestCode = 1;
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));
@@ -593,6 +595,8 @@ public class UtilsTest {
assertThat(intent.getExtra(KeyguardManager.EXTRA_DESCRIPTION)).isNotNull();
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_ALLOW_ANY_USER, false))
.isTrue();
assertThat(intent.getBooleanExtra(BIOMETRIC_PROMPT_HIDE_BACKGROUND, true))
.isFalse();
assertThat(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).isEqualTo(USER_ID);
assertThat(intent.getComponent().getPackageName()).isEqualTo(SETTINGS_PACKAGE_NAME);
assertThat(intent.getComponent().getClassName()).isEqualTo(

View File

@@ -16,6 +16,7 @@
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 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 USER_BUILD_TYPE = "user";
private static final int SETTING_VALUE_INVALID = -1;
@Mock
private SwitchPreference mPreference;
@@ -102,21 +104,41 @@ public class DesktopModeSecondaryDisplayPreferenceControllerTest {
@Test
public void onPreferenceChange_switchEnabled_enablesDesktopModeOnSecondaryDisplay() {
mController.onPreferenceChange(mPreference, true /* new value */);
mController.onPreferenceChange(mPreference, /* newValue= */ true);
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);
verify(mTransaction).add(any(RebootConfirmationDialogFragment.class), any());
}
@Test
public void onPreferenceChange_switchDisabled_disablesDesktopModeOnSecondaryDisplay() {
mController.onPreferenceChange(mPreference, false /* new value */);
public void onPreferenceChange_switchEnabled_enablesFreeformSupport() {
mController.onPreferenceChange(mPreference, /* newValue= */ true);
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);
}
@@ -145,7 +167,8 @@ public class DesktopModeSecondaryDisplayPreferenceControllerTest {
mController.onDeveloperOptionsSwitchDisabled();
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);
verify(mPreference).setEnabled(false);
}