Continuously #checkCanOpenCamera until camera policy has been enforced
Camera restriction policy is set through DevicePolicyManager first and
then this policy will be propagated to UserManagerService immediately.
However, UserManagerService does not send this policy to AppOpsService
immediately, instead, it just post such job to its main thread, so the
restriction cannot be synced down to AppOpsService synchronously, even
though #onOpChanged() will eventually get invoked once the restriction
policy arrives in AppOpsService, due to the delay, camera device could
be opened before AppOpsService receiving the camera restriction policy
from UserManagerService.
This issue does not occur on those Android OS prior to N, since system
property ("sys.secpolicy.camera.off_<userId>") was used to keep camera
restrction policy, CameraService will read it from the property before
opening camera.
Change-Id: I7f0cc412861d616fec0cb61e8b791eff9b4260a8
1 file changed