diff --git a/core/java/android/app/IUiModeManager.aidl b/core/java/android/app/IUiModeManager.aidl index 7f0b6fb61f054..cae54b6c0611f 100644 --- a/core/java/android/app/IUiModeManager.aidl +++ b/core/java/android/app/IUiModeManager.aidl @@ -52,21 +52,6 @@ interface IUiModeManager { */ int getNightMode(); - /** - * Sets whith theme overlays to use within /vendor/overlay. - */ - void setTheme(String theme); - - /** - * Gets which theme overlays to use within /vendor/overlay. - */ - String getTheme(); - - /** - * Gets the themes available in /vendor/overlay. - */ - String[] getAvailableThemes(); - /** * Tells if UI mode is locked or not. */ diff --git a/core/java/android/app/UiModeManager.java b/core/java/android/app/UiModeManager.java index af41a7d5ac5d2..07e257083fa22 100644 --- a/core/java/android/app/UiModeManager.java +++ b/core/java/android/app/UiModeManager.java @@ -241,50 +241,6 @@ public class UiModeManager { } } - /** - * Sets the vendor theme overlay property, then triggers a reboot. - * @hide - */ - public void setTheme(String theme) { - if (mService != null) { - try { - mService.setTheme(theme); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - } - } - - /** - * Gets the vendor theme overlay property. - * @hide - */ - public String getTheme() { - if (mService != null) { - try { - return mService.getTheme(); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - } - return null; - } - - /** - * Gets the valid inputs to {@link #setTheme(String)}. - * @hide - */ - public String[] getAvailableThemes() { - if (mService != null) { - try { - return mService.getAvailableThemes(); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - } - return null; - } - /** * Returns the currently configured night mode. *

diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp index 373bda96afba1..90aee9e22f77a 100644 --- a/core/jni/android_util_AssetManager.cpp +++ b/core/jni/android_util_AssetManager.cpp @@ -178,11 +178,7 @@ static void verifySystemIdmaps() // Directories to scan for overlays: if OVERLAY_THEME_DIR_PROPERTY is defined, // use OVERLAY_DIR/ in addition to OVERLAY_DIR. char subdir[PROP_VALUE_MAX]; - int len = __system_property_get(AssetManager::OVERLAY_THEME_DIR_PERSIST_PROPERTY, - subdir); - if (len == 0) { - len = __system_property_get(AssetManager::OVERLAY_THEME_DIR_PROPERTY, subdir); - } + int len = __system_property_get(AssetManager::OVERLAY_THEME_DIR_PROPERTY, subdir); if (len > 0) { String8 overlayPath = String8(AssetManager::OVERLAY_DIR) + "/" + subdir; if (stat(overlayPath.string(), &st) == 0) { diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp index acacd7654cf1b..5603508eaf09e 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -74,7 +74,6 @@ const char* AssetManager::RESOURCES_FILENAME = "resources.arsc"; const char* AssetManager::IDMAP_BIN = "/system/bin/idmap"; const char* AssetManager::OVERLAY_DIR = "/vendor/overlay"; const char* AssetManager::OVERLAY_THEME_DIR_PROPERTY = "ro.boot.vendor.overlay.theme"; -const char* AssetManager::OVERLAY_THEME_DIR_PERSIST_PROPERTY = "persist.vendor.overlay.theme"; const char* AssetManager::TARGET_PACKAGE_NAME = "android"; const char* AssetManager::TARGET_APK_PATH = "/system/framework/framework-res.apk"; const char* AssetManager::IDMAP_DIR = "/data/resource-cache"; diff --git a/libs/androidfw/include/androidfw/AssetManager.h b/libs/androidfw/include/androidfw/AssetManager.h index becd307d114d1..0441b9d789e2f 100644 --- a/libs/androidfw/include/androidfw/AssetManager.h +++ b/libs/androidfw/include/androidfw/AssetManager.h @@ -66,11 +66,6 @@ public: * OVERLAY_DIR. */ static const char* OVERLAY_THEME_DIR_PROPERTY; - /** - * If OVERLAY_THEME_DIR_PERSIST_PROPERTY, use it to override - * OVERLAY_THEME_DIR_PROPERTY. - */ - static const char* OVERLAY_THEME_DIR_PERSIST_PROPERTY; static const char* TARGET_PACKAGE_NAME; static const char* TARGET_APK_PATH; static const char* IDMAP_DIR; diff --git a/services/core/java/com/android/server/UiModeManagerService.java b/services/core/java/com/android/server/UiModeManagerService.java index 5115fdecd1bf0..e4f4687326863 100644 --- a/services/core/java/com/android/server/UiModeManagerService.java +++ b/services/core/java/com/android/server/UiModeManagerService.java @@ -322,52 +322,6 @@ final class UiModeManagerService extends SystemService { } } - @Override - public void setTheme(String theme) { - if (getContext().checkCallingOrSelfPermission( - android.Manifest.permission.MODIFY_THEME_OVERLAY) - != PackageManager.PERMISSION_GRANTED) { - Slog.e(TAG, "setTheme requires MODIFY_THEME_OVERLAY permission"); - return; - } - SystemProperties.set("persist.vendor.overlay.theme", theme); - mHandler.post(() -> ShutdownThread.reboot(getContext(), - PowerManager.SHUTDOWN_USER_REQUESTED, false)); - } - - @Override - public String getTheme() { - if (getContext().checkCallingOrSelfPermission( - android.Manifest.permission.MODIFY_THEME_OVERLAY) - != PackageManager.PERMISSION_GRANTED) { - Slog.e(TAG, "setTheme requires MODIFY_THEME_OVERLAY permission"); - return null; - } - return SystemProperties.get("persist.vendor.overlay.theme"); - } - - @Override - public String[] getAvailableThemes() { - if (getContext().checkCallingOrSelfPermission( - android.Manifest.permission.MODIFY_THEME_OVERLAY) - != PackageManager.PERMISSION_GRANTED) { - Slog.e(TAG, "getAvailableThemes requires MODIFY_THEME_OVERLAY permission"); - return null; - } - String def = SystemProperties.get("ro.boot.vendor.overlay.theme"); - if (TextUtils.isEmpty(def)) { - def = null; - } - String[] fileList = new File("/vendor/overlay").list(); - if (fileList == null) return new String[0]; - ArrayList options = new ArrayList(fileList.length + 1); - Collections.addAll(options, fileList); - if (!options.contains(def)) { - options.add(0, def); - } - return options.toArray(new String[options.size()]); - } - @Override public int getNightMode() { synchronized (mLock) {