作者在 2019-05-07 17:29:54 发布以下内容
横空出世,噔噔噔噔~
private boolean isCameraDisabledByDpm() {
final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService(Context.DEVICE_POLICY_SERVICE);
if (dpm != null) {
try {
final int userId = ActivityManagerNative.getDefault().getCurrentUser().id;
final int disabledFlags = dpm.getKeyguardDisabledFeatures(null, userId);
final boolean disabledBecauseKeyguardSecure = (disabledFlags & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0
/* && mCallback.isSecure()*/;
/* && mPhoneStatusBar.isKeyguardSecure() */;
return dpm.getCameraDisabled(null) || disabledBecauseKeyguardSecure;
} catch (RemoteException e) {
Log.e("camera", "Can't get userId", e);
}
}
return false;
}
第二段: