Skip to content

Update CameraService.cpp #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: twelve-L
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions services/camera/libcameraservice/CameraService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include <android-base/macros.h>
#include <android-base/parseint.h>
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <binder/ActivityManager.h>
#include <binder/AppOpsManager.h>
Expand Down Expand Up @@ -84,6 +85,7 @@ namespace {
namespace android {

using base::StringPrintf;
using base::SetProperty;
using binder::Status;
using camera3::SessionConfigurationUtils;
using frameworks::cameraservice::service::V2_0::implementation::HidlCameraService;
Expand Down Expand Up @@ -3184,6 +3186,16 @@ status_t CameraService::BasicClient::startCameraOps() {
}

mOpsActive = true;


// Configure miui camera mode
if (strcmp(String8(mClientPackageName).string(), "com.android.camera") == 0) {
SetProperty("sys.camera.miui.apk", "1");
ALOGI("Enabling miui camera mode");
} else {
SetProperty("sys.camera.miui.apk", "0");
ALOGI("Disabling miui camera mode");
}

// Transition device availability listeners from PRESENT -> NOT_AVAILABLE
sCameraService->updateStatus(StatusInternal::NOT_AVAILABLE, mCameraIdStr);
Expand Down