huangcm
2025-04-09 4696e2bde39d1780d2f64566b149f32011b4f9f4
android/packages/apps/Launcher3/src/com/android/launcher3/Utilities.java
....@@ -537,6 +537,21 @@
537537 return defaultValue;
538538 }
539539
540
+ public static boolean setSystemProperty(String property, String value) {
541
+ if (TextUtils.isEmpty(property) || TextUtils.isEmpty(value)) {
542
+ return false;
543
+ }
544
+ try {
545
+ Class clazz = Class.forName("android.os.SystemProperties");
546
+ Method setter = clazz.getDeclaredMethod("set", String.class, String.class);
547
+ setter.invoke(null, property, value);
548
+ return true;
549
+ } catch (Exception e) {
550
+ Log.d(TAG, "Failed to set property: " + e.getMessage());
551
+ return false;
552
+ }
553
+ }
554
+
540555 /**
541556 * Ensures that a value is within given bounds. Specifically:
542557 * If value is less than lowerBound, return lowerBound; else if value is greater than upperBound,