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

Commit ab113ac8 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "audio: add command to purge permission cache" into sc-dev

parents f889c435 269acb4c
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -211,10 +211,7 @@ bool captureHotwordAllowed(const Identity& identity) {

    if (ok) {
        static const String16 sCaptureHotwordAllowed("android.permission.CAPTURE_AUDIO_HOTWORD");
        //TODO: b/185972521: see if permission cache can be used with shell identity for CTS
        PermissionController permissionController;
        ok = permissionController.checkPermission(sCaptureHotwordAllowed,
            pid, uid);
        ok = PermissionCache::checkPermission(sCaptureHotwordAllowed, pid, uid);
    }
    if (!ok) ALOGV("android.permission.CAPTURE_AUDIO_HOTWORD");
    return ok;
@@ -300,6 +297,10 @@ Identity getCallingIdentity() {
  return identity;
}

void purgePermissionCache() {
    PermissionCache::purgeCache();
}

status_t checkIMemory(const sp<IMemory>& iMemory)
{
    if (iMemory == 0) {
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ bool modifyDefaultAudioEffectsAllowed(const media::permission::Identity& identit
bool dumpAllowed();
bool modifyPhoneStateAllowed(const media::permission::Identity& identity);
bool bypassInterruptionPolicyAllowed(const media::permission::Identity& identity);
void purgePermissionCache();

media::permission::Identity getCallingIdentity();

+3 −0
Original line number Diff line number Diff line
@@ -1019,6 +1019,9 @@ status_t AudioPolicyService::shellCommand(int in, int out, int err, Vector<Strin
        return handleResetUidState(args, err);
    } else if (args.size() >= 2 && args[0] == String16("get-uid-state")) {
        return handleGetUidState(args, out, err);
    } else if (args.size() >= 1 && args[0] == String16("purge_permission-cache")) {
        purgePermissionCache();
        return NO_ERROR;
    } else if (args.size() == 1 && args[0] == String16("help")) {
        printHelp(out);
        return NO_ERROR;