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

Commit e87602a2 authored by Preethi Kandhalu's avatar Preethi Kandhalu
Browse files

[MediaQuality BugFix] getSoundProfile API

Test: m
Flag: android.media.tv.flags.media_quality_fw

Change-Id: I51d04d339a192f23fcdf0226a71a28c3fffa1608
parent f8c28f29
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -373,14 +373,14 @@ public class MediaQualityService extends SystemService {
        }
        }


        @Override
        @Override
        public SoundProfile getSoundProfile(int type, String id, Bundle options,
        public SoundProfile getSoundProfile(int type, String name, Bundle options,
                UserHandle user) {
                UserHandle user) {
            boolean includeParams =
            boolean includeParams =
                    options.getBoolean(MediaQualityManager.OPTION_INCLUDE_PARAMETERS, false);
                    options.getBoolean(MediaQualityManager.OPTION_INCLUDE_PARAMETERS, false);
            String selection = BaseParameters.PARAMETER_TYPE + " = ? AND "
            String selection = BaseParameters.PARAMETER_TYPE + " = ? AND "
                    + BaseParameters.PARAMETER_ID + " = ? AND "
                    + BaseParameters.PARAMETER_NAME + " = ? AND "
                    + BaseParameters.PARAMETER_PACKAGE + " = ?";
                    + BaseParameters.PARAMETER_PACKAGE + " = ?";
            String[] selectionArguments = {String.valueOf(type), id, getPackageOfCallingUid()};
            String[] selectionArguments = {String.valueOf(type), name, getPackageOfCallingUid()};


            try (
            try (
                    Cursor cursor = getCursorAfterQuerying(
                    Cursor cursor = getCursorAfterQuerying(
@@ -393,7 +393,7 @@ public class MediaQualityService extends SystemService {
                }
                }
                if (count > 1) {
                if (count > 1) {
                    Log.wtf(TAG, String.format(Locale.US, "%d entries found for id=%s"
                    Log.wtf(TAG, String.format(Locale.US, "%d entries found for id=%s"
                                    + " in %s. Should only ever be 0 or 1.", count, id,
                                    + " in %s. Should only ever be 0 or 1.", count, name,
                            mMediaQualityDbHelper.SOUND_QUALITY_TABLE_NAME));
                            mMediaQualityDbHelper.SOUND_QUALITY_TABLE_NAME));
                    return null;
                    return null;
                }
                }