From 4696e2bde39d1780d2f64566b149f32011b4f9f4 Mon Sep 17 00:00:00 2001 From: huangcm <1263938474@qq.com> Date: Fri, 11 Apr 2025 08:08:38 +0000 Subject: [PATCH] feat(Launcher3): add boot on DeviceTest config --- android/packages/apps/Launcher3/src/com/android/launcher3/Utilities.java | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/android/packages/apps/Launcher3/src/com/android/launcher3/Utilities.java b/android/packages/apps/Launcher3/src/com/android/launcher3/Utilities.java index 65aa3a7..293efc7 100755 --- a/android/packages/apps/Launcher3/src/com/android/launcher3/Utilities.java +++ b/android/packages/apps/Launcher3/src/com/android/launcher3/Utilities.java @@ -537,6 +537,21 @@ return defaultValue; } + public static boolean setSystemProperty(String property, String value) { + if (TextUtils.isEmpty(property) || TextUtils.isEmpty(value)) { + return false; + } + try { + Class clazz = Class.forName("android.os.SystemProperties"); + Method setter = clazz.getDeclaredMethod("set", String.class, String.class); + setter.invoke(null, property, value); + return true; + } catch (Exception e) { + Log.d(TAG, "Failed to set property: " + e.getMessage()); + return false; + } + } + /** * Ensures that a value is within given bounds. Specifically: * If value is less than lowerBound, return lowerBound; else if value is greater than upperBound, -- Gitblit v1.6.2