Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +3 −4 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ import android.annotation.UiThread; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityManagerInternal; import android.app.KeyguardManager; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; Loading Loading @@ -337,7 +336,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub // Ongoing notification private NotificationManager mNotificationManager; KeyguardManager mKeyguardManager; @Nullable private StatusBarManagerInternal mStatusBarManagerInternal; private final Notification.Builder mImeSwitcherNotification; private final PendingIntent mImeSwitchPendingIntent; Loading Loading @@ -1941,7 +1939,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final int currentUserId = mSettings.getCurrentUserId(); mSettings.switchCurrentUser(currentUserId, !mUserManagerInternal.isUserUnlockingOrUnlocked(currentUserId)); mKeyguardManager = mContext.getSystemService(KeyguardManager.class); mNotificationManager = mContext.getSystemService(NotificationManager.class); mStatusBarManagerInternal = LocalServices.getService(StatusBarManagerInternal.class); Loading Loading @@ -3005,7 +3002,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (!mShowOngoingImeSwitcherForPhones) return false; if (mMenuController.getSwitchingDialogLocked() != null) return false; if (mWindowManagerInternal.isKeyguardShowingAndNotOccluded() && mKeyguardManager != null && mKeyguardManager.isKeyguardSecure()) return false; && mWindowManagerInternal.isKeyguardSecure(mSettings.getCurrentUserId())) { return false; } if ((visibility & InputMethodService.IME_ACTIVE) == 0 || (visibility & InputMethodService.IME_INVISIBLE) != 0) { return false; Loading services/core/java/com/android/server/inputmethod/InputMethodMenuController.java +2 −5 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static com.android.server.inputmethod.InputMethodUtils.NOT_A_SUBTYPE_ID; import android.annotation.Nullable; import android.app.AlertDialog; import android.app.KeyguardManager; import android.content.Context; import android.content.DialogInterface; import android.content.res.TypedArray; Loading Loading @@ -56,7 +55,6 @@ final class InputMethodMenuController { private final InputMethodUtils.InputMethodSettings mSettings; private final InputMethodSubtypeSwitchingController mSwitchingController; private final ArrayMap<String, InputMethodInfo> mMethodMap; private final KeyguardManager mKeyguardManager; private final WindowManagerInternal mWindowManagerInternal; private AlertDialog.Builder mDialogBuilder; Loading @@ -76,7 +74,6 @@ final class InputMethodMenuController { mSettings = mService.mSettings; mSwitchingController = mService.mSwitchingController; mMethodMap = mService.mMethodMap; mKeyguardManager = mService.mKeyguardManager; mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class); } Loading Loading @@ -209,8 +206,8 @@ final class InputMethodMenuController { } private boolean isScreenLocked() { return mKeyguardManager != null && mKeyguardManager.isKeyguardLocked() && mKeyguardManager.isKeyguardSecure(); return mWindowManagerInternal.isKeyguardLocked() && mWindowManagerInternal.isKeyguardSecure(mSettings.getCurrentUserId()); } void updateKeyboardFromSettingsLocked() { Loading services/core/java/com/android/server/wm/WindowManagerInternal.java +10 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.SOURCE; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.content.ClipData; import android.content.Context; import android.graphics.Matrix; Loading Loading @@ -451,6 +452,15 @@ public abstract class WindowManagerInternal { */ public abstract boolean isKeyguardShowingAndNotOccluded(); /** * Return whether the keyguard is secured by a PIN, pattern or password or a SIM card is * currently locked. * * @param userId User ID to be queried about. * @return {@code true} if a PIN, pattern or password is set or a SIM card is locked. */ public abstract boolean isKeyguardSecure(@UserIdInt int userId); /** * Gets the frame of a window given its token. * Loading services/core/java/com/android/server/wm/WindowManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -7762,6 +7762,11 @@ public class WindowManagerService extends IWindowManager.Stub return WindowManagerService.this.isKeyguardShowingAndNotOccluded(); } @Override public boolean isKeyguardSecure(@UserIdInt int userId) { return mPolicy.isKeyguardSecure(userId); } @Override public void showGlobalActions() { WindowManagerService.this.showGlobalActions(); Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +3 −4 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ import android.annotation.UiThread; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityManagerInternal; import android.app.KeyguardManager; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; Loading Loading @@ -337,7 +336,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub // Ongoing notification private NotificationManager mNotificationManager; KeyguardManager mKeyguardManager; @Nullable private StatusBarManagerInternal mStatusBarManagerInternal; private final Notification.Builder mImeSwitcherNotification; private final PendingIntent mImeSwitchPendingIntent; Loading Loading @@ -1941,7 +1939,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final int currentUserId = mSettings.getCurrentUserId(); mSettings.switchCurrentUser(currentUserId, !mUserManagerInternal.isUserUnlockingOrUnlocked(currentUserId)); mKeyguardManager = mContext.getSystemService(KeyguardManager.class); mNotificationManager = mContext.getSystemService(NotificationManager.class); mStatusBarManagerInternal = LocalServices.getService(StatusBarManagerInternal.class); Loading Loading @@ -3005,7 +3002,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (!mShowOngoingImeSwitcherForPhones) return false; if (mMenuController.getSwitchingDialogLocked() != null) return false; if (mWindowManagerInternal.isKeyguardShowingAndNotOccluded() && mKeyguardManager != null && mKeyguardManager.isKeyguardSecure()) return false; && mWindowManagerInternal.isKeyguardSecure(mSettings.getCurrentUserId())) { return false; } if ((visibility & InputMethodService.IME_ACTIVE) == 0 || (visibility & InputMethodService.IME_INVISIBLE) != 0) { return false; Loading
services/core/java/com/android/server/inputmethod/InputMethodMenuController.java +2 −5 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static com.android.server.inputmethod.InputMethodUtils.NOT_A_SUBTYPE_ID; import android.annotation.Nullable; import android.app.AlertDialog; import android.app.KeyguardManager; import android.content.Context; import android.content.DialogInterface; import android.content.res.TypedArray; Loading Loading @@ -56,7 +55,6 @@ final class InputMethodMenuController { private final InputMethodUtils.InputMethodSettings mSettings; private final InputMethodSubtypeSwitchingController mSwitchingController; private final ArrayMap<String, InputMethodInfo> mMethodMap; private final KeyguardManager mKeyguardManager; private final WindowManagerInternal mWindowManagerInternal; private AlertDialog.Builder mDialogBuilder; Loading @@ -76,7 +74,6 @@ final class InputMethodMenuController { mSettings = mService.mSettings; mSwitchingController = mService.mSwitchingController; mMethodMap = mService.mMethodMap; mKeyguardManager = mService.mKeyguardManager; mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class); } Loading Loading @@ -209,8 +206,8 @@ final class InputMethodMenuController { } private boolean isScreenLocked() { return mKeyguardManager != null && mKeyguardManager.isKeyguardLocked() && mKeyguardManager.isKeyguardSecure(); return mWindowManagerInternal.isKeyguardLocked() && mWindowManagerInternal.isKeyguardSecure(mSettings.getCurrentUserId()); } void updateKeyboardFromSettingsLocked() { Loading
services/core/java/com/android/server/wm/WindowManagerInternal.java +10 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.SOURCE; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.content.ClipData; import android.content.Context; import android.graphics.Matrix; Loading Loading @@ -451,6 +452,15 @@ public abstract class WindowManagerInternal { */ public abstract boolean isKeyguardShowingAndNotOccluded(); /** * Return whether the keyguard is secured by a PIN, pattern or password or a SIM card is * currently locked. * * @param userId User ID to be queried about. * @return {@code true} if a PIN, pattern or password is set or a SIM card is locked. */ public abstract boolean isKeyguardSecure(@UserIdInt int userId); /** * Gets the frame of a window given its token. * Loading
services/core/java/com/android/server/wm/WindowManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -7762,6 +7762,11 @@ public class WindowManagerService extends IWindowManager.Stub return WindowManagerService.this.isKeyguardShowingAndNotOccluded(); } @Override public boolean isKeyguardSecure(@UserIdInt int userId) { return mPolicy.isKeyguardSecure(userId); } @Override public void showGlobalActions() { WindowManagerService.this.showGlobalActions(); Loading