Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93eeacaf authored by Clark Scheff's avatar Clark Scheff
Browse files

CM11 Themes: Use theme name for audible name.

Change-Id: Ib841cb80925b0f3f5ac770e00df04515849e9360
parent b8a6460b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -348,8 +348,7 @@ public class ThemeUtils {
                (fileName.endsWith(".mp3") || fileName.endsWith(".ogg")));
    }

    public static boolean setAudible(Context context, File ringtone, int type) {
        final String name = ringtone.getName();
    public static boolean setAudible(Context context, File ringtone, int type, String name) {
        final String path = ringtone.getAbsolutePath();
        final String mimeType = name.endsWith(".ogg") ? "audio/ogg" : "audio/mp3";
        ContentValues values = new ContentValues();
+2 −2
Original line number Diff line number Diff line
@@ -343,7 +343,7 @@ public class ThemeService extends IThemeService.Stub {
            File outFile = new File(dirPath, asset);
            FileUtils.copyToFile(is, outFile);
            FileUtils.setPermissions(outFile, FileUtils.S_IRWXU|FileUtils.S_IRGRP|FileUtils.S_IRWXO, -1, -1);
            ThemeUtils.setAudible(mContext, outFile, type);
            ThemeUtils.setAudible(mContext, outFile, type, pi.themeInfos[0].name);
        } catch (Exception e) {
            Log.e(TAG, "There was an error installing the new audio file for pkg " + mPkgName, e);
            return false;
@@ -389,7 +389,7 @@ public class ThemeService extends IThemeService.Stub {
            File outFile = new File(dirPath, asset.substring(asset.lastIndexOf('/') + 1));
            FileUtils.copyToFile(is, outFile);
            FileUtils.setPermissions(outFile, FileUtils.S_IRWXU|FileUtils.S_IRGRP|FileUtils.S_IRWXO, -1, -1);
            ThemeUtils.setAudible(mContext, outFile, type);
            ThemeUtils.setAudible(mContext, outFile, type, pi.legacyThemeInfos[0].name);
        } catch (Exception e) {
            Log.e(TAG, "There was an error installing the new audio file for pkg " + mPkgName, e);
            return false;