Disable the mic/cam toggles when admin disallows

Test: Use test DPC app
Bug: 184927615
Change-Id: Ib3825967b2e7ddb6d4768abbc2e17fd39b936371
This commit is contained in:
Evan Severson
2021-06-23 21:44:21 -07:00
parent 150ed0b071
commit 2a5dd0e2ad
4 changed files with 29 additions and 2 deletions

View File

@@ -16,6 +16,8 @@
package com.android.settings.privacy;
import static android.os.UserManager.DISALLOW_CAMERA_TOGGLE;
import static com.android.settings.utils.SensorPrivacyManagerHelper.CAMERA;
import android.content.Context;
@@ -40,4 +42,9 @@ public class CameraToggleController extends SensorToggleController {
&& DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY, "camera_toggle_enabled",
true) ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
}
@Override
protected String getRestriction() {
return DISALLOW_CAMERA_TOGGLE;
}
}