Merge "CameraServiceProxy: Create utility method for detecting if the camera is disabled by device policy." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e48afc4089
@@ -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