Merge "CameraServiceProxy: Create utility method for detecting if the camera is disabled by device policy." into tm-dev am: e48afc4089 am: 7b10b3ae7b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17967939 Change-Id: Iccb7ecd711e0634195fd086f7be122405f86de6f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -24,6 +24,7 @@ import android.annotation.Nullable;
|
||||
import android.annotation.TestApi;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.ActivityTaskManager;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.app.compat.CompatChanges;
|
||||
import android.compat.annotation.ChangeId;
|
||||
import android.compat.annotation.Disabled;
|
||||
@@ -576,6 +577,16 @@ public class CameraServiceProxy extends SystemService
|
||||
|
||||
updateActivityCount(cameraState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCameraDisabled() {
|
||||
DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class);
|
||||
if (dpm == null) {
|
||||
Slog.e(TAG, "Failed to get the device policy manager service");
|
||||
return false;
|
||||
}
|
||||
return dpm.getCameraDisabled(null);
|
||||
}
|
||||
};
|
||||
|
||||
private final FoldStateListener mFoldStateListener;
|
||||
|
||||
Reference in New Issue
Block a user