From 424319371c49a20067afdbd62fd3948f058bf473 Mon Sep 17 00:00:00 2001 From: Kevin Han Date: Tue, 9 Nov 2021 16:47:35 -0800 Subject: [PATCH 1/6] Unhibernate an app when a user exempts it When an app is exempted from hibernation, we unhibernate as well. This prevents confusing situations where a user may return to the "Unused Apps" page and sees that the app is still there even after exemption. Bug: 205641871 Test: atest HibernationSwitchPreferenceControllerTest Change-Id: I4f98a2212eefdb6c456a0de36d428021b262cca3 --- .../HibernationSwitchPreferenceController.java | 10 +++++++++- .../HibernationSwitchPreferenceControllerTest.java | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceController.java b/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceController.java index 1d34a13e1ff..d9228673552 100644 --- a/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceController.java +++ b/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceController.java @@ -26,6 +26,7 @@ import static com.android.settings.Utils.PROPERTY_APP_HIBERNATION_ENABLED; import static com.android.settings.Utils.PROPERTY_HIBERNATION_TARGETS_PRE_S_APPS; import android.app.AppOpsManager; +import android.apphibernation.AppHibernationManager; import android.content.Context; import android.content.pm.PackageManager; import android.provider.DeviceConfig; @@ -134,8 +135,15 @@ public final class HibernationSwitchPreferenceController extends AppInfoPreferen @Override public boolean onPreferenceChange(Preference preference, Object isChecked) { try { + final boolean checked = (boolean) isChecked; mAppOpsManager.setUidMode(OPSTR_AUTO_REVOKE_PERMISSIONS_IF_UNUSED, mPackageUid, - (boolean) isChecked ? MODE_ALLOWED : MODE_IGNORED); + checked ? MODE_ALLOWED : MODE_IGNORED); + if (!checked) { + final AppHibernationManager ahm = + mContext.getSystemService(AppHibernationManager.class); + ahm.setHibernatingForUser(mPackageName, false); + ahm.setHibernatingGlobally(mPackageName, false); + } } catch (RuntimeException e) { return false; } diff --git a/tests/unit/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceControllerTest.java b/tests/unit/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceControllerTest.java index 1e1799a282b..567594c8eb2 100644 --- a/tests/unit/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceControllerTest.java +++ b/tests/unit/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceControllerTest.java @@ -34,6 +34,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.app.AppOpsManager; +import android.apphibernation.AppHibernationManager; import android.content.Context; import android.content.pm.PackageManager; import android.provider.DeviceConfig; @@ -61,6 +62,8 @@ public class HibernationSwitchPreferenceControllerTest { @Mock private PackageManager mPackageManager; @Mock + private AppHibernationManager mAppHibernationManager; + @Mock private SwitchPreference mPreference; private HibernationSwitchPreferenceController mController; @@ -71,6 +74,8 @@ public class HibernationSwitchPreferenceControllerTest { MockitoAnnotations.initMocks(this); mContext = spy(ApplicationProvider.getApplicationContext()); when(mContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager); + when(mContext.getSystemService(AppHibernationManager.class)) + .thenReturn(mAppHibernationManager); when(mPackageManager.getPackageUid(eq(VALID_PACKAGE_NAME), anyInt())) .thenReturn(PACKAGE_UID); when(mPackageManager.getPackageUid(eq(INVALID_PACKAGE_NAME), anyInt())) @@ -109,6 +114,15 @@ public class HibernationSwitchPreferenceControllerTest { assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE); } + @Test + public void onPreferenceChange_unhibernatesWhenExempted() { + mController.setPackage(VALID_PACKAGE_NAME); + mController.onPreferenceChange(mPreference, false); + + verify(mAppHibernationManager).setHibernatingForUser(VALID_PACKAGE_NAME, false); + verify(mAppHibernationManager).setHibernatingGlobally(VALID_PACKAGE_NAME, false); + } + @Test public void updateState_exemptedByDefaultPackage_shouldNotCheck() { when(mAppOpsManager.unsafeCheckOpNoThrow( From dbc08a217811c5a7ab4cb54ed4e1b46ed1dce24e Mon Sep 17 00:00:00 2001 From: shaoweishen Date: Thu, 11 Nov 2021 08:24:04 +0000 Subject: [PATCH 2/6] [Sound panel] Use localized string for button text use localized string "Settings" as button text in Sound panel. revert text change in ag/15926634 Bug: 204326209 Test: Verified on device Change-Id: Ibe99369d3c9f9f2131a33b7831f93a5d1554db3f --- res/layout/panel_layout.xml | 2 +- res/values/strings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/res/layout/panel_layout.xml b/res/layout/panel_layout.xml index 4625a3a0e9d..2b9daebf85d 100644 --- a/res/layout/panel_layout.xml +++ b/res/layout/panel_layout.xml @@ -119,7 +119,7 @@ android:layout_width="wrap_content" android:layout_height="36dp" android:minWidth="0dp" - android:text="@string/see_more"/> + android:text="@string/settings_button"/> Unavailable when connected to %1$s - Settings + See more See less From 5b7230d355a1333d874553d9ec46242ce16b923e Mon Sep 17 00:00:00 2001 From: Jason Chiu Date: Fri, 12 Nov 2021 00:29:03 +0800 Subject: [PATCH 3/6] Check the page searchability for both wifi and network provider page Fix: 205976868 Test: manual, robotest build pass Change-Id: Ic056852cb2524a6724dcf4a67b535fd927478338 --- res/xml/network_provider_settings.xml | 2 +- .../settings/network/NetworkProviderSettings.java | 12 +++++++++--- src/com/android/settings/wifi/WifiSettings.java | 8 +++++++- src/com/android/settings/wifi/slice/WifiSlice.java | 3 +-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/res/xml/network_provider_settings.xml b/res/xml/network_provider_settings.xml index 2d211b5fc85..702584866b9 100644 --- a/res/xml/network_provider_settings.xml +++ b/res/xml/network_provider_settings.xml @@ -68,7 +68,7 @@ android:layout="@layout/preference_category_no_label"/> diff --git a/src/com/android/settings/network/NetworkProviderSettings.java b/src/com/android/settings/network/NetworkProviderSettings.java index 349bb826097..321cc1b842b 100644 --- a/src/com/android/settings/network/NetworkProviderSettings.java +++ b/src/com/android/settings/network/NetworkProviderSettings.java @@ -60,6 +60,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.settings.AirplaneModeEnabler; import com.android.settings.R; import com.android.settings.RestrictedSettingsFragment; +import com.android.settings.Utils; import com.android.settings.core.FeatureFlags; import com.android.settings.core.SubSettingLauncher; import com.android.settings.datausage.DataUsagePreference; @@ -133,7 +134,7 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment @VisibleForTesting static final String PREF_KEY_FIRST_ACCESS_POINTS = "first_access_points"; private static final String PREF_KEY_ACCESS_POINTS = "access_points"; - private static final String PREF_KEY_CONFIGURE_WIFI_SETTINGS = "configure_wifi_settings"; + private static final String PREF_KEY_CONFIGURE_NETWORK_SETTINGS = "configure_network_settings"; private static final String PREF_KEY_SAVED_NETWORKS = "saved_networks"; @VisibleForTesting static final String PREF_KEY_DATA_USAGE = "non_carrier_data_usage"; @@ -280,7 +281,7 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); - if (!FeatureFlagUtils.isEnabled(getContext(), FeatureFlagUtils.SETTINGS_PROVIDER_MODEL)) { + if (!Utils.isProviderModelEnabled(getContext())) { final Intent intent = new Intent(getContext(), WifiSettingsActivity.class); final Bundle extras = getActivity().getIntent().getExtras(); if (extras != null) { @@ -310,7 +311,7 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment mConnectedWifiEntryPreferenceCategory = findPreference(PREF_KEY_CONNECTED_ACCESS_POINTS); mFirstWifiEntryPreferenceCategory = findPreference(PREF_KEY_FIRST_ACCESS_POINTS); mWifiEntryPreferenceCategory = findPreference(PREF_KEY_ACCESS_POINTS); - mConfigureWifiSettingsPreference = findPreference(PREF_KEY_CONFIGURE_WIFI_SETTINGS); + mConfigureWifiSettingsPreference = findPreference(PREF_KEY_CONFIGURE_NETWORK_SETTINGS); mSavedNetworksPreference = findPreference(PREF_KEY_SAVED_NETWORKS); mAddWifiNetworkPreference = new AddWifiNetworkPreference(getPrefContext()); mDataUsagePreference = findPreference(PREF_KEY_DATA_USAGE); @@ -1184,6 +1185,11 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = new BaseSearchIndexProvider(R.xml.network_provider_settings) { + @Override + protected boolean isPageSearchEnabled(Context context) { + return Utils.isProviderModelEnabled(context); + } + @Override public List getNonIndexableKeys(Context context) { final List keys = super.getNonIndexableKeys(context); diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index c4b4d5928d1..e46ed5eff75 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -59,6 +59,7 @@ import com.android.settings.LinkifyUtils; import com.android.settings.R; import com.android.settings.RestrictedSettingsFragment; import com.android.settings.SettingsActivity; +import com.android.settings.Utils; import com.android.settings.core.FeatureFlags; import com.android.settings.core.SubSettingLauncher; import com.android.settings.datausage.DataUsagePreference; @@ -231,7 +232,7 @@ public class WifiSettings extends RestrictedSettingsFragment public void onCreate(Bundle icicle) { super.onCreate(icicle); - if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlagUtils.SETTINGS_PROVIDER_MODEL)) { + if (Utils.isProviderModelEnabled(getContext())) { final Intent intent = new Intent("android.settings.NETWORK_PROVIDER_SETTINGS"); // Add FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_CLEAR_TASK to avoid multiple // instances issue. (e.g. b/191956700) @@ -1067,6 +1068,11 @@ public class WifiSettings extends RestrictedSettingsFragment public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = new BaseSearchIndexProvider(R.xml.wifi_settings) { + @Override + protected boolean isPageSearchEnabled(Context context) { + return !Utils.isProviderModelEnabled(context); + } + @Override public List getNonIndexableKeys(Context context) { final List keys = super.getNonIndexableKeys(context); diff --git a/src/com/android/settings/wifi/slice/WifiSlice.java b/src/com/android/settings/wifi/slice/WifiSlice.java index 29a2bd6cb32..22886926a88 100644 --- a/src/com/android/settings/wifi/slice/WifiSlice.java +++ b/src/com/android/settings/wifi/slice/WifiSlice.java @@ -33,7 +33,6 @@ import android.net.Uri; import android.net.wifi.WifiManager; import android.os.Bundle; import android.text.TextUtils; -import android.util.FeatureFlagUtils; import androidx.annotation.VisibleForTesting; import androidx.core.graphics.drawable.IconCompat; @@ -274,7 +273,7 @@ public class WifiSlice implements CustomSliceable { final Uri contentUri = new Uri.Builder().appendPath(KEY_WIFI).build(); final String className; final String key; - if (FeatureFlagUtils.isEnabled(mContext, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL)) { + if (Utils.isProviderModelEnabled(mContext)) { className = NetworkProviderSettings.class.getName(); key = WifiSwitchPreferenceController.KEY; } else { From ab1b2be7392f0fdb7d1f03cb81b59ea0c2590699 Mon Sep 17 00:00:00 2001 From: Jeremy Goldman Date: Fri, 12 Nov 2021 09:54:56 +0800 Subject: [PATCH 4/6] Deprecation of legacy VPN types no longer depends on the Provider Model Flag Bug: 204522922 Test: atest -c SettingsUnitTests Change-Id: If14354f4c1b5cb1ef74fc8b94b028006ac1a99b3 --- .../android/settings/vpn2/ConfigDialog.java | 44 ++++++++----------- .../android/settings/vpn2/VpnSettings.java | 10 ++--- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/src/com/android/settings/vpn2/ConfigDialog.java b/src/com/android/settings/vpn2/ConfigDialog.java index cd6b4ff9604..bf0dfc9c5b8 100644 --- a/src/com/android/settings/vpn2/ConfigDialog.java +++ b/src/com/android/settings/vpn2/ConfigDialog.java @@ -41,7 +41,6 @@ import androidx.appcompat.app.AlertDialog; import com.android.internal.net.VpnProfile; import com.android.net.module.util.ProxyUtils; import com.android.settings.R; -import com.android.settings.Utils; import com.android.settings.utils.AndroidKeystoreAliasLoader; import java.net.InetAddress; @@ -518,36 +517,31 @@ class ConfigDialog extends AlertDialog implements TextWatcher, String[] types = getContext().getResources().getStringArray(R.array.vpn_types); mTotalTypes = new ArrayList<>(Arrays.asList(types)); mAllowedTypes = new ArrayList<>(Arrays.asList(types)); + + // Although FEATURE_IPSEC_TUNNELS should always be present in android S and beyond, + // keep this check here just to be safe. if (!getContext().getPackageManager().hasSystemFeature( PackageManager.FEATURE_IPSEC_TUNNELS)) { - final List typesList = new ArrayList<>(Arrays.asList(types)); + Log.wtf(TAG, "FEATURE_IPSEC_TUNNELS missing from system"); + } + // If the vpn is new or is not already a legacy type, + // don't allow the user to set the type to a legacy option. - // This must be removed from back to front in order to ensure index consistency - typesList.remove(VpnProfile.TYPE_IKEV2_IPSEC_RSA); - typesList.remove(VpnProfile.TYPE_IKEV2_IPSEC_PSK); - typesList.remove(VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS); + // Set the mProfile.type to TYPE_IKEV2_IPSEC_USER_PASS if the VPN not exist + if (!mExists) { + mProfile.type = VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS; + } - types = typesList.toArray(new String[0]); - } else if (Utils.isProviderModelEnabled(getContext())) { - // If the provider mode is enabled and the vpn is new or is not already a legacy type, - // don't allow the user to set the type to a legacy option. - - // Set the mProfile.type to TYPE_IKEV2_IPSEC_USER_PASS if the VPN not exist - if (!mExists) { - mProfile.type = VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS; - } - - // Remove all types which are legacy types from the typesList - if (!VpnProfile.isLegacyType(mProfile.type)) { - for (int i = mAllowedTypes.size() - 1; i >= 0; i--) { - // This must be removed from back to front in order to ensure index consistency - if (VpnProfile.isLegacyType(i)) { - mAllowedTypes.remove(i); - } + // Remove all types which are legacy types from the typesList + if (!VpnProfile.isLegacyType(mProfile.type)) { + for (int i = mAllowedTypes.size() - 1; i >= 0; i--) { + // This must be removed from back to front in order to ensure index consistency + if (VpnProfile.isLegacyType(i)) { + mAllowedTypes.remove(i); } - - types = mAllowedTypes.toArray(new String[0]); } + + types = mAllowedTypes.toArray(new String[0]); } final ArrayAdapter adapter = new ArrayAdapter( getContext(), android.R.layout.simple_spinner_item, types); diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java index cf0e4fa2ca6..e89785fe535 100644 --- a/src/com/android/settings/vpn2/VpnSettings.java +++ b/src/com/android/settings/vpn2/VpnSettings.java @@ -59,7 +59,6 @@ import com.android.internal.net.VpnConfig; import com.android.internal.net.VpnProfile; import com.android.settings.R; import com.android.settings.RestrictedSettingsFragment; -import com.android.settings.Utils; import com.android.settings.widget.GearPreference; import com.android.settings.widget.GearPreference.OnGearClickListener; import com.android.settingslib.RestrictedLockUtilsInternal; @@ -130,12 +129,11 @@ public class VpnSettings extends RestrictedSettingsFragment implements @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); - // Although FEATURE_IPSEC_TUNNELS should always be present in android S, + // Although FEATURE_IPSEC_TUNNELS should always be present in android S and beyond, // keep this check here just to be safe. - if (Utils.isProviderModelEnabled(getContext()) - && !getContext().getPackageManager().hasSystemFeature( - PackageManager.FEATURE_IPSEC_TUNNELS)) { - Log.w(LOG_TAG, "FEATURE_IPSEC_TUNNELS missing from system, cannot create new VPNs"); + if (!getContext().getPackageManager().hasSystemFeature( + PackageManager.FEATURE_IPSEC_TUNNELS)) { + Log.wtf(LOG_TAG, "FEATURE_IPSEC_TUNNELS missing from system, cannot create new VPNs"); return; } else { // By default, we should inflate this menu. From 6cf16b0aa9179a46c44ebc412f1f607b92687d57 Mon Sep 17 00:00:00 2001 From: Zoey Chen Date: Mon, 1 Nov 2021 16:46:12 +0800 Subject: [PATCH 5/6] [Settings] 1. Add configChange for WFC Activity to cover the changes of rotation and screen size 2. register split rule for MobileNetworkActivity Bug: 204508876 Test: manual Change-Id: Iff3dae41293e79b274d2928cb51efea46fb45dd4 --- AndroidManifest.xml | 1 + .../MobileNetworkSummaryController.java | 10 ++----- .../network/MobileNetworkTwoPaneUtils.java | 29 +++++++++++++++++++ ...rkProviderDownloadedSimListController.java | 2 ++ .../NetworkProviderSimListController.java | 3 ++ .../SubscriptionsPreferenceController.java | 2 ++ .../settings/sim/SimSelectNotification.java | 5 +++- .../calling/WifiCallingSettingsForSub.java | 2 +- 8 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 src/com/android/settings/network/MobileNetworkTwoPaneUtils.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 69f382c7984..e4e1a10d293 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -3337,6 +3337,7 @@ diff --git a/src/com/android/settings/network/MobileNetworkSummaryController.java b/src/com/android/settings/network/MobileNetworkSummaryController.java index bd28e70255d..8530dbedb32 100644 --- a/src/com/android/settings/network/MobileNetworkSummaryController.java +++ b/src/com/android/settings/network/MobileNetworkSummaryController.java @@ -33,7 +33,6 @@ import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import com.android.settings.R; -import com.android.settings.activityembedding.ActivityEmbeddingRulesController; import com.android.settings.core.PreferenceControllerMixin; import com.android.settings.dashboard.DashboardFragment; import com.android.settings.network.helper.SubscriptionAnnotation; @@ -202,12 +201,9 @@ public class MobileNetworkSummaryController extends AbstractPreferenceController || mStatusCache.isPhysicalSimDisableSupport()) { final Intent intent = new Intent(mContext, MobileNetworkActivity.class); intent.putExtra(Settings.EXTRA_SUB_ID, info.getSubscriptionId()); - // MobilenetworkActivity is singleTask, set SplitPairRule to show in 2-pane. - ActivityEmbeddingRulesController.registerTwoPanePairRuleForSettingsHome( - mContext, - intent.getComponent(), - null /* secondaryIntentAction */, - false /* clearTop */); + // MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane. + MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(mContext, intent, + null); mContext.startActivity(intent); return true; } diff --git a/src/com/android/settings/network/MobileNetworkTwoPaneUtils.java b/src/com/android/settings/network/MobileNetworkTwoPaneUtils.java new file mode 100644 index 00000000000..8b3503e35f1 --- /dev/null +++ b/src/com/android/settings/network/MobileNetworkTwoPaneUtils.java @@ -0,0 +1,29 @@ +package com.android.settings.network; + +import android.annotation.Nullable; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +import com.android.settings.activityembedding.ActivityEmbeddingRulesController; + +public class MobileNetworkTwoPaneUtils { + + private static final String TAG = "MobileNetworkTwoPaneUtils"; + + /** + * TODO: b/206061070, the problem of multi-instance should be fixed in Android T to apply the + * Settings' architecture and 2 panes mode instead of registering the rule. + * + * The launchMode of MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane. + */ + public static void registerTwoPaneForMobileNetwork(Context context, Intent intent, + @Nullable String secondaryIntentAction) { + Log.d(TAG, "registerTwoPaneForMobileNetwork"); + ActivityEmbeddingRulesController.registerTwoPanePairRuleForSettingsHome( + context, + intent.getComponent(), + secondaryIntentAction /* secondaryIntentAction */, + false /* clearTop */); + } +} diff --git a/src/com/android/settings/network/NetworkProviderDownloadedSimListController.java b/src/com/android/settings/network/NetworkProviderDownloadedSimListController.java index 43bdd803bf8..1bb50cbaf5e 100644 --- a/src/com/android/settings/network/NetworkProviderDownloadedSimListController.java +++ b/src/com/android/settings/network/NetworkProviderDownloadedSimListController.java @@ -130,6 +130,8 @@ public class NetworkProviderDownloadedSimListController extends pref.setOnPreferenceClickListener(clickedPref -> { final Intent intent = new Intent(mContext, MobileNetworkActivity.class); intent.putExtra(Settings.EXTRA_SUB_ID, info.getSubscriptionId()); + // MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane. + MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(mContext, intent, null); mContext.startActivity(intent); return true; }); diff --git a/src/com/android/settings/network/NetworkProviderSimListController.java b/src/com/android/settings/network/NetworkProviderSimListController.java index 8fb6cb65d36..d6eaab8e14a 100644 --- a/src/com/android/settings/network/NetworkProviderSimListController.java +++ b/src/com/android/settings/network/NetworkProviderSimListController.java @@ -128,6 +128,9 @@ public class NetworkProviderSimListController extends AbstractPreferenceControll } else { final Intent intent = new Intent(mContext, MobileNetworkActivity.class); intent.putExtra(Settings.EXTRA_SUB_ID, info.getSubscriptionId()); + // MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane. + MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(mContext, intent, + null); mContext.startActivity(intent); } return true; diff --git a/src/com/android/settings/network/SubscriptionsPreferenceController.java b/src/com/android/settings/network/SubscriptionsPreferenceController.java index 36c55e2805e..bfe5938b909 100644 --- a/src/com/android/settings/network/SubscriptionsPreferenceController.java +++ b/src/com/android/settings/network/SubscriptionsPreferenceController.java @@ -396,6 +396,8 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl private static void startMobileNetworkActivity(Context context, int subId) { final Intent intent = new Intent(context, MobileNetworkActivity.class); intent.putExtra(Settings.EXTRA_SUB_ID, subId); + // MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane. + MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(context, intent, null); context.startActivity(intent); } diff --git a/src/com/android/settings/sim/SimSelectNotification.java b/src/com/android/settings/sim/SimSelectNotification.java index 7dab4c0557a..84b75231b98 100644 --- a/src/com/android/settings/sim/SimSelectNotification.java +++ b/src/com/android/settings/sim/SimSelectNotification.java @@ -52,6 +52,7 @@ import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.settings.HelpTrampoline; import com.android.settings.R; +import com.android.settings.network.MobileNetworkTwoPaneUtils; import com.android.settings.network.SubscriptionUtil; import com.android.settings.network.telephony.MobileNetworkActivity; @@ -263,7 +264,9 @@ public class SimSelectNotification extends BroadcastReceiver { Intent resultIntent = new Intent(Settings.ACTION_MMS_MESSAGE_SETTING); resultIntent.setClass(context, MobileNetworkActivity.class); resultIntent.putExtra(Settings.EXTRA_SUB_ID, subId); - resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + // MobileNetworkActivity is singleTask, set SplitPairRule to show in 2-pane. + MobileNetworkTwoPaneUtils.registerTwoPaneForMobileNetwork(context, resultIntent, + Settings.ACTION_MMS_MESSAGE_SETTING); PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE); builder.setContentIntent(resultPendingIntent); diff --git a/src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java b/src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java index de64b911111..873c041bb78 100644 --- a/src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java +++ b/src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java @@ -156,7 +156,7 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment } /* - * Launch carrier emergency address managemnent activity + * Launch carrier emergency address management activity */ private final OnPreferenceClickListener mUpdateAddressListener = preference -> { From 617a562660574c0fa5967d53616fe3a366739edb Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Fri, 12 Nov 2021 11:46:08 +0000 Subject: [PATCH 6/6] Revert "Revert "Update styling of NLS dialog"" This reverts commit 6d37fdc5466967a92e2e7c9afebae76cbad120c9. Reason for revert: The Android Auto test has been disabled Change-Id: Iddbe3098d79fbe33c16c2a9c06c8df4a22b49afb Bug: 205920324 Fixes: 191331361 --- res/layout/enable_nls_dialog_content.xml | 167 ++++++++++++++++++ res/values/strings.xml | 9 +- .../ScaryWarningDialogFragment.java | 67 +++++-- 3 files changed, 224 insertions(+), 19 deletions(-) create mode 100644 res/layout/enable_nls_dialog_content.xml diff --git a/res/layout/enable_nls_dialog_content.xml b/res/layout/enable_nls_dialog_content.xml new file mode 100644 index 00000000000..5e1dec98e59 --- /dev/null +++ b/res/layout/enable_nls_dialog_content.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +