Merge "Handle csip set member automatic pair in Setting"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8f5a07c..7f99cd2 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1476,6 +1476,23 @@
         </activity>
 
         <activity
+            android:name="Settings$WifiScanningSettingsActivity"
+            android:label="@string/location_scanning_wifi_always_scanning_title"
+            android:icon="@drawable/ic_homepage_location"
+            android:exported="true"
+            android:permission="android.permission.CHANGE_WIFI_STATE"
+            android:configChanges="orientation|keyboardHidden|screenSize">
+            <intent-filter android:priority="1">
+                <action android:name="android.settings.WIFI_SCANNING_SETTINGS" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                       android:value="com.android.settings.location.WifiScanningFragment" />
+            <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
+                       android:value="true" />
+        </activity>
+
+        <activity
             android:name=".Settings$SecurityDashboardActivity"
             android:label="@string/security_settings_title"
             android:icon="@drawable/ic_homepage_security"
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index a892b97..231a149 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -163,6 +163,7 @@
     public static class AppUsageAccessSettingsActivity extends SettingsActivity { /* empty */ }
     public static class LocationSettingsActivity extends SettingsActivity { /* empty */ }
     public static class ScanningSettingsActivity extends SettingsActivity { /* empty */ }
+    public static class WifiScanningSettingsActivity extends SettingsActivity { /* empty */ }
     public static class PrivacyDashboardActivity extends SettingsActivity { /* empty */ }
     public static class PrivacySettingsActivity extends SettingsActivity { /* empty */ }
     public static class FactoryResetActivity extends SettingsActivity {
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 458aadb..1adf199 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -112,6 +112,7 @@
 import com.android.settings.localepicker.LocaleListEditor;
 import com.android.settings.location.LocationServices;
 import com.android.settings.location.LocationSettings;
+import com.android.settings.location.WifiScanningFragment;
 import com.android.settings.network.MobileNetworkListFragment;
 import com.android.settings.network.NetworkDashboardFragment;
 import com.android.settings.network.NetworkProviderSettings;
@@ -201,6 +202,7 @@
             ProcessStatsUi.class.getName(),
             NotificationStation.class.getName(),
             LocationSettings.class.getName(),
+            WifiScanningFragment.class.getName(),
             PrivacyDashboardFragment.class.getName(),
             LocationServices.class.getName(),
             SecuritySettings.class.getName(),
diff --git a/src/com/android/settings/deviceinfo/legal/LegalPreferenceController.java b/src/com/android/settings/deviceinfo/legal/LegalPreferenceController.java
index 9465fff..fe45923 100644
--- a/src/com/android/settings/deviceinfo/legal/LegalPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/legal/LegalPreferenceController.java
@@ -87,9 +87,9 @@
         }
 
         // Replace the intent with this specific activity
-        mPreference.setIntent(new Intent().setClassName(
-                resolveInfo.activityInfo.packageName,
-                resolveInfo.activityInfo.name));
+        mPreference.setIntent(new Intent()
+                .setClassName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name)
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
 
         mPreference.setTitle(resolveInfo.loadLabel(mPackageManager));
     }
diff --git a/src/com/android/settings/deviceinfo/legal/ModuleLicensePreference.java b/src/com/android/settings/deviceinfo/legal/ModuleLicensePreference.java
index e012275..8a3c9aa 100644
--- a/src/com/android/settings/deviceinfo/legal/ModuleLicensePreference.java
+++ b/src/com/android/settings/deviceinfo/legal/ModuleLicensePreference.java
@@ -51,6 +51,7 @@
                         ModuleLicenseProvider.LICENSE_FILE_MIME_TYPE)
                 .putExtra(Intent.EXTRA_TITLE, mModule.getName())
                 .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                 .addCategory(Intent.CATEGORY_DEFAULT)
                 .setPackage("com.android.htmlviewer");
         try {
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index a5e4197..894eb68 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -355,21 +355,22 @@
         if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
             return false;
         }
-        final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class)
-                .createForSubscriptionId(subId);
+
         final PersistableBundle carrierConfig = context.getSystemService(
                 CarrierConfigManager.class).getConfigForSubId(subId);
-
-
-        if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {
-            return true;
-        } else if (carrierConfig != null
+        if (carrierConfig != null
                 && !carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL)
                 && carrierConfig.getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL)) {
             return true;
         }
 
+        final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class)
+                .createForSubscriptionId(subId);
+        if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {
+            return true;
+        }
+
         if (isWorldMode(context, subId)) {
             final int settingsNetworkMode = getNetworkTypeFromRaf(
                     (int) telephonyManager.getAllowedNetworkTypesForReason(
@@ -420,20 +421,21 @@
     }
 
     private static boolean isGsmBasicOptions(Context context, int subId) {
-        final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class)
-                .createForSubscriptionId(subId);
         final PersistableBundle carrierConfig = context.getSystemService(
                 CarrierConfigManager.class).getConfigForSubId(subId);
-
-        if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
-            return true;
-        } else if (carrierConfig != null
+        if (carrierConfig != null
                 && !carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL)
                 && carrierConfig.getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL)) {
             return true;
         }
 
+        final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class)
+                .createForSubscriptionId(subId);
+        if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
+            return true;
+        }
+
         return false;
     }
 
diff --git a/src/com/android/settings/notification/history/NotificationStation.java b/src/com/android/settings/notification/history/NotificationStation.java
index fe8b168..bd5b83a 100644
--- a/src/com/android/settings/notification/history/NotificationStation.java
+++ b/src/com/android/settings/notification/history/NotificationStation.java
@@ -640,7 +640,7 @@
                     .append(' ')
                     .append(bold(getString(R.string.notification_log_details_ashmem)))
                     .append(delim)
-                    .append(String.valueOf(p.getBlobAshmemSize()))
+                    .append(String.valueOf(p.getOpenAshmemSize()))
                     .append("\n");
         }
         return sb;