Loading core/java/android/app/admin/DevicePolicyManager.java +16 −13 Original line number Diff line number Diff line Loading @@ -9713,9 +9713,9 @@ public class DevicePolicyManager { * service. When zero or more packages have been added, accessibility services that are not in * the list and not part of the system can not be enabled by the user. * <p> * Calling with a null value for the list disables the restriction so that all services can be * used, calling with an empty list only allows the built-in system services. Any non-system * accessibility service that's currently enabled must be included in the list. * Calling with a {@code null} value for the list disables the restriction so that all services * can be used, calling with an empty list only allows the built-in system services. Any * non-system accessibility service that's currently enabled must be included in the list. * <p> * System accessibility services are always available to the user and this method can't * disable them. Loading @@ -9741,8 +9741,8 @@ public class DevicePolicyManager { /** * Returns the list of permitted accessibility services set by this device or profile owner. * <p> * An empty list means no accessibility services except system services are allowed. Null means * all accessibility services are allowed. * An empty list means no accessibility services except system services are allowed. * {@code null} means all accessibility services are allowed. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @return List of accessiblity service package names. Loading Loading @@ -9787,7 +9787,7 @@ public class DevicePolicyManager { * Returns the list of accessibility services permitted by the device or profiles * owners of this user. * * <p>Null means all accessibility services are allowed, if a non-null list is returned * <p>{@code null} means all accessibility services are allowed, if a non-null list is returned * it will contain the intersection of the permitted lists for any device or profile * owners that apply to this user. It will also include any system accessibility services. * Loading Loading @@ -9933,6 +9933,8 @@ public class DevicePolicyManager { * * @return List of input method package names. * @hide * * @see #setPermittedAccessibilityServices(ComponentName, List) */ @SystemApi @RequiresPermission(anyOf = { Loading @@ -9953,29 +9955,30 @@ public class DevicePolicyManager { /** * Returns the list of input methods permitted. * * <p>When this method returns empty list means all input methods are allowed, if a non-empty * list is returned it will contain the intersection of the permitted lists for any device or * profile owners that apply to this user. It will also include any system input methods. * <p>{@code null} means all input methods are allowed, if a non-null list is returned * it will contain the intersection of the permitted lists for any device or profile * owners that apply to this user. It will also include any system input methods. * * @return List of input method package names. * @hide * * @see #setPermittedAccessibilityServices(ComponentName, List) */ @UserHandleAware @RequiresPermission(allOf = { android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, android.Manifest.permission.MANAGE_USERS }, conditional = true) public @NonNull List<String> getPermittedInputMethods() { public @Nullable List<String> getPermittedInputMethods() { throwIfParentInstance("getPermittedInputMethods"); List<String> result = null; if (mService != null) { try { result = mService.getPermittedInputMethodsAsUser(myUserId()); return mService.getPermittedInputMethodsAsUser(myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return result != null ? result : Collections.emptyList(); return null; } /** Loading packages/SettingsLib/src/com/android/settingslib/inputmethod/InputMethodPreference.java +2 −2 Original line number Diff line number Diff line Loading @@ -221,8 +221,8 @@ public class InputMethodPreference extends PrimarySwitchPreference setSwitchEnabled(false); } else if (!mIsAllowedByOrganization) { EnforcedAdmin admin = RestrictedLockUtilsInternal.checkIfInputMethodDisallowed(getContext(), mImi.getPackageName(), UserHandle.myUserId()); RestrictedLockUtilsInternal.checkIfInputMethodDisallowed( getContext(), mImi.getPackageName(), mUserId); setDisabledByAdmin(admin); } else { setEnabled(true); Loading Loading
core/java/android/app/admin/DevicePolicyManager.java +16 −13 Original line number Diff line number Diff line Loading @@ -9713,9 +9713,9 @@ public class DevicePolicyManager { * service. When zero or more packages have been added, accessibility services that are not in * the list and not part of the system can not be enabled by the user. * <p> * Calling with a null value for the list disables the restriction so that all services can be * used, calling with an empty list only allows the built-in system services. Any non-system * accessibility service that's currently enabled must be included in the list. * Calling with a {@code null} value for the list disables the restriction so that all services * can be used, calling with an empty list only allows the built-in system services. Any * non-system accessibility service that's currently enabled must be included in the list. * <p> * System accessibility services are always available to the user and this method can't * disable them. Loading @@ -9741,8 +9741,8 @@ public class DevicePolicyManager { /** * Returns the list of permitted accessibility services set by this device or profile owner. * <p> * An empty list means no accessibility services except system services are allowed. Null means * all accessibility services are allowed. * An empty list means no accessibility services except system services are allowed. * {@code null} means all accessibility services are allowed. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @return List of accessiblity service package names. Loading Loading @@ -9787,7 +9787,7 @@ public class DevicePolicyManager { * Returns the list of accessibility services permitted by the device or profiles * owners of this user. * * <p>Null means all accessibility services are allowed, if a non-null list is returned * <p>{@code null} means all accessibility services are allowed, if a non-null list is returned * it will contain the intersection of the permitted lists for any device or profile * owners that apply to this user. It will also include any system accessibility services. * Loading Loading @@ -9933,6 +9933,8 @@ public class DevicePolicyManager { * * @return List of input method package names. * @hide * * @see #setPermittedAccessibilityServices(ComponentName, List) */ @SystemApi @RequiresPermission(anyOf = { Loading @@ -9953,29 +9955,30 @@ public class DevicePolicyManager { /** * Returns the list of input methods permitted. * * <p>When this method returns empty list means all input methods are allowed, if a non-empty * list is returned it will contain the intersection of the permitted lists for any device or * profile owners that apply to this user. It will also include any system input methods. * <p>{@code null} means all input methods are allowed, if a non-null list is returned * it will contain the intersection of the permitted lists for any device or profile * owners that apply to this user. It will also include any system input methods. * * @return List of input method package names. * @hide * * @see #setPermittedAccessibilityServices(ComponentName, List) */ @UserHandleAware @RequiresPermission(allOf = { android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, android.Manifest.permission.MANAGE_USERS }, conditional = true) public @NonNull List<String> getPermittedInputMethods() { public @Nullable List<String> getPermittedInputMethods() { throwIfParentInstance("getPermittedInputMethods"); List<String> result = null; if (mService != null) { try { result = mService.getPermittedInputMethodsAsUser(myUserId()); return mService.getPermittedInputMethodsAsUser(myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return result != null ? result : Collections.emptyList(); return null; } /** Loading
packages/SettingsLib/src/com/android/settingslib/inputmethod/InputMethodPreference.java +2 −2 Original line number Diff line number Diff line Loading @@ -221,8 +221,8 @@ public class InputMethodPreference extends PrimarySwitchPreference setSwitchEnabled(false); } else if (!mIsAllowedByOrganization) { EnforcedAdmin admin = RestrictedLockUtilsInternal.checkIfInputMethodDisallowed(getContext(), mImi.getPackageName(), UserHandle.myUserId()); RestrictedLockUtilsInternal.checkIfInputMethodDisallowed( getContext(), mImi.getPackageName(), mUserId); setDisabledByAdmin(admin); } else { setEnabled(true); Loading