增加user 版本属性控制开关

增加user 版本属性控制开关,第1张

--- src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java ---
index f039813..efef6ec 100644
@@ -49,4 +49,5 @@ import com.android.settingslib.development.DevelopmentSettingsEnabler;
 import com.mediatek.settings.UtilsExt;
 import com.mediatek.settings.ext.IDeviceInfoSettingsExt;
+import android.os.SystemProperties;
 
 public class BuildNumberPreferenceController extends AbstractPreferenceController implements
@@ -122,4 +123,9 @@ public class BuildNumberPreferenceController extends AbstractPreferenceControlle
     @Override
     public boolean handlePreferenceTreeClick(Preference preference) {

+        if("user".equals(SystemProperties.get("ro.build.type"))){
+            return false;
+        }

         if (!TextUtils.equals(preference.getKey(), KEY_BUILD_NUMBER)) {
             return false;

--- src/com/android/settings/deviceinfo/DeviceModelPreferenceController.java ---
index 71c6b8b..5609eca 100644
@@ -30,4 +30,5 @@ import com.android.settingslib.core.AbstractPreferenceController;
 import com.mediatek.settings.UtilsExt;
 import com.mediatek.settings.ext.IDeviceInfoSettingsExt;
+import android.os.SystemProperties;
 
 public class DeviceModelPreferenceController extends AbstractPreferenceController implements
@@ -70,4 +71,9 @@ public class DeviceModelPreferenceController extends AbstractPreferenceControlle
     @Override
     public boolean handlePreferenceTreeClick(Preference preference) {

+        if("user".equals(SystemProperties.get("ro.build.type"))){
+            return false;
+        }

         if (!TextUtils.equals(preference.getKey(), KEY_DEVICE_MODEL)) {
             return false;

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/725596.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-26
下一篇 2022-04-26

发表评论

登录后才能评论

评论列表(0条)

保存