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

Commit 96095154 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7842835 from 0c6b108f to sc-v2-release

Change-Id: I4bbf8d20f36ab89a3220f8a02ea21b5fde7a3e86
parents f3100ffa 0c6b108f
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -37,8 +37,11 @@ interface ICameraServiceProxy
    oneway void notifyCameraState(in CameraSessionStats cameraSessionStats);
    oneway void notifyCameraState(in CameraSessionStats cameraSessionStats);


    /**
    /**
     * Reports whether the top activity needs a rotate and crop override.
     * Returns the necessary rotate and crop override for the top activity which
     * will be one of ({@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_NONE},
     * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_90},
     * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_180},
     * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_270}).
     */
     */
    boolean isRotateAndCropOverrideNeeded(String packageName, int sensorOrientation,
    int getRotateAndCropOverride(String packageName, int lensFacing);
            int lensFacing);
}
}
+6 −11
Original line number Original line Diff line number Diff line
@@ -1834,10 +1834,9 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
        // Set rotate-and-crop override behavior
        // Set rotate-and-crop override behavior
        if (mOverrideRotateAndCropMode != ANDROID_SCALER_ROTATE_AND_CROP_AUTO) {
        if (mOverrideRotateAndCropMode != ANDROID_SCALER_ROTATE_AND_CROP_AUTO) {
            client->setRotateAndCropOverride(mOverrideRotateAndCropMode);
            client->setRotateAndCropOverride(mOverrideRotateAndCropMode);
        } else if ((effectiveApiLevel == API_2) &&
        } else if (effectiveApiLevel == API_2) {
                CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded(clientPackageName,
            client->setRotateAndCropOverride(CameraServiceProxyWrapper::getRotateAndCropOverride(
                        orientation, facing) ) {
                    clientPackageName, facing));
            client->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_90);
        }
        }


        // Set camera muting behavior
        // Set camera muting behavior
@@ -2218,13 +2217,9 @@ Status CameraService::notifyDisplayConfigurationChange() {
        if (current != nullptr) {
        if (current != nullptr) {
            const auto basicClient = current->getValue();
            const auto basicClient = current->getValue();
            if (basicClient.get() != nullptr && basicClient->canCastToApiClient(API_2)) {
            if (basicClient.get() != nullptr && basicClient->canCastToApiClient(API_2)) {
                if (CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded(
                basicClient->setRotateAndCropOverride(
                            basicClient->getPackageName(), basicClient->getCameraOrientation(),
                        CameraServiceProxyWrapper::getRotateAndCropOverride(
                            basicClient->getCameraFacing())) {
                            basicClient->getPackageName(), basicClient->getCameraFacing()));
                    basicClient->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_90);
                } else {
                    basicClient->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_NONE);
                }
            }
            }
        }
        }
    }
    }
+1 −0
Original line number Original line Diff line number Diff line
@@ -1631,6 +1631,7 @@ status_t CameraProviderManager::ProviderInfo::addDevice(const std::string& name,
        case 3:
        case 3:
            deviceInfo = initializeDeviceInfo<DeviceInfo3>(name, mProviderTagid,
            deviceInfo = initializeDeviceInfo<DeviceInfo3>(name, mProviderTagid,
                    id, minor);
                    id, minor);
            deviceInfo->notifyDeviceStateChange(mDeviceState);
            break;
            break;
        default:
        default:
            ALOGE("%s: Device %s: Unknown HIDL device HAL major version %d:", __FUNCTION__,
            ALOGE("%s: Device %s: Unknown HIDL device HAL major version %d:", __FUNCTION__,
+3 −5
Original line number Original line Diff line number Diff line
@@ -120,13 +120,11 @@ void CameraServiceProxyWrapper::pingCameraServiceProxy() {
    proxyBinder->pingForUserUpdate();
    proxyBinder->pingForUserUpdate();
}
}


bool CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded(
int CameraServiceProxyWrapper::getRotateAndCropOverride(String16 packageName, int lensFacing) {
        String16 packageName, int sensorOrientation, int lensFacing) {
    sp<ICameraServiceProxy> proxyBinder = getCameraServiceProxy();
    sp<ICameraServiceProxy> proxyBinder = getCameraServiceProxy();
    if (proxyBinder == nullptr) return true;
    if (proxyBinder == nullptr) return true;
    bool ret = true;
    int ret = 0;
    auto status = proxyBinder->isRotateAndCropOverrideNeeded(packageName, sensorOrientation,
    auto status = proxyBinder->getRotateAndCropOverride(packageName, lensFacing, &ret);
            lensFacing, &ret);
    if (!status.isOk()) {
    if (!status.isOk()) {
        ALOGE("%s: Failed during top activity orientation query: %s", __FUNCTION__,
        ALOGE("%s: Failed during top activity orientation query: %s", __FUNCTION__,
                status.exceptionMessage().c_str());
                status.exceptionMessage().c_str());
+2 −3
Original line number Original line Diff line number Diff line
@@ -91,9 +91,8 @@ public:
    // Ping camera service proxy for user update
    // Ping camera service proxy for user update
    static void pingCameraServiceProxy();
    static void pingCameraServiceProxy();


    // Check whether the current top activity needs a rotate and crop override.
    // Return the current top activity rotate and crop override.
    static bool isRotateAndCropOverrideNeeded(String16 packageName, int sensorOrientation,
    static int getRotateAndCropOverride(String16 packageName, int lensFacing);
            int lensFacing);
};
};


} // android
} // android