summaryrefslogtreecommitdiffstats
path: root/src/com/cyngn/theme/util/AudioUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/cyngn/theme/util/AudioUtils.java')
-rw-r--r--src/com/cyngn/theme/util/AudioUtils.java38
1 files changed, 1 insertions, 37 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()) {