Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c91177c2 authored by Jonathan Scott's avatar Jonathan Scott Committed by Android (Google) Code Review
Browse files

Merge "Allow access to isCurrentInputMethodSetByOwner to a caller with...

Merge "Allow access to isCurrentInputMethodSetByOwner to a caller with QUERY_ADMIN_POLICY permission"
parents c743c46c ad03b242
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -14787,12 +14787,12 @@ public class DevicePolicyManager {
    }
    /**
     * Called by the system to find out whether the current user's IME was set by the device/profile
     * owner or the user.
     * Returns true if the current user's IME was set by an admin.
     *
     * @return {@code true} if the user's IME was set by the device or profile owner, {@code false}
     *         otherwise.
     * @throws SecurityException if the caller is not the device owner/profile owner.
     * <p>Requires the caller to be the system server, a device owner or profile owner, or a holder
     * of the QUERY_ADMIN_POLICY permission.
     *
     * @throws SecurityException if the caller is not authorized
     *
     * @hide
     */
+3 −2
Original line number Diff line number Diff line
@@ -19507,8 +19507,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    public boolean isCurrentInputMethodSetByOwner() {
        final CallerIdentity caller = getCallerIdentity();
        Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)
                || isProfileOwner(caller) || isSystemUid(caller),
                "Only profile owner, device owner and system may call this method.");
                || isProfileOwner(caller) || canQueryAdminPolicy(caller) || isSystemUid(caller),
                "Only profile owner, device owner, a caller with QUERY_ADMIN_POLICY "
                        + "permission or system may call this method.");
        return getUserData(caller.getUserId()).mCurrentInputMethodSet;
    }