diff options
author | Clark Scheff <clark@cyngn.com> | 2014-06-30 13:57:21 -0700 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2014-06-30 13:57:21 -0700 |
commit | 2071f7e229e34cf716ad0d99bc5ba51e96b32ab1 (patch) | |
tree | 18f88c0ec360b017b159c44871dc59756daa9803 /src | |
parent | e03ed82a3716e714c5e342585fd4411766bb1afe (diff) | |
download | android_packages_providers_ThemesProvider-2071f7e229e34cf716ad0d99bc5ba51e96b32ab1.tar.gz android_packages_providers_ThemesProvider-2071f7e229e34cf716ad0d99bc5ba51e96b32ab1.tar.bz2 android_packages_providers_ThemesProvider-2071f7e229e34cf716ad0d99bc5ba51e96b32ab1.zip |
Revert "Reapply theme components in a runnable."
This reverts commit 92f77e77e097e59f9ec8d7bc64324f1987230af6.
Change-Id: I79a7beedb43d097e743a41b0501805cd1afad9d4
Diffstat (limited to 'src')
-rw-r--r-- | src/org/cyanogenmod/themes/provider/ThemePackageHelper.java | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java index c9752d3..d602315 100644 --- a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java +++ b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java @@ -26,8 +26,6 @@ import android.content.pm.ThemeUtils; import android.content.res.AssetManager; import android.content.res.ThemeManager; import android.database.Cursor; -import android.os.Handler; -import android.os.Looper; import android.provider.ThemesContract; import android.provider.ThemesContract.MixnMatchColumns; import android.provider.ThemesContract.ThemesColumns; @@ -49,8 +47,6 @@ import static android.content.res.CustomTheme.HOLO_DEFAULT; public class ThemePackageHelper { public final static String TAG = ThemePackageHelper.class.getName(); - private static final long REAPPLY_THEME_DELAY = 1000L; - // Maps the theme component to its folder name in assets. public static HashMap<String, String> sComponentToFolderName = new HashMap<String, String>(); static { @@ -147,8 +143,7 @@ public class ThemePackageHelper { context.getContentResolver().insert(ThemesColumns.CONTENT_URI, values); } - public static void updatePackage(final Context context, final String pkgName) - throws NameNotFoundException { + public static void updatePackage(Context context, String pkgName) throws NameNotFoundException { if (HOLO_DEFAULT.equals(pkgName)) { updateHoloPackageInternal(context); } else { @@ -162,17 +157,8 @@ public class ThemePackageHelper { updateLegacyIconPackInternal(context, pi, capabilities); } - // Calling reapplyInstalledComponentsForTheme in a runnable posted to a handler gives - // other processes enough time to process the ACTION_PACKAGE_REPLACED before the theme - // change is completed and restarts apps due to config change. - Handler h = new Handler(Looper.getMainLooper()); - h.postDelayed(new Runnable() { - @Override - public void run() { - // We should reapply any components that are currently applied for this theme. - reapplyInstalledComponentsForTheme(context, pkgName); - } - }, REAPPLY_THEME_DELAY); + // We should reapply any components that are currently applied for this theme. + reapplyInstalledComponentsForTheme(context, pkgName); } } @@ -240,6 +226,9 @@ public class ThemePackageHelper { values.put(ThemesColumns.DATE_CREATED, System.currentTimeMillis()); values.put(ThemesColumns.LAST_UPDATE_TIME, pi.lastUpdateTime); + // Insert theme capabilities + insertCapabilities(capabilities, values); + String where = ThemesColumns.PKG_NAME + "=?"; String[] args = { pi.packageName }; context.getContentResolver().update(ThemesColumns.CONTENT_URI, values, where, args); |