Permission Check For DPM Get IME API
Require the caller of DPM.getPermittedInputMethodsForCurrentUser() to hold the MANAGE_USERS permission. The only callers should be settings apps which already hold this permission. Bug: 62343414 Test: Manage IME list in the Settings app Test: com.google.android.gts.devicepolicy.DeviceOwnerTest#testPermitInputMethods Change-Id: I0d162f8f51d16e403a950ee5d942502c2cf20181
This commit is contained in:
@@ -6340,6 +6340,7 @@ public class DevicePolicyManager {
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@RequiresPermission(android.Manifest.permission.MANAGE_USERS)
|
||||
public @Nullable List<String> getPermittedInputMethodsForCurrentUser() {
|
||||
throwIfParentInstance("getPermittedInputMethodsForCurrentUser");
|
||||
if (mService != null) {
|
||||
|
||||
@@ -8738,6 +8738,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
||||
|
||||
@Override
|
||||
public List getPermittedInputMethodsForCurrentUser() {
|
||||
enforceManageUsers();
|
||||
UserInfo currentUser;
|
||||
try {
|
||||
currentUser = mInjector.getIActivityManager().getCurrentUser();
|
||||
|
||||
Reference in New Issue
Block a user