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

Commit ad03b242 authored by Hamza's avatar Hamza
Browse files

Allow access to isCurrentInputMethodSetByOwner to a caller with QUERY_ADMIN_POLICY permission

Fixes: N/A

Test: N/A

Change-Id: I7208267a81bbbeae7833cb2c38150bca87c661f6
parent 6d637b01
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
@@ -19500,8 +19500,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;
    }