Snap for 10412120 from e42dcd738d to udc-qpr1-release

Change-Id: Iab746509c6fe66de0a8b6a4bb972d9f7587e3559
This commit is contained in:
Android Build Coastguard Worker
2023-06-29 23:20:00 +00:00
6 changed files with 26 additions and 15 deletions

View File

@@ -1526,8 +1526,6 @@
<string name="bluetooth_companion_app_remove_association_dialog_title">Disconnect App?</string>
<!-- Bluetooth device details companion apps. The body of confirmation dialog for remove association. [CHAR LIMIT=60] -->
<string name="bluetooth_companion_app_body"><xliff:g id="app_name" example="App Name">%1$s</xliff:g> app will no longer connect to your <xliff:g id="device_name" example="Device Name">%2$s</xliff:g></string>
<!-- Summary of Bluetooth LE Audio toggle in Device Details. [CHAR LIMIT=40] -->
<string name="device_details_leaudio_toggle_summary">Experimental. Improves audio quality.</string>
<!-- Bluetooth device details. In the confirmation dialog for unpairing a paired device, this is the label on the button that will complete the unpairing action. -->
<string name="bluetooth_unpair_dialog_forget_confirm_button">Forget device</string>
@@ -6431,7 +6429,7 @@
<!-- Search keywords for the "Delete Guest Activity" section in Multiple Users Screen. [CHAR LIMIT=NONE] -->
<string name="remove_guest_on_exit_keywords">delete, guest, activity, remove, data, visitor, erase</string>
<!-- Title of preference to enable guest calling[CHAR LIMIT=40] -->
<string name="enable_guest_calling">Allow guest to use phone</string>
<string name="enable_guest_calling">Allow guest to make phone calls</string>
<!-- Summary of preference to enable guest calling [CHAR LIMIT=NONE] -->
<string name="enable_guest_calling_summary">Call history will be shared with guest user</string>

View File

@@ -116,10 +116,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
pref.setTitle(profile.getNameResource(mCachedDevice.getDevice()));
pref.setOnPreferenceClickListener(this);
pref.setOrder(profile.getOrdinal());
if (profile instanceof LeAudioProfile) {
pref.setSummary(R.string.device_details_leaudio_toggle_summary);
}
return pref;
}

View File

@@ -90,6 +90,12 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
}
// Show the skip button during SUW but not during Settings > Biometric Enrollment
mSkipOrClearButton.setOnClickListener(this::onSkipOrClearButtonClick);
final View headerView = view.findViewById(R.id.sud_layout_header);
final ViewGroup.MarginLayoutParams lp =
(ViewGroup.MarginLayoutParams) headerView.getLayoutParams();
lp.bottomMargin = 0;
view.setLayoutParams(lp);
return view;
}

View File

@@ -17,6 +17,7 @@
package com.android.settings.users;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.UserManager;
@@ -73,6 +74,7 @@ public class GuestTelephonyPreferenceController extends TogglePreferenceControll
public void updateState(Preference preference) {
super.updateState(preference);
mUserCaps.updateAddUserCapabilities(mContext);
preference.setVisible(isAvailable() && mUserCaps.mUserSwitcherEnabled);
preference.setVisible(isAvailable() && mUserCaps.mUserSwitcherEnabled && mContext
.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY));
}
}

View File

@@ -977,10 +977,10 @@ public class UserSettings extends SettingsPreferenceFragment
return;
}
try {
getContext().getSystemService(UserManager.class)
.removeUserWhenPossible(UserHandle.of(UserHandle.myUserId()),
/* overrideDevicePolicy= */ false);
ActivityManager.getService().switchUser(UserHandle.USER_SYSTEM);
mUserManager.removeUserWhenPossible(
UserHandle.of(UserHandle.myUserId()), /* overrideDevicePolicy= */ false);
ActivityManager.getService().switchUser(
mUserManager.getPreviousForegroundUser().getIdentifier());
} catch (RemoteException re) {
Log.e(TAG, "Unable to remove self user");
}
@@ -1099,7 +1099,7 @@ public class UserSettings extends SettingsPreferenceFragment
}
mMetricsFeatureProvider.action(getActivity(),
SettingsEnums.ACTION_USER_GUEST_EXIT_CONFIRMED);
switchToUserId(UserHandle.USER_SYSTEM);
switchToUserId(mUserManager.getPreviousForegroundUser().getIdentifier());
}
private int createGuest() {
@@ -1139,8 +1139,8 @@ public class UserSettings extends SettingsPreferenceFragment
// Create a new guest in the foreground, and then immediately switch to it
int newGuestUserId = createGuest();
if (newGuestUserId == UserHandle.USER_NULL) {
Log.e(TAG, "Could not create new guest, switching back to system user");
switchToUserId(UserHandle.USER_SYSTEM);
Log.e(TAG, "Could not create new guest, switching back to previous user");
switchToUserId(mUserManager.getPreviousForegroundUser().getIdentifier());
mUserManager.removeUser(oldGuestUserId);
WindowManagerGlobal.getWindowManagerService().lockNow(/* options= */ null);
return;

View File

@@ -28,6 +28,7 @@ import android.content.res.Resources;
import android.os.UserHandle;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
@@ -114,6 +115,14 @@ public class SetupChooseLockPatternTest {
assertThat(button.getVisibility()).isEqualTo(View.VISIBLE);
}
@Test
public void headerView_noBottomMargin() {
final View header = mActivity.findViewById(R.id.sud_layout_header);
final ViewGroup.MarginLayoutParams lp =
(ViewGroup.MarginLayoutParams) header.getLayoutParams();
assertThat(lp.bottomMargin).isEqualTo(0);
}
private void verifyScreenLockOptionsShown() {
final Button button = mActivity.findViewById(R.id.screen_lock_options);
assertThat(button).isNotNull();