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

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

Merge "Do not log permission check failures." into tm-dev

parents cbd886a1 65794463
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2030,7 +2030,9 @@ bool SensorService::hasPermissionForSensor(const Sensor& sensor) {
    // Runtime permissions can't use the cache as they may change.
    if (sensor.isRequiredPermissionRuntime()) {
        hasPermission = checkPermission(String16(requiredPermission),
                IPCThreadState::self()->getCallingPid(), IPCThreadState::self()->getCallingUid());
                IPCThreadState::self()->getCallingPid(),
                IPCThreadState::self()->getCallingUid(),
                /*logPermissionFailure=*/ false);
    } else {
        hasPermission = PermissionCache::checkCallingPermission(String16(requiredPermission));
    }
@@ -2211,7 +2213,8 @@ bool SensorService::isRateCappedBasedOnPermission(const String16& opPackageName)
    int targetSdk = getTargetSdkVersion(opPackageName);
    bool hasSamplingRatePermission = checkPermission(sAccessHighSensorSamplingRatePermission,
            IPCThreadState::self()->getCallingPid(),
            IPCThreadState::self()->getCallingUid());
            IPCThreadState::self()->getCallingUid(),
            /*logPermissionFailure=*/ false);
    if (targetSdk < __ANDROID_API_S__ ||
            (targetSdk >= __ANDROID_API_S__ && hasSamplingRatePermission)) {
        return false;