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

Commit de8e67bc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check if calling uid is system uid for setAllowedPolicyCapture."

parents b6a1bc58 140a34fb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1518,7 +1518,8 @@ status_t BnAudioPolicyService::onTransact(
        case SET_SUPPORTED_SYSTEM_USAGES:
        case REMOVE_PREFERRED_DEVICE_FOR_PRODUCT_STRATEGY:
        case GET_PREFERRED_DEVICE_FOR_PRODUCT_STRATEGY:
        case GET_DEVICES_FOR_ATTRIBUTES: {
        case GET_DEVICES_FOR_ATTRIBUTES:
        case SET_ALLOWED_CAPTURE_POLICY: {
            if (!isServiceUid(IPCThreadState::self()->getCallingUid())) {
                ALOGW("%s: transaction %d received from PID %d unauthorized UID %d",
                      __func__, code, IPCThreadState::self()->getCallingPid(),
+0 −5
Original line number Diff line number Diff line
@@ -1073,11 +1073,6 @@ status_t AudioPolicyService::setAllowedCapturePolicy(uid_t uid, audio_flags_mask
        ALOGV("%s() mAudioPolicyManager == NULL", __func__);
        return NO_INIT;
    }
    uint_t callingUid = IPCThreadState::self()->getCallingUid();
    if (uid != callingUid) {
        ALOGD("%s() uid invalid %d != %d", __func__, uid, callingUid);
        return PERMISSION_DENIED;
    }
    return mAudioPolicyManager->setAllowedCapturePolicy(uid, capturePolicy);
}