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

Commit 194969aa authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi
Browse files

Relax permission checks in sound trigger middleware

This is a temporary measure to address a bug preventing Now Playing
from working.

Bug: 150750187
Test: Manual
Change-Id: I55f1224ab7301e5cfaff510705d8c7bf21ecfad3
parent 5688bc3e
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -249,21 +249,8 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware
     * @param permission The permission to check.
     */
    void enforcePermission(String permission) {
        final int status = PermissionChecker.checkCallingOrSelfPermissionForPreflight(mContext,
                permission);
        switch (status) {
            case PermissionChecker.PERMISSION_GRANTED:
                return;
            case PermissionChecker.PERMISSION_HARD_DENIED:
                throw new SecurityException(
        mContext.enforceCallingOrSelfPermission(permission,
                String.format("Caller must have the %s permission.", permission));
            case PermissionChecker.PERMISSION_SOFT_DENIED:
                throw new ServiceSpecificException(Status.TEMPORARY_PERMISSION_DENIED,
                        String.format("Caller must have the %s permission.", permission));
            default:
                throw new InternalServerError(
                        new RuntimeException("Unexpected perimission check result."));
        }
    }

    @Override