Snap for 10449897 from bee02bbbe7
to udc-qpr1-release
Change-Id: I3bd95cca0c8258d8e0cee4cf96d25842db93b222
This commit is contained in:
@@ -3493,18 +3493,18 @@
|
||||
<!-- Checkbox label to set password as new screen lock if remote device credential validation succeeds. [CHAR LIMIT=43] -->
|
||||
<string name="lockpassword_remote_validation_set_password_as_screenlock">Also use password to unlock this device</string>
|
||||
|
||||
<!-- Header shown when pattern needs to be solved before the device exits repair mode. [CHAR LIMIT=100] [DO NOT TRANSLATE] TODO(b/275677027): update with finalized UX string -->
|
||||
<!-- Header shown when pattern needs to be solved before the device exits repair mode. [CHAR LIMIT=40] -->
|
||||
<string name="lockpassword_confirm_repair_mode_pattern_header">Verify pattern</string>
|
||||
<!-- Header shown when the pin needs to be solved before the device exits repair mode. [CHAR LIMIT=100] [DO NOT TRANSLATE] TODO(b/275677027): update with finalized UX string -->
|
||||
<!-- Header shown when the pin needs to be solved before the device exits repair mode. [CHAR LIMIT=40] -->
|
||||
<string name="lockpassword_confirm_repair_mode_pin_header">Verify PIN</string>
|
||||
<!-- Header shown when the password needs to be solved before the device exits repair mode. [CHAR LIMIT=100] [DO NOT TRANSLATE] TODO(b/275677027): update with finalized UX string -->
|
||||
<!-- Header shown when the password needs to be solved before the device exits repair mode. [CHAR LIMIT=40] -->
|
||||
<string name="lockpassword_confirm_repair_mode_password_header">Verify password</string>
|
||||
<!-- An explanation text that the pattern needs to be solved before the device exits repair mode. [CHAR LIMIT=100] [DO NOT TRANSLATE] TODO(b/275677027): update with finalized UX string -->
|
||||
<string name="lockpassword_confirm_repair_mode_pattern_details" translatable="false">Enter your device pattern enrolled in normal mode to continue</string>
|
||||
<!-- An explanation text that the PIN needs to be solved before the device exits repair mode. [CHAR LIMIT=100] [DO NOT TRANSLATE] TODO(b/275677027): update with finalized UX string -->
|
||||
<string name="lockpassword_confirm_repair_mode_pin_details" translatable="false">Enter your device PIN enrolled in normal mode to continue</string>
|
||||
<!-- An explanation text that the password needs to be solved before the device exits repair mode. [CHAR LIMIT=100] [DO NOT TRANSLATE] TODO(b/275677027): update with finalized UX string -->
|
||||
<string name="lockpassword_confirm_repair_mode_password_details" translatable="false">Enter your device password enrolled in normal mode to continue</string>
|
||||
<!-- An explanation text that the pattern needs to be solved before the device exits repair mode. [CHAR LIMIT=100] -->
|
||||
<string name="lockpassword_confirm_repair_mode_pattern_details">Use your device pattern to continue</string>
|
||||
<!-- An explanation text that the PIN needs to be solved before the device exits repair mode. [CHAR LIMIT=100] -->
|
||||
<string name="lockpassword_confirm_repair_mode_pin_details">Enter your device PIN to continue</string>
|
||||
<!-- An explanation text that the password needs to be solved before the device exits repair mode. [CHAR LIMIT=100] -->
|
||||
<string name="lockpassword_confirm_repair_mode_password_details">Enter your device password to continue</string>
|
||||
|
||||
<!-- Security & location settings screen, change security method screen instruction if user
|
||||
enters incorrect PIN [CHAR LIMIT=30] -->
|
||||
|
@@ -1101,9 +1101,9 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingSuperCall") // TODO: Fix me
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
maybeHideSfpsText(newConfig);
|
||||
switch(newConfig.orientation) {
|
||||
case Configuration.ORIENTATION_LANDSCAPE: {
|
||||
|
@@ -34,14 +34,11 @@ public class GuestTelephonyPreferenceController extends TogglePreferenceControll
|
||||
|
||||
private final UserManager mUserManager;
|
||||
private final UserCapabilities mUserCaps;
|
||||
private Bundle mDefaultGuestRestrictions;
|
||||
|
||||
public GuestTelephonyPreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mUserManager = context.getSystemService(UserManager.class);
|
||||
mUserCaps = UserCapabilities.create(context);
|
||||
mDefaultGuestRestrictions = mUserManager.getDefaultGuestRestrictions();
|
||||
mDefaultGuestRestrictions.putBoolean(UserManager.DISALLOW_SMS, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,13 +52,16 @@ public class GuestTelephonyPreferenceController extends TogglePreferenceControll
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return !mDefaultGuestRestrictions.getBoolean(UserManager.DISALLOW_OUTGOING_CALLS, false);
|
||||
return !mUserManager.getDefaultGuestRestrictions()
|
||||
.getBoolean(UserManager.DISALLOW_OUTGOING_CALLS, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setChecked(boolean isChecked) {
|
||||
mDefaultGuestRestrictions.putBoolean(UserManager.DISALLOW_OUTGOING_CALLS, !isChecked);
|
||||
mUserManager.setDefaultGuestRestrictions(mDefaultGuestRestrictions);
|
||||
Bundle guestRestrictions = mUserManager.getDefaultGuestRestrictions();
|
||||
guestRestrictions.putBoolean(UserManager.DISALLOW_SMS, true);
|
||||
guestRestrictions.putBoolean(UserManager.DISALLOW_OUTGOING_CALLS, !isChecked);
|
||||
mUserManager.setDefaultGuestRestrictions(guestRestrictions);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class GuestTelephonyPreferenceController extends TogglePreferenceControll
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
mUserCaps.updateAddUserCapabilities(mContext);
|
||||
preference.setVisible(isAvailable() && mUserCaps.mUserSwitcherEnabled && mContext
|
||||
.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY));
|
||||
preference.setVisible(isAvailable() && mUserCaps.mUserSwitcherEnabled
|
||||
&& mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY));
|
||||
}
|
||||
}
|
||||
|
@@ -637,29 +637,23 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
|
||||
}
|
||||
|
||||
private void refreshTxSpeed() {
|
||||
if (mWifiInfo == null
|
||||
|| mWifiEntry.getConnectedState() != WifiEntry.CONNECTED_STATE_CONNECTED) {
|
||||
String summary = mWifiEntry.getTxSpeedString();
|
||||
if (TextUtils.isEmpty(summary)) {
|
||||
mTxLinkSpeedPref.setVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
int txLinkSpeedMbps = mWifiInfo.getTxLinkSpeedMbps();
|
||||
mTxLinkSpeedPref.setVisible(txLinkSpeedMbps >= 0);
|
||||
mTxLinkSpeedPref.setSummary(mContext.getString(
|
||||
R.string.tx_link_speed, mWifiInfo.getTxLinkSpeedMbps()));
|
||||
mTxLinkSpeedPref.setVisible(true);
|
||||
mTxLinkSpeedPref.setSummary(summary);
|
||||
}
|
||||
|
||||
private void refreshRxSpeed() {
|
||||
if (mWifiInfo == null
|
||||
|| mWifiEntry.getConnectedState() != WifiEntry.CONNECTED_STATE_CONNECTED) {
|
||||
String summary = mWifiEntry.getRxSpeedString();
|
||||
if (TextUtils.isEmpty(summary)) {
|
||||
mRxLinkSpeedPref.setVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
int rxLinkSpeedMbps = mWifiInfo.getRxLinkSpeedMbps();
|
||||
mRxLinkSpeedPref.setVisible(rxLinkSpeedMbps >= 0);
|
||||
mRxLinkSpeedPref.setSummary(mContext.getString(
|
||||
R.string.rx_link_speed, mWifiInfo.getRxLinkSpeedMbps()));
|
||||
mRxLinkSpeedPref.setVisible(true);
|
||||
mRxLinkSpeedPref.setSummary(summary);
|
||||
}
|
||||
|
||||
private void refreshSsid() {
|
||||
|
@@ -18,12 +18,14 @@ package com.android.settings.users;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
import static org.mockito.Answers.RETURNS_DEEP_STUBS;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.UserManager;
|
||||
|
||||
@@ -103,6 +105,8 @@ public class GuestTelephonyPreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void updateState_Admin_shouldDisplayPreference() {
|
||||
assumeTrue("Device does not have telephony feature ",
|
||||
mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY));
|
||||
SystemProperties.set("fw.max_users", Long.toBinaryString(4));
|
||||
mDpm.setDeviceOwner(null);
|
||||
mUserManager.setIsAdminUser(true);
|
||||
|
@@ -701,10 +701,10 @@ public class WifiDetailPreferenceController2Test {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void linkSpeedPref_shouldNotShowIfNotSet() {
|
||||
public void linkSpeedPref_shouldNotShowIfSpeedStringIsEmpty() {
|
||||
setUpForConnectedNetwork();
|
||||
setUpSpyController();
|
||||
when(mMockWifiInfo.getTxLinkSpeedMbps()).thenReturn(WifiInfo.LINK_SPEED_UNKNOWN);
|
||||
when(mMockWifiEntry.getTxSpeedString()).thenReturn("");
|
||||
|
||||
displayAndResume();
|
||||
|
||||
@@ -712,42 +712,22 @@ public class WifiDetailPreferenceController2Test {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void linkSpeedPref_shouldVisibleForConnectedNetwork() {
|
||||
public void linkSpeedPref_shouldBeVisibleIfSpeedStringIsNotEmpty() {
|
||||
setUpForConnectedNetwork();
|
||||
setUpSpyController();
|
||||
String expectedLinkSpeed = mContext.getString(R.string.tx_link_speed, TX_LINK_SPEED);
|
||||
when(mMockWifiEntry.getTxSpeedString()).thenReturn("100 Mbps");
|
||||
|
||||
displayAndResume();
|
||||
|
||||
verify(mMockTxLinkSpeedPref).setVisible(true);
|
||||
verify(mMockTxLinkSpeedPref).setSummary(expectedLinkSpeed);
|
||||
verify(mMockTxLinkSpeedPref).setSummary("100 Mbps");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void linkSpeedPref_shouldInvisibleForDisconnectedNetwork() {
|
||||
setUpForDisconnectedNetwork();
|
||||
|
||||
displayAndResume();
|
||||
|
||||
verify(mMockTxLinkSpeedPref).setVisible(false);
|
||||
verify(mMockTxLinkSpeedPref, never()).setSummary(any(String.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void linkSpeedPref_shouldInvisibleForNotInRangeNetwork() {
|
||||
setUpForNotInRangeNetwork();
|
||||
|
||||
displayAndResume();
|
||||
|
||||
verify(mMockTxLinkSpeedPref).setVisible(false);
|
||||
verify(mMockTxLinkSpeedPref, never()).setSummary(any(String.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rxLinkSpeedPref_shouldNotShowIfNotSet() {
|
||||
public void rxLinkSpeedPref_shouldNotShowIfSpeedStringIsEmpty() {
|
||||
setUpForConnectedNetwork();
|
||||
setUpSpyController();
|
||||
when(mMockWifiInfo.getRxLinkSpeedMbps()).thenReturn(WifiInfo.LINK_SPEED_UNKNOWN);
|
||||
when(mMockWifiEntry.getRxSpeedString()).thenReturn("");
|
||||
|
||||
displayAndResume();
|
||||
|
||||
@@ -755,35 +735,15 @@ public class WifiDetailPreferenceController2Test {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rxLinkSpeedPref_shouldVisibleForConnectedNetwork() {
|
||||
public void rxLinkSpeedPref_shouldBeVisibleIfSpeedStringIsNotEmpty() {
|
||||
setUpForConnectedNetwork();
|
||||
setUpSpyController();
|
||||
String expectedLinkSpeed = mContext.getString(R.string.rx_link_speed, RX_LINK_SPEED);
|
||||
when(mMockWifiEntry.getRxSpeedString()).thenReturn("100 Mbps");
|
||||
|
||||
displayAndResume();
|
||||
|
||||
verify(mMockRxLinkSpeedPref).setVisible(true);
|
||||
verify(mMockRxLinkSpeedPref).setSummary(expectedLinkSpeed);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rxLinkSpeedPref_shouldInvisibleForDisconnectedNetwork() {
|
||||
setUpForDisconnectedNetwork();
|
||||
|
||||
displayAndResume();
|
||||
|
||||
verify(mMockRxLinkSpeedPref).setVisible(false);
|
||||
verify(mMockRxLinkSpeedPref, never()).setSummary(any(String.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rxLinkSpeedPref_shouldInvisibleForNotInRangeNetwork() {
|
||||
setUpForNotInRangeNetwork();
|
||||
|
||||
displayAndResume();
|
||||
|
||||
verify(mMockRxLinkSpeedPref).setVisible(false);
|
||||
verify(mMockRxLinkSpeedPref, never()).setSummary(any(String.class));
|
||||
verify(mMockRxLinkSpeedPref).setSummary("100 Mbps");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user