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

Commit 7edfb9d1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix permission check" into main

parents 58ec9344 d1937e6d
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -317,6 +317,9 @@ public class MediaQualityService extends SystemService {
                                    : pp.getPackageName(),
                            pp.getInputId(), pp.getParameters());

                    if (DEBUG) {
                        Slog.d(TAG, "insert " + pp.getName() + " to database");
                    }
                    // id is auto-generated by SQLite upon successful insertion of row
                    Long id = db.insert(
                            mMediaQualityDbHelper.PICTURE_QUALITY_TABLE_NAME, null, values);
@@ -484,7 +487,7 @@ public class MediaQualityService extends SystemService {

        private boolean hasPermissionToRemovePictureProfile(PictureProfile toDelete, int uid) {
            if (toDelete != null) {
                return toDelete.getName().equalsIgnoreCase(getPackageOfUid(uid));
                return toDelete.getPackageName().equalsIgnoreCase(getPackageOfUid(uid));
            }
            return false;
        }
@@ -971,7 +974,7 @@ public class MediaQualityService extends SystemService {
            return fromDb.getProfileType() == sp.getProfileType()
                    && fromDb.getPackageName().equals(sp.getPackageName())
                    && fromDb.getName().equals(sp.getName())
                    && fromDb.getName().equals(getPackageOfUid(uid));
                    && fromDb.getPackageName().equals(getPackageOfUid(uid));
        }

        @GuardedBy("mSoundProfileLock")
@@ -1015,7 +1018,7 @@ public class MediaQualityService extends SystemService {

        private boolean hasPermissionToRemoveSoundProfile(SoundProfile toDelete, int uid) {
            if (toDelete != null) {
                return toDelete.getName().equalsIgnoreCase(getPackageOfUid(uid));
                return toDelete.getPackageName().equalsIgnoreCase(getPackageOfUid(uid));
            }
            return false;
        }