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

Commit 1a8e3654 authored by Haofan Wang's avatar Haofan Wang
Browse files

Fix unknown id send into the HAL

Bug: 427656481
Flag: EXEMPT bugfix
Test: m
Change-Id: I44fe722aebeeb561a83f6f50c79ac71690b66ae3
parent 94786537
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -699,12 +699,6 @@ public class MediaQualityService extends SystemService {

        public long getPictureProfileForTvInput(String inputId, int userId) {
            // TODO: cache profiles
            int callingUid = Binder.getCallingUid();
            int callingPid = Binder.getCallingPid();
            if (!hasGlobalPictureQualityServicePermission(callingUid, callingPid)) {
                mMqManagerNotifier.notifyOnPictureProfileError(
                        null, PictureProfile.ERROR_NO_PERMISSION, callingUid, callingPid);
            }
            String[] columns = {BaseParameters.PARAMETER_ID};
            String selection = BaseParameters.PARAMETER_TYPE + " = ? AND ("
                    + BaseParameters.PARAMETER_NAME + " = ? OR "
@@ -734,12 +728,14 @@ public class MediaQualityService extends SystemService {
                    handle = p.getHandle().getId();
                    PictureProfile current = getCurrentPictureProfile(handle);
                    if (current != null) {
                        long currentHandle = current.getHandle().getId();
                        mHalNotifier.notifyHalOnPictureProfileChange(
                                currentHandle, current.getParameters());
                        return currentHandle;
                        if (DEBUG) {
                            Slog.d(TAG, "handle returned is " + current.getHandle().getId());
                        }
                        return current.getHandle().getId();
                    }
                    if (DEBUG) {
                        Slog.d(TAG, "handle returned is " + handle);
                    }
                    mHalNotifier.notifyHalOnPictureProfileChange(handle, p.getParameters());
                    return handle;
                }
            }
@@ -2669,7 +2665,7 @@ public class MediaQualityService extends SystemService {

    private void putCurrentPictureProfile(Long originalHandle, Long currentHandle) {
        mOriginalToCurrent.put(originalHandle, currentHandle);
        mCurrentPictureHandleToOriginal.removeValue(currentHandle);
        mCurrentPictureHandleToOriginal.removeValue(originalHandle);
        mCurrentPictureHandleToOriginal.put(currentHandle, originalHandle);
    }
}