Merge "Settings for skip and silence gestures"
diff --git a/res/values/config.xml b/res/values/config.xml
index 1a504dd..a6e5e1c 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -172,9 +172,6 @@
<!-- ComponentName to launch a vendor-specific enrollment activity if available -->
<string name="config_face_enroll" translatable="false"></string>
- <!-- Max allowed value for screen timeout, in milliseconds -->
- <integer name="max_lock_after_timeout_ms">1800000</integer>
-
<!-- App intent -->
<string name="config_account_intent_uri" translatable="false"></string>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 358a1f1..5511559 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5841,6 +5841,9 @@
Used in SetupWizard for XLarge screen [CHAR LIMIT=20] -->
<string name="wifi_setup_detail">Network details</string>
+ <!-- Do not translate. This is a stub which will be removed soon. -->
+ <string name="time_zone_auto_stub" translatable="false">Select Time Zone</string>
+
<!-- Content description of the enabled sync icon for accessibility. [CHAR LIMIT=NONE] -->
<string name="accessibility_sync_enabled">Sync enabled</string>
<!-- Content description of the disabled sync icon for accessibility. [CHAR LIMIT=NONE] -->
diff --git a/res/xml/date_time_prefs.xml b/res/xml/date_time_prefs.xml
index e8af64c..edda1ba 100644
--- a/res/xml/date_time_prefs.xml
+++ b/res/xml/date_time_prefs.xml
@@ -58,7 +58,7 @@
<com.android.settingslib.RestrictedPreference
android:fragment="com.android.settings.datetime.timezone.TimeZoneSettings"
android:key="timezone"
- android:title="@string/date_time_set_timezone_title"
+ android:title="@string/date_time_set_timezone"
android:summary="@string/summary_placeholder"
settings:userRestriction="no_config_date_time" />
</PreferenceCategory>
diff --git a/res/xml/network_and_internet_v2.xml b/res/xml/network_and_internet_v2.xml
index bde7889..83499d7 100644
--- a/res/xml/network_and_internet_v2.xml
+++ b/res/xml/network_and_internet_v2.xml
@@ -78,12 +78,19 @@
settings:userRestriction="no_config_tethering"
settings:useAdminDisabledSummary="true" />
+ <com.android.settings.datausage.DataSaverPreference
+ android:key="restrict_background"
+ android:title="@string/data_saver_title"
+ android:icon="@drawable/ic_settings_data_usage"
+ android:order="10"
+ android:fragment="com.android.settings.datausage.DataSaverSummary"/>
+
<com.android.settingslib.RestrictedPreference
android:fragment="com.android.settings.vpn2.VpnSettings"
android:key="vpn_settings"
android:title="@string/vpn_settings_title"
android:icon="@drawable/ic_vpn_key"
- android:order="10"
+ android:order="15"
android:summary="@string/summary_placeholder"
settings:userRestriction="no_config_vpn"
settings:useAdminDisabledSummary="true" />
@@ -91,7 +98,7 @@
<com.android.settings.network.PrivateDnsModeDialogPreference
android:key="private_dns_settings"
android:title="@string/select_private_dns_configuration_title"
- android:order="15"
+ android:order="20"
android:dialogTitle="@string/select_private_dns_configuration_dialog_title"
android:dialogLayout="@layout/private_dns_mode_dialog"
android:positiveButtonText="@string/save"
diff --git a/src/com/android/settings/ResetNetwork.java b/src/com/android/settings/ResetNetwork.java
index c1eca16..9ad8a98 100644
--- a/src/com/android/settings/ResetNetwork.java
+++ b/src/com/android/settings/ResetNetwork.java
@@ -161,7 +161,8 @@
mEsimContainer = mContentView.findViewById(R.id.erase_esim_container);
mEsimCheckbox = mContentView.findViewById(R.id.erase_esim);
- mSubscriptions = SubscriptionManager.from(getActivity()).getActiveSubscriptionInfoList();
+ mSubscriptions = SubscriptionManager.from(getActivity())
+ .getActiveSubscriptionInfoList(true);
if (mSubscriptions != null && mSubscriptions.size() > 0) {
// Get the default subscription in the order of data, voice, sms, first up.
int defaultSubscription = SubscriptionManager.getDefaultDataSubscriptionId();
diff --git a/src/com/android/settings/datausage/CellDataPreference.java b/src/com/android/settings/datausage/CellDataPreference.java
index 48e4089..9c6be46 100644
--- a/src/com/android/settings/datausage/CellDataPreference.java
+++ b/src/com/android/settings/datausage/CellDataPreference.java
@@ -232,7 +232,8 @@
}
private void disableDataForOtherSubscriptions(int subId) {
- List<SubscriptionInfo> subInfoList = mSubscriptionManager.getActiveSubscriptionInfoList();
+ List<SubscriptionInfo> subInfoList = mSubscriptionManager
+ .getActiveSubscriptionInfoList(true);
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
if (subInfo.getSubscriptionId() != subId) {
diff --git a/src/com/android/settings/datausage/DataUsageUtils.java b/src/com/android/settings/datausage/DataUsageUtils.java
index b3d0e61..283c84f 100644
--- a/src/com/android/settings/datausage/DataUsageUtils.java
+++ b/src/com/android/settings/datausage/DataUsageUtils.java
@@ -106,7 +106,7 @@
return SystemProperties.get(DataUsageUtils.TEST_RADIOS_PROP).contains("mobile");
}
final List<SubscriptionInfo> subInfoList =
- SubscriptionManager.from(context).getActiveSubscriptionInfoList();
+ SubscriptionManager.from(context).getActiveSubscriptionInfoList(true);
// No activated Subscriptions
if (subInfoList == null) {
if (LOGD) {
diff --git a/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java b/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
index 462f6d9..598dfb1 100644
--- a/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
@@ -111,7 +111,7 @@
private CharSequence getFirstPhoneNumber() {
final List<SubscriptionInfo> subscriptionInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subscriptionInfoList == null) {
return mContext.getText(R.string.device_info_default);
}
@@ -138,7 +138,7 @@
@VisibleForTesting
SubscriptionInfo getSubscriptionInfo(int simSlot) {
final List<SubscriptionInfo> subscriptionInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subscriptionInfoList != null) {
for (SubscriptionInfo info : subscriptionInfoList) {
if (info.getSimSlotIndex() == simSlot) {
diff --git a/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogController.java b/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogController.java
index 3584849..33d7a8a 100644
--- a/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogController.java
+++ b/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogController.java
@@ -127,7 +127,7 @@
private SubscriptionInfo getSubscriptionInfo(Context context, int slotId) {
final List<SubscriptionInfo> subscriptionInfoList = SubscriptionManager.from(context)
- .getActiveSubscriptionInfoList();
+ .getActiveSubscriptionInfoList(true);
if (subscriptionInfoList == null || subscriptionInfoList.isEmpty()) {
return null;
}
diff --git a/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java b/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java
index 25d1866..e7e9fa4 100644
--- a/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java
+++ b/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java
@@ -404,7 +404,7 @@
private SubscriptionInfo getPhoneSubscriptionInfo(int slotId) {
final List<SubscriptionInfo> subscriptionInfoList = SubscriptionManager.from(
- mContext).getActiveSubscriptionInfoList();
+ mContext).getActiveSubscriptionInfoList(true);
if (subscriptionInfoList != null && subscriptionInfoList.size() > slotId) {
return subscriptionInfoList.get(slotId);
} else {
diff --git a/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceController.java b/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceController.java
index 02c1916..ed01e22 100644
--- a/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceController.java
@@ -107,7 +107,7 @@
private CharSequence getCarrierName(int simSlot) {
final List<SubscriptionInfo> subscriptionInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subscriptionInfoList != null) {
for (SubscriptionInfo info : subscriptionInfoList) {
if (info.getSimSlotIndex() == simSlot) {
diff --git a/src/com/android/settings/display/TimeoutListPreference.java b/src/com/android/settings/display/TimeoutListPreference.java
index 5ed427f..f9a731d 100644
--- a/src/com/android/settings/display/TimeoutListPreference.java
+++ b/src/com/android/settings/display/TimeoutListPreference.java
@@ -26,7 +26,6 @@
import android.util.Log;
import android.view.View;
-import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog.Builder;
import com.android.settings.R;
@@ -34,18 +33,18 @@
import com.android.settingslib.RestrictedLockUtils;
import java.util.ArrayList;
-import java.util.List;
public class TimeoutListPreference extends RestrictedListPreference {
private static final String TAG = "TimeoutListPreference";
private EnforcedAdmin mAdmin;
- private CharSequence[] mInitialEntries;
- private CharSequence[] mInitialValues;
+ private final CharSequence[] mInitialEntries;
+ private final CharSequence[] mInitialValues;
public TimeoutListPreference(Context context, AttributeSet attrs) {
super(context, attrs);
- updateInitialValues();
+ mInitialEntries = getEntries();
+ mInitialValues = getEntryValues();
}
@Override
@@ -66,8 +65,13 @@
if (mAdmin != null) {
View footerView = dialog.findViewById(R.id.admin_disabled_other_options);
footerView.findViewById(R.id.admin_more_details_link).setOnClickListener(
- view -> RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
- getContext(), mAdmin));
+ new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
+ getContext(), mAdmin);
+ }
+ });
}
}
@@ -85,8 +89,8 @@
maxTimeout = Long.MAX_VALUE;
}
- final ArrayList<CharSequence> revisedEntries = new ArrayList<>();
- final ArrayList<CharSequence> revisedValues = new ArrayList<>();
+ ArrayList<CharSequence> revisedEntries = new ArrayList<CharSequence>();
+ ArrayList<CharSequence> revisedValues = new ArrayList<CharSequence>();
for (int i = 0; i < mInitialValues.length; ++i) {
long timeout = Long.parseLong(mInitialValues[i].toString());
if (timeout <= maxTimeout) {
@@ -97,7 +101,7 @@
// If there are no possible options for the user, then set this preference as disabled
// by admin, otherwise remove the padlock in case it was set earlier.
- if (revisedValues.isEmpty()) {
+ if (revisedValues.size() == 0) {
setDisabledByAdmin(admin);
return;
} else {
@@ -113,7 +117,7 @@
setValue(String.valueOf(userPreference));
} else if (revisedValues.size() > 0
&& Long.parseLong(revisedValues.get(revisedValues.size() - 1).toString())
- == maxTimeout) {
+ == maxTimeout) {
// If the last one happens to be the same as the max timeout, select that
setValue(String.valueOf(maxTimeout));
} else {
@@ -124,36 +128,4 @@
}
}
}
-
- @VisibleForTesting
- void updateInitialValues() {
- // Read default list of candidate values.
- final CharSequence[] entries = getEntries();
- final CharSequence[] values = getEntryValues();
- // Filter out values based on config
- final List<CharSequence> revisedEntries = new ArrayList<>();
- final List<CharSequence> revisedValues = new ArrayList<>();
- final long maxTimeout = getContext().getResources().getInteger(
- R.integer.max_lock_after_timeout_ms);
- if (entries == null || values == null) {
- return;
- }
- Log.d(TAG, "max timeout: " + maxTimeout);
- for (int i = 0; i < values.length; ++i) {
- long timeout = Long.parseLong(values[i].toString());
- if (timeout <= maxTimeout) {
- Log.d(TAG, "keeping timeout: " + values[i]);
- revisedEntries.add(entries[i]);
- revisedValues.add(values[i]);
- } else {
- Log.d(TAG, "Dropping timeout: " + values[i]);
- }
- }
-
- // Store final candidates in initial value lists.
- mInitialEntries = revisedEntries.toArray(new CharSequence[0]);
- setEntries(mInitialEntries);
- mInitialValues = revisedValues.toArray(new CharSequence[0]);
- setEntryValues(mInitialValues);
- }
}
diff --git a/src/com/android/settings/display/TimeoutPreferenceController.java b/src/com/android/settings/display/TimeoutPreferenceController.java
index c1c5069..60b7e24 100644
--- a/src/com/android/settings/display/TimeoutPreferenceController.java
+++ b/src/com/android/settings/display/TimeoutPreferenceController.java
@@ -13,6 +13,8 @@
*/
package com.android.settings.display;
+import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
+
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.os.UserHandle;
@@ -58,7 +60,7 @@
public void updateState(Preference preference) {
final TimeoutListPreference timeoutListPreference = (TimeoutListPreference) preference;
final long currentTimeout = Settings.System.getLong(mContext.getContentResolver(),
- Settings.System.SCREEN_OFF_TIMEOUT, FALLBACK_SCREEN_TIMEOUT_VALUE);
+ SCREEN_OFF_TIMEOUT, FALLBACK_SCREEN_TIMEOUT_VALUE);
timeoutListPreference.setValue(String.valueOf(currentTimeout));
final DevicePolicyManager dpm =
(DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
@@ -84,8 +86,7 @@
public boolean onPreferenceChange(Preference preference, Object newValue) {
try {
int value = Integer.parseInt((String) newValue);
- Settings.System.putInt(mContext.getContentResolver(),
- Settings.System.SCREEN_OFF_TIMEOUT, value);
+ Settings.System.putInt(mContext.getContentResolver(), SCREEN_OFF_TIMEOUT, value);
updateTimeoutPreferenceDescription((TimeoutListPreference) preference, value);
} catch (NumberFormatException e) {
Log.e(TAG, "could not persist screen timeout setting", e);
@@ -93,7 +94,7 @@
return true;
}
- private static CharSequence getTimeoutDescription(
+ public static CharSequence getTimeoutDescription(
long currentTimeout, CharSequence[] entries, CharSequence[] values) {
if (currentTimeout < 0 || entries == null || values == null
|| values.length != entries.length) {
diff --git a/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java b/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
index 1f75ab1..a2f71ec 100644
--- a/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
@@ -113,7 +113,7 @@
@VisibleForTesting
SubscriptionInfo getFirstSubscriptionInfo() {
final List<SubscriptionInfo> subscriptionInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subscriptionInfoList == null || subscriptionInfoList.isEmpty()) {
return null;
}
diff --git a/src/com/android/settings/network/telephony/MobileNetworkActivity.java b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
index 93ba918..a5f011c 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkActivity.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
@@ -69,7 +69,7 @@
@Override
public void onSubscriptionsChanged() {
if (!Objects.equals(mSubscriptionInfos,
- mSubscriptionManager.getActiveSubscriptionInfoList())) {
+ mSubscriptionManager.getActiveSubscriptionInfoList(true))) {
updateSubscriptions(null);
}
}
@@ -87,7 +87,7 @@
setActionBar(findViewById(R.id.mobile_action_bar));
mPhoneChangeReceiver = new PhoneChangeReceiver();
mSubscriptionManager = getSystemService(SubscriptionManager.class);
- mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList(true);
mCurSubscriptionId = savedInstanceState != null
? savedInstanceState.getInt(Settings.EXTRA_SUB_ID, SUB_ID_NULL)
: SUB_ID_NULL;
@@ -136,7 +136,7 @@
@VisibleForTesting
void updateSubscriptions(Bundle savedInstanceState) {
- mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (!FeatureFlagPersistent.isEnabled(this, FeatureFlags.NETWORK_INTERNET_V2)) {
updateBottomNavigationView();
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index 27cc367..3b9c8c0 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -227,7 +227,7 @@
if (disableOtherSubscriptions) {
List<SubscriptionInfo> subInfoList =
- subscriptionManager.getActiveSubscriptionInfoList();
+ subscriptionManager.getActiveSubscriptionInfoList(true);
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
// We never disable mobile data for opportunistic subscriptions.
diff --git a/src/com/android/settings/security/SimLockPreferenceController.java b/src/com/android/settings/security/SimLockPreferenceController.java
index d8d6252..d4def6b 100644
--- a/src/com/android/settings/security/SimLockPreferenceController.java
+++ b/src/com/android/settings/security/SimLockPreferenceController.java
@@ -77,7 +77,7 @@
*/
private boolean isSimReady() {
final List<SubscriptionInfo> subInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
final int simState = mTelephonyManager.getSimState(subInfo.getSimSlotIndex());
@@ -95,7 +95,7 @@
*/
private boolean isSimIccReady() {
final List<SubscriptionInfo> subInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
diff --git a/src/com/android/settings/sim/SimDialogActivity.java b/src/com/android/settings/sim/SimDialogActivity.java
index 8a99e66..987826c 100644
--- a/src/com/android/settings/sim/SimDialogActivity.java
+++ b/src/com/android/settings/sim/SimDialogActivity.java
@@ -153,7 +153,7 @@
final ArrayList<String> list = new ArrayList<String>();
final SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
final List<SubscriptionInfo> subInfoList =
- subscriptionManager.getActiveSubscriptionInfoList();
+ subscriptionManager.getActiveSubscriptionInfoList(true);
final int selectableSubInfoLength = subInfoList == null ? 0 : subInfoList.size();
final DialogInterface.OnClickListener selectionListener =
diff --git a/src/com/android/settings/sim/SimSelectNotification.java b/src/com/android/settings/sim/SimSelectNotification.java
index 6806f9f..cf67f5e 100644
--- a/src/com/android/settings/sim/SimSelectNotification.java
+++ b/src/com/android/settings/sim/SimSelectNotification.java
@@ -80,7 +80,7 @@
}
}
- List<SubscriptionInfo> sil = subscriptionManager.getActiveSubscriptionInfoList();
+ List<SubscriptionInfo> sil = subscriptionManager.getActiveSubscriptionInfoList(true);
if (sil == null || sil.size() < 1) {
Log.d(TAG, "Subscription list is empty");
return;
diff --git a/src/com/android/settings/sim/SimSettings.java b/src/com/android/settings/sim/SimSettings.java
index cf6d5f3..24e1874 100644
--- a/src/com/android/settings/sim/SimSettings.java
+++ b/src/com/android/settings/sim/SimSettings.java
@@ -114,7 +114,7 @@
};
private void updateSubscriptions() {
- mSubInfoList = mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubInfoList = mSubscriptionManager.getActiveSubscriptionInfoList(true);
for (int i = 0; i < mNumSlots; ++i) {
Preference pref = mSimCards.findPreference("sim" + i);
if (pref instanceof SimPreference) {
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
index ad483b5..b0d09e4 100644
--- a/src/com/android/settings/wifi/WifiConfigController.java
+++ b/src/com/android/settings/wifi/WifiConfigController.java
@@ -251,6 +251,8 @@
com.android.settings.core.FeatureFlags.WIFI_MAC_RANDOMIZATION)) {
View privacySettingsLayout = mView.findViewById(R.id.privacy_settings_fields);
privacySettingsLayout.setVisibility(View.VISIBLE);
+ // Set default value
+ mPrivacySettingsSpinner.setSelection(WifiConfiguration.RANDOMIZATION_PERSISTENT);
}
mHiddenSettingsSpinner.setOnItemSelectedListener(this);
mHiddenWarningView = mView.findViewById(R.id.hidden_settings_warning);
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index eddae06..973697f 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -563,7 +563,10 @@
* networks, or Passpoint provided networks.
*/
WifiConfiguration config = mSelectedAccessPoint.getConfig();
- if ((mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
+ if (mSelectedAccessPoint.isOsuProvider()) {
+ mSelectedAccessPoint.startOsuProvisioning();
+ mClickedConnect = true;
+ } else if ((mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
(mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_OWE)) {
mSelectedAccessPoint.generateOpenNetworkConfig();
connect(mSelectedAccessPoint.getConfig(), mSelectedAccessPoint.isSaved());
diff --git a/src/com/android/settings/wifi/calling/WifiCallingSettings.java b/src/com/android/settings/wifi/calling/WifiCallingSettings.java
index ac84783..ecb96a5 100644
--- a/src/com/android/settings/wifi/calling/WifiCallingSettings.java
+++ b/src/com/android/settings/wifi/calling/WifiCallingSettings.java
@@ -147,7 +147,7 @@
}
private void updateSubList() {
- mSil = SubscriptionManager.from(getActivity()).getActiveSubscriptionInfoList();
+ mSil = SubscriptionManager.from(getActivity()).getActiveSubscriptionInfoList(true);
// Only config Wfc if it's enabled by platform.
if (mSil == null) {
diff --git a/src/com/android/settings/wifi/details/WifiPrivacyPreferenceController.java b/src/com/android/settings/wifi/details/WifiPrivacyPreferenceController.java
index 9f81431..18be542 100644
--- a/src/com/android/settings/wifi/details/WifiPrivacyPreferenceController.java
+++ b/src/com/android/settings/wifi/details/WifiPrivacyPreferenceController.java
@@ -69,6 +69,9 @@
if (mWifiConfiguration != null) {
mWifiConfiguration.macRandomizationSetting = Integer.parseInt((String) newValue);
mWifiManager.updateNetwork(mWifiConfiguration);
+ // To activate changing, we need reconnect network. WiFi will auto connect to current
+ // network after disconnect().
+ mWifiManager.disconnect();
}
updateSummary((DropDownPreference) preference, Integer.parseInt((String) newValue));
return true;
diff --git a/tests/robotests/res/values-mcc999/config.xml b/tests/robotests/res/values-mcc999/config.xml
index 59028d3..101a6b8 100644
--- a/tests/robotests/res/values-mcc999/config.xml
+++ b/tests/robotests/res/values-mcc999/config.xml
@@ -88,7 +88,4 @@
<!-- Email address for the homepage contextual cards feedback -->
<string name="config_contextual_card_feedback_email" translatable="false">test@test.test</string>
-
- <!-- Max allowed value for screen timeout, in milliseconds -->
- <integer name="max_lock_after_timeout_ms">1700000</integer>
</resources>
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
index d090097..023135d 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
@@ -21,6 +21,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
@@ -140,7 +141,7 @@
@Test
public void getSummary_cannotGetActiveSubscriptionInfo_shouldShowUnknown() {
- when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(null);
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true))).thenReturn(null);
CharSequence primaryNumber = mController.getSummary();
@@ -157,7 +158,7 @@
public void copy_shouldCopyPhoneNumberToClipboard() {
final List<SubscriptionInfo> list = new ArrayList<>();
list.add(mSubscriptionInfo);
- when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(list);
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true))).thenReturn(list);
final String phoneNumber = "1111111111";
doReturn(phoneNumber).when(mController).getFormattedPhoneNumber(mSubscriptionInfo);
diff --git a/tests/robotests/src/com/android/settings/display/TimeoutListPreferenceTest.java b/tests/robotests/src/com/android/settings/display/TimeoutListPreferenceTest.java
index 7b67f0f..55fcdac 100644
--- a/tests/robotests/src/com/android/settings/display/TimeoutListPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/display/TimeoutListPreferenceTest.java
@@ -17,11 +17,11 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.mock;
import static org.robolectric.RuntimeEnvironment.application;
import android.util.AttributeSet;
-import com.android.settings.R;
import com.android.settings.testutils.shadow.ShadowUserManager;
import com.android.settingslib.RestrictedLockUtils;
@@ -69,23 +69,4 @@
// should set to largest allowed value, which is 5 minute
assertThat(mPreference.getValue()).isEqualTo("300000");
}
-
- @Test
- @Config(qualifiers = "mcc999")
- public void newInstance_hasLowTimeoutConfig_shouldRemoveLongTimeouts() {
- final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
- final TimeoutListPreference pref = new TimeoutListPreference(application, attributeSet);
- final long maxTimeout = application.getResources().getInteger(
- R.integer.max_lock_after_timeout_ms);
- pref.setEntries(R.array.screen_timeout_entries);
- pref.setEntryValues(R.array.screen_timeout_values);
-
- pref.updateInitialValues();
-
- final CharSequence[] values = pref.getEntryValues();
- for (CharSequence value : values) {
- long timeout = Long.parseLong(value.toString());
- assertThat(timeout).isAtMost(maxTimeout);
- }
- }
}
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
index 29472f5..447931e 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
@@ -20,6 +20,7 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
@@ -108,7 +109,8 @@
@Test
public void updateBottomNavigationView_oneSubscription_shouldBeGone() {
mSubscriptionInfos.add(mSubscriptionInfo);
- doReturn(mSubscriptionInfos).when(mSubscriptionManager).getActiveSubscriptionInfoList();
+ doReturn(mSubscriptionInfos).when(mSubscriptionManager).getActiveSubscriptionInfoList(
+ eq(true));
mMobileNetworkActivity.updateBottomNavigationView();
@@ -120,7 +122,8 @@
final Menu menu = new ContextMenuBuilder(mContext);
mSubscriptionInfos.add(mSubscriptionInfo);
mSubscriptionInfos.add(mSubscriptionInfo);
- doReturn(mSubscriptionInfos).when(mSubscriptionManager).getActiveSubscriptionInfoList();
+ doReturn(mSubscriptionInfos).when(mSubscriptionManager).getActiveSubscriptionInfoList(
+ eq(true));
doReturn(menu).when(mBottomNavigationView).getMenu();
mMobileNetworkActivity.updateBottomNavigationView();
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
index 7ba1eb9..34e680e 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
@@ -20,6 +20,7 @@
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
@@ -104,7 +105,7 @@
when(mSubscriptionInfo1.getSubscriptionId()).thenReturn(SUB_ID_1);
when(mSubscriptionInfo2.getSubscriptionId()).thenReturn(SUB_ID_2);
- when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true))).thenReturn(
Arrays.asList(mSubscriptionInfo1, mSubscriptionInfo2));
}
diff --git a/tests/robotests/src/com/android/settings/security/SimLockPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/SimLockPreferenceControllerTest.java
index 07d8ac5..0ae33a0 100644
--- a/tests/robotests/src/com/android/settings/security/SimLockPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/SimLockPreferenceControllerTest.java
@@ -21,6 +21,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -141,7 +142,7 @@
SubscriptionInfo info = mock(SubscriptionInfo.class);
subscriptionInfoList.add(info);
when(mTelephonyManager.hasIccCard(anyInt())).thenReturn(true);
- when(mSubscriptionManager.getActiveSubscriptionInfoList())
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true)))
.thenReturn(subscriptionInfoList);
}
@@ -150,7 +151,7 @@
SubscriptionInfo info = mock(SubscriptionInfo.class);
subscriptionInfoList.add(info);
when(mTelephonyManager.getSimState(anyInt())).thenReturn(SIM_STATE_READY);
- when(mSubscriptionManager.getActiveSubscriptionInfoList())
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true)))
.thenReturn(subscriptionInfoList);
}
}