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

Commit bf913163 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "Camera: Change error for app ops reject, propagate binder errors" into mnc-dev

parents 23b6ee36 e3afb2cc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -97,7 +97,8 @@ status_t Camera::connectLegacy(int cameraId, int halVersion,
        c->mStatus = NO_ERROR;
        camera = c;
    } else {
        ALOGW("An error occurred while connecting to camera: %d", cameraId);
        ALOGW("An error occurred while connecting to camera %d: %d (%s)",
                cameraId, status, strerror(-status));
        c.clear();
    }
    return status;
+15 −6
Original line number Diff line number Diff line
@@ -175,10 +175,13 @@ public:
        data.writeInt32(cameraId);
        data.writeString16(clientPackageName);
        data.writeInt32(clientUid);
        remote()->transact(BnCameraService::CONNECT, data, &reply);

        status_t status;
        status = remote()->transact(BnCameraService::CONNECT, data, &reply);
        if (status != OK) return status;

        if (readExceptionCode(reply)) return -EPROTO;
        status_t status = reply.readInt32();
        status = reply.readInt32();
        if (reply.readInt32() != 0) {
            device = interface_cast<ICamera>(reply.readStrongBinder());
        }
@@ -198,10 +201,13 @@ public:
        data.writeInt32(halVersion);
        data.writeString16(clientPackageName);
        data.writeInt32(clientUid);
        remote()->transact(BnCameraService::CONNECT_LEGACY, data, &reply);

        status_t status;
        status = remote()->transact(BnCameraService::CONNECT_LEGACY, data, &reply);
        if (status != OK) return status;

        if (readExceptionCode(reply)) return -EPROTO;
        status_t status = reply.readInt32();
        status = reply.readInt32();
        if (reply.readInt32() != 0) {
            device = interface_cast<ICamera>(reply.readStrongBinder());
        }
@@ -237,10 +243,13 @@ public:
        data.writeInt32(cameraId);
        data.writeString16(clientPackageName);
        data.writeInt32(clientUid);
        remote()->transact(BnCameraService::CONNECT_DEVICE, data, &reply);

        status_t status;
        status = remote()->transact(BnCameraService::CONNECT_DEVICE, data, &reply);
        if (status != OK) return status;

        if (readExceptionCode(reply)) return -EPROTO;
        status_t status = reply.readInt32();
        status = reply.readInt32();
        if (reply.readInt32() != 0) {
            device = interface_cast<ICameraDeviceUser>(reply.readStrongBinder());
        }
+2 −1
Original line number Diff line number Diff line
@@ -1864,7 +1864,8 @@ status_t CameraService::BasicClient::startCameraOps() {
    if (res == AppOpsManager::MODE_IGNORED) {
        ALOGI("Camera %d: Access for \"%s\" has been restricted",
                mCameraId, String8(mClientPackageName).string());
        return INVALID_OPERATION;
        // Return the same error as for device policy manager rejection
        return -EACCES;
    }

    mOpsActive = true;