diff options
Diffstat (limited to 'src/com/cyngn/theme/util')
-rw-r--r-- | src/com/cyngn/theme/util/AudioUtils.java | 38 | ||||
-rw-r--r-- | src/com/cyngn/theme/util/BootAnimationHelper.java | 2 | ||||
-rw-r--r-- | src/com/cyngn/theme/util/IconPreviewHelper.java | 2 | ||||
-rw-r--r-- | src/com/cyngn/theme/util/NotificationHelper.java | 6 | ||||
-rw-r--r-- | src/com/cyngn/theme/util/Utils.java | 2 |
5 files changed, 7 insertions, 43 deletions
diff --git a/src/com/cyngn/theme/util/AudioUtils.java b/src/com/cyngn/theme/util/AudioUtils.java index 3899342..629232a 100644 --- a/src/com/cyngn/theme/util/AudioUtils.java +++ b/src/com/cyngn/theme/util/AudioUtils.java @@ -23,16 +23,12 @@ public class AudioUtils { public static void loadThemeAudible(Context context, int type, String pkgName, MediaPlayer mp) throws PackageManager.NameNotFoundException { - if (ThemeConfig.HOLO_DEFAULT.equals(pkgName)) { + if (ThemeConfig.SYSTEM_DEFAULT.equals(pkgName)) { loadSystemAudible(type, mp); return; } PackageInfo pi = context.getPackageManager().getPackageInfo(pkgName, 0); Context themeCtx = context.createPackageContext(pkgName, 0); - if (pi.isLegacyThemeApk) { - loadLegacyThemeAudible(themeCtx, type, pi, mp); - return; - } AssetManager assetManager = themeCtx.getAssets(); String assetPath; switch (type) { @@ -68,38 +64,6 @@ public class AudioUtils { } } - public static void loadLegacyThemeAudible(Context themeCtx, int type, PackageInfo pi, - MediaPlayer mp) { - if (pi.legacyThemeInfos == null || pi.legacyThemeInfos.length == 0) - return; - AssetManager assetManager = themeCtx.getAssets(); - String assetPath; - switch (type) { - case RingtoneManager.TYPE_NOTIFICATION: - assetPath = pi.legacyThemeInfos[0].notificationFileName; - break; - case RingtoneManager.TYPE_RINGTONE: - assetPath = pi.legacyThemeInfos[0].ringtoneFileName; - break; - default: - assetPath = null; - break; - } - if (assetPath != null) { - try { - AssetFileDescriptor afd = assetManager.openFd(assetPath); - if (mp != null) { - mp.reset(); - mp.setDataSource(afd.getFileDescriptor(), - afd.getStartOffset(), afd.getLength()); - mp.prepare(); - } - } catch (IOException e) { - Log.e(TAG, "Unable to load legacy sound for " + pi.packageName, e); - } - } - } - public static void loadSystemAudible(int type, MediaPlayer mp) { final String audiblePath = ThemeUtils.getDefaultAudiblePath(type); if (audiblePath != null && (new File(audiblePath)).exists()) { diff --git a/src/com/cyngn/theme/util/BootAnimationHelper.java b/src/com/cyngn/theme/util/BootAnimationHelper.java index 589b037..283f854 100644 --- a/src/com/cyngn/theme/util/BootAnimationHelper.java +++ b/src/com/cyngn/theme/util/BootAnimationHelper.java @@ -268,7 +268,7 @@ public class BootAnimationHelper { String previewName = null; // this is ugly, ugly, ugly. Did I mention this is ugly? try { - if (ThemeConfig.HOLO_DEFAULT.equals(path)) { + if (ThemeConfig.SYSTEM_DEFAULT.equals(path)) { previewName = getPreviewFrameEntryName( new FileInputStream(SYSTEM_BOOT_ANI_PATH)); bitmap = loadPreviewFrame( diff --git a/src/com/cyngn/theme/util/IconPreviewHelper.java b/src/com/cyngn/theme/util/IconPreviewHelper.java index fe00954..60ef9c8 100644 --- a/src/com/cyngn/theme/util/IconPreviewHelper.java +++ b/src/com/cyngn/theme/util/IconPreviewHelper.java @@ -170,7 +170,7 @@ public class IconPreviewHelper { private Drawable getFullResIcon(Resources resources, int iconId) { Drawable d; try { - d = resources.getDrawableForDensity(iconId, mIconDpi, false); + d = resources.getDrawableForDensity(iconId, mIconDpi, null, false); } catch (Resources.NotFoundException e) { d = null; } diff --git a/src/com/cyngn/theme/util/NotificationHelper.java b/src/com/cyngn/theme/util/NotificationHelper.java index dcdc938..c4ff73d 100644 --- a/src/com/cyngn/theme/util/NotificationHelper.java +++ b/src/com/cyngn/theme/util/NotificationHelper.java @@ -24,10 +24,8 @@ public class NotificationHelper { String themeName = null; try { PackageInfo pi = context.getPackageManager().getPackageInfo(pkgName, 0); - if (pi.themeInfos != null && pi.themeInfos.length > 0) { - themeName = pi.themeInfos[0].name; - } else if (pi.legacyThemeInfos != null && pi.legacyThemeInfos[0] != null) { - themeName = pi.legacyThemeInfos[0].name; + if (pi.themeInfo != null) { + themeName = pi.themeInfo.name; } } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); diff --git a/src/com/cyngn/theme/util/Utils.java b/src/com/cyngn/theme/util/Utils.java index d7b3e89..dd41c97 100644 --- a/src/com/cyngn/theme/util/Utils.java +++ b/src/com/cyngn/theme/util/Utils.java @@ -289,6 +289,7 @@ public class Utils { final int scaledWidth = Math.round((wallpaper.getWidth() * scale)); final int scaledHeight = Math.round((wallpaper.getHeight() * scale)); + // TODO: set xOffset to wm.getLastWallpaperX() once available int xOffset = wm.getLastWallpaperX(); // x offset if (xOffset == -1) { @@ -298,6 +299,7 @@ public class Utils { } // y offsets + // TODO: set yOffset to wm.getLastWallpaperY() once available int yOffset = wm.getLastWallpaperY(); if (yOffset == -1) { yOffset = 0; |