android6.0 Setting去除各功能选项总结

-- alps/packages/apps/Settings/src/com/android/settings/SettingsActivity.java --
index a1033ec..edb26c6 100755
@@ -1300,21 +1300,44 @@ public class SettingsActivity extends Activity
                     if (!Utils.updateTileToSpecificActivityFromMetaDataOrRemove(this, tile)) {
                         removeTile = true;
                     }
-                } else if (id == R.id.wifi_settings) {
-                    // Remove WiFi Settings if WiFi service is not available.
-                    if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
-                        removeTile = true;  //by lwz
-                    }
-                } else if (id == R.id.bluetooth_settings) {
-                    // Remove Bluetooth Settings if Bluetooth service is not available.
-                    if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
-                        removeTile = true;  //by lwz
-                    }
-                } else if (id == R.id.data_usage_settings) {
-                    // Remove data usage when kernel module not enabled
-                    if (!Utils.isBandwidthControlEnabled()) {
+                } else if (DefineSystemProperties.MMI_BOOL_DEL_SIM_SETTINGS){
+					if(id == R.id.sim_settings) {   //add or modefied by lwz start
+						// Remove sim Settings.
                         removeTile = true;
-                    }
+				} else if (id == R.id.wifi_settings) {
+					if(DefineSystemProperties.MMI_BOOL_DEL_WIFI_SETTINGS){
+					   // Remove WiFi Settings if WiFi service is not available.
+						if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
+							removeTile = true;
+						}
+					}else{
+						if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
+							removeTile = true;
+						}
+					}
+                } else if (id == R.id.bluetooth_settings) {                             
+                	if(DefineSystemProperties.MMI_BOOL_DEL_BLUETOOTH_SETTINGS){
+						// Remove Bluetooth Settings if Bluetooth service is not available.
+						if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
+							removeTile = true;
+						}
+					}else{						
+						if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
+							removeTile = true; 
+						}
+					}
+                } else if (id == R.id.data_usage_settings) {
+					if(DefineSystemProperties.MMI_BOOL_DEL_DATA_USAGE_SETTINGS){
+						// Remove data usage when kernel module not enabled
+						if (Utils.isBandwidthControlEnabled()) {
+							removeTile = true;
+						}
+					}else{
+						if (!Utils.isBandwidthControlEnabled()) {
+							removeTile = true;
+						}
+					}//end
                 } else if (id == R.id.battery_settings) {
                     // Remove battery settings when battery is not available. (e.g. TV)
-- alps/packages/apps/Settings/src/com/android/settings/WirelessSettings.java --
index 3be891f..05a204b 100755
@@ -302,9 +302,17 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde
             findPreference(KEY_VPN_SETTINGS).setDependency(KEY_TOGGLE_AIRPLANE);
         }
         // Disable VPN.
-        if (isSecondaryUser || mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN)) {
+        /*if (isSecondaryUser || mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN)) {
             removePreference(KEY_VPN_SETTINGS);
-        }
+        }*/
+		//2019.05.28 modify by lwz
+		if(DefineSystemProperties.MMI_BOOL_DEL_VPN_SETTINGS){
+			removePreference(KEY_VPN_SETTINGS);
+		}else{
+			if (isSecondaryUser || mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN)) {
+            removePreference(KEY_VPN_SETTINGS);
+			}
+		}//end
 
         // Manually set dependencies for Bluetooth when not toggleable.
         if (toggleable == null || !toggleable.contains(Settings.Global.RADIO_BLUETOOTH)) {
@@ -341,11 +349,27 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde
 
         // Remove Mobile Network Settings and Manage Mobile Plan for secondary users,
         // if it's a wifi-only device, or if the settings are restricted.
-        if (isSecondaryUser || Utils.isWifiOnly(getActivity())
+		
+        /*if (isSecondaryUser || Utils.isWifiOnly(getActivity())
                 || mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS)) {
             removePreference(KEY_MOBILE_NETWORK_SETTINGS);
             removePreference(KEY_MANAGE_MOBILE_PLAN);
-        }
+        }*/
+		//2019.05.28 modify by lwz
+		if(DefineSystemProperties.MMI_BOOL_DEL_MOBILE_NETWORK){
+			if (!isSecondaryUser || Utils.isWifiOnly(getActivity())
+                || mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS)) {
+            removePreference(KEY_MOBILE_NETWORK_SETTINGS);
+            removePreference(KEY_MANAGE_MOBILE_PLAN);
+			}
+		}else{
+			if (isSecondaryUser || Utils.isWifiOnly(getActivity())
+                || mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS)) {
+            removePreference(KEY_MOBILE_NETWORK_SETTINGS);
+            removePreference(KEY_MANAGE_MOBILE_PLAN);
+			}
+		}//end
+		
         // Remove Mobile Network Settings and Manage Mobile Plan
         // if config_show_mobile_plan sets false.
         final boolean isMobilePlanEnabled = this.getResources().getBoolean(
@@ -358,10 +382,20 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde
         }
 
         // Remove Airplane Mode settings if it's a stationary device such as a TV.
-        if (mPm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)) {
+        /*if (!mPm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)) {
             removePreference(KEY_TOGGLE_AIRPLANE);
-        }
-
+        }*/
+		//2019.05.28 modify by lwz
+		if(DefineSystemProperties.MMI_BOOL_DEL_AIRPLANE_SETTINGS){
+			if (!mPm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)) {
+				removePreference(KEY_TOGGLE_AIRPLANE);
+			}
+		}else{
+			if (mPm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)) {
+				removePreference(KEY_TOGGLE_AIRPLANE);
+			}
+		}//end
+		
         // Enable Proxy selector settings if allowed.
         Preference mGlobalProxy = findPreference(KEY_PROXY_SETTINGS);
         final DevicePolicyManager mDPM = (DevicePolicyManager)
@@ -445,7 +479,7 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde
 
         // update WFC setting
         final Context context = getActivity();
-        if (ImsManager.isWfcEnabledByPlatform(context)) {
+        /*if (ImsManager.isWfcEnabledByPlatform(context)) {
             getPreferenceScreen().addPreference(mButtonWfc);
 
             mButtonWfc.setSummary(WifiCallingSettings.getWfcModeSummary(
@@ -458,7 +492,26 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde
             mWfcExt.customizedWfcPreference(getActivity(), getPreferenceScreen());
         } else {
             removePreference(KEY_WFC_SETTINGS);
-        }
+        }*/
+		//2019.05.28 modify by lwz
+		if(DefineSystemProperties.MMI_BOOL_DEL_WFC_SETTINGS){
+			removePreference(KEY_WFC_SETTINGS);
+		}else{
+			if (ImsManager.isWfcEnabledByPlatform(context)) {
+				getPreferenceScreen().addPreference(mButtonWfc);
+
+				mButtonWfc.setSummary(WifiCallingSettings.getWfcModeSummary(
+						context, ImsManager.getWfcMode(context)));
+				/// M: for plug-in
+				mWfcExt.initPlugin(this);
+				mButtonWfc.setSummary(mWfcExt.getWfcSummary(context,
+						WifiCallingSettings.getWfcModeSummary(context,
+								ImsManager.getWfcMode(context))));
+				mWfcExt.customizedWfcPreference(getActivity(), getPreferenceScreen());
+			} else {
+				removePreference(KEY_WFC_SETTINGS);
+			}
+		}//end
 
         /// M: @{
         TelephonyManager telephonyManager =

 

你可能感兴趣的:(Setting)