Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4490,6 +4490,7 @@ package android.app { public class KeyguardManager { method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public android.content.Intent getConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence); method public boolean inKeyguardRestrictedInputMode(); method public boolean isKeyguardLocked(); method public boolean isKeyguardSecure(); core/java/android/app/KeyguardManager.java +43 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.app; import android.content.Intent; import android.os.Binder; import android.os.RemoteException; import android.os.IBinder; Loading @@ -33,6 +34,45 @@ import android.view.WindowManagerGlobal; public class KeyguardManager { private IWindowManager mWM; /** * Intent used to prompt user for device credentials. * @hide */ public static final String ACTION_CONFIRM_DEVICE_CREDENTIAL = "android.app.action.CONFIRM_DEVICE_CREDENTIAL"; /** * A CharSequence dialog title to show to the user when used with a * {@link #ACTION_CONFIRM_DEVICE_CREDENTIAL}. * @hide */ public static final String EXTRA_TITLE = "android.app.extra.TITLE"; /** * A CharSequence description to show to the user when used with * {@link #ACTION_CONFIRM_DEVICE_CREDENTIAL}. * @hide */ public static final String EXTRA_DESCRIPTION = "android.app.extra.DESCRIPTION"; /** * Get an intent to prompt the user to confirm credentials (pin, pattern or password) * for the current user of the device. The caller is expected to launch this activity using * {@link android.app.Activity#startActivityForResult(Intent, int)} and check for * {@link android.app.Activity#RESULT_OK} if the user successfully completes the challenge. * * @return the intent for launching the activity or null if no password is required. **/ public Intent getConfirmDeviceCredentialIntent(CharSequence title, CharSequence description) { if (!isKeyguardSecure()) return null; Intent intent = new Intent(ACTION_CONFIRM_DEVICE_CREDENTIAL); intent.putExtra(EXTRA_TITLE, title); intent.putExtra(EXTRA_DESCRIPTION, description); // For security reasons, only allow this to come from system settings. intent.setPackage("com.android.settings"); return intent; } /** * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD} * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4490,6 +4490,7 @@ package android.app { public class KeyguardManager { method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public android.content.Intent getConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence); method public boolean inKeyguardRestrictedInputMode(); method public boolean isKeyguardLocked(); method public boolean isKeyguardSecure();
core/java/android/app/KeyguardManager.java +43 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.app; import android.content.Intent; import android.os.Binder; import android.os.RemoteException; import android.os.IBinder; Loading @@ -33,6 +34,45 @@ import android.view.WindowManagerGlobal; public class KeyguardManager { private IWindowManager mWM; /** * Intent used to prompt user for device credentials. * @hide */ public static final String ACTION_CONFIRM_DEVICE_CREDENTIAL = "android.app.action.CONFIRM_DEVICE_CREDENTIAL"; /** * A CharSequence dialog title to show to the user when used with a * {@link #ACTION_CONFIRM_DEVICE_CREDENTIAL}. * @hide */ public static final String EXTRA_TITLE = "android.app.extra.TITLE"; /** * A CharSequence description to show to the user when used with * {@link #ACTION_CONFIRM_DEVICE_CREDENTIAL}. * @hide */ public static final String EXTRA_DESCRIPTION = "android.app.extra.DESCRIPTION"; /** * Get an intent to prompt the user to confirm credentials (pin, pattern or password) * for the current user of the device. The caller is expected to launch this activity using * {@link android.app.Activity#startActivityForResult(Intent, int)} and check for * {@link android.app.Activity#RESULT_OK} if the user successfully completes the challenge. * * @return the intent for launching the activity or null if no password is required. **/ public Intent getConfirmDeviceCredentialIntent(CharSequence title, CharSequence description) { if (!isKeyguardSecure()) return null; Intent intent = new Intent(ACTION_CONFIRM_DEVICE_CREDENTIAL); intent.putExtra(EXTRA_TITLE, title); intent.putExtra(EXTRA_DESCRIPTION, description); // For security reasons, only allow this to come from system settings. intent.setPackage("com.android.settings"); return intent; } /** * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD} * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} Loading