Loading api/current.txt +1 −3 Original line number Diff line number Diff line Loading @@ -6373,7 +6373,6 @@ package android.content { field public static final java.lang.String ACTION_PROVIDER_CHANGED = "android.intent.action.PROVIDER_CHANGED"; field public static final java.lang.String ACTION_QUICK_CLOCK = "android.intent.action.QUICK_CLOCK"; field public static final java.lang.String ACTION_REBOOT = "android.intent.action.REBOOT"; field public static final java.lang.String ACTION_RESTRICTIONS_PIN_CHALLENGE = "android.intent.action.RESTRICTIONS_PIN_CHALLENGE"; field public static final java.lang.String ACTION_RUN = "android.intent.action.RUN"; field public static final java.lang.String ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF"; field public static final java.lang.String ACTION_SCREEN_ON = "android.intent.action.SCREEN_ON"; Loading Loading @@ -18604,14 +18603,13 @@ package android.os { method public java.lang.String getUserName(); method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasRestrictionsPin(); method public boolean isUserAGoat(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public boolean setRestrictionsChallenge(java.lang.String); method public void setUserRestriction(java.lang.String, boolean); method public void setUserRestrictions(android.os.Bundle); method public void setUserRestrictions(android.os.Bundle, android.os.UserHandle); field public static final java.lang.String DISALLOW_APP_RESTRICTIONS = "no_app_restrictions"; field public static final java.lang.String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth"; field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials"; field public static final java.lang.String DISALLOW_CONFIG_WIFI = "no_config_wifi"; core/java/android/content/Intent.java +7 −4 Original line number Diff line number Diff line Loading @@ -2469,16 +2469,19 @@ public class Intent implements Parcelable, Cloneable { "android.intent.action.GET_RESTRICTION_ENTRIES"; /** * @hide * Activity to challenge the user for a PIN that was configured when setting up * restrictions. Launch the activity using * restrictions. Restrictions include blocking of apps and preventing certain user operations, * controlled by {@link android.os.UserManager#setUserRestrictions(Bundle). * Launch the activity using * {@link android.app.Activity#startActivityForResult(Intent, int)} and check if the * result is {@link android.app.Activity#RESULT_OK} for a successful response to the * challenge.<p/> * Before launching this activity, make sure that there is a PIN in effect, by calling * {@link android.os.UserManager#hasRestrictionsPin()}. * {@link android.os.UserManager#hasRestrictionsChallenge()}. */ public static final String ACTION_RESTRICTIONS_PIN_CHALLENGE = "android.intent.action.RESTRICTIONS_PIN_CHALLENGE"; public static final String ACTION_RESTRICTIONS_CHALLENGE = "android.intent.action.RESTRICTIONS_CHALLENGE"; /** * Sent the first time a user is starting, to allow system apps to Loading core/java/android/os/IUserManager.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ interface IUserManager { int userHandle); Bundle getApplicationRestrictions(in String packageName); Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle); boolean changeRestrictionsPin(in String newPin); int checkRestrictionsPin(in String pin); boolean hasRestrictionsPin(); boolean setRestrictionsChallenge(in String newPin); int checkRestrictionsChallenge(in String pin); boolean hasRestrictionsChallenge(); void removeRestrictions(); } core/java/android/os/UserManager.java +13 −23 Original line number Diff line number Diff line Loading @@ -140,16 +140,6 @@ public class UserManager { */ public static final String DISALLOW_REMOVE_USER = "no_remove_user"; /** * Key for user restrictions. Specifies if a user is disallowed from setting app restrictions * via a restrictions PIN. The default is <code>false</code>. If app restrictions have already * been set up, then this user restriction cannot be set to true. * <p/> * Type: Boolean * @see #hasRestrictionsPin() */ public static final String DISALLOW_APP_RESTRICTIONS = "no_app_restrictions"; /** @hide */ public static final int PIN_VERIFICATION_FAILED_INCORRECT = -3; /** @hide */ Loading Loading @@ -650,15 +640,14 @@ public class UserManager { } /** * @hide * Sets a new restrictions PIN. This should only be called after verifying that there * currently isn't a PIN set, or after the user successfully enters the current PIN. * @param newPin * @return Returns true if the PIN was changed successfully. * Sets a new challenge PIN for restrictions. This is only for use by pre-installed * apps and requires the MANAGE_USERS permission. * @param newPin the PIN to use for challenge dialogs. * @return Returns true if the challenge PIN was set successfully. */ public boolean changeRestrictionsPin(String newPin) { public boolean setRestrictionsChallenge(String newPin) { try { return mService.changeRestrictionsPin(newPin); return mService.setRestrictionsChallenge(newPin); } catch (RemoteException re) { Log.w(TAG, "Could not change restrictions pin"); } Loading @@ -674,9 +663,9 @@ public class UserManager { * Returns {@link #PIN_VERIFICATION_SUCCESS} if the input matches the saved PIN. Returns * {@link #PIN_VERIFICATION_FAILED_NOT_SET} if there is no PIN set. */ public int checkRestrictionsPin(String pin) { public int checkRestrictionsChallenge(String pin) { try { return mService.checkRestrictionsPin(pin); return mService.checkRestrictionsChallenge(pin); } catch (RemoteException re) { Log.w(TAG, "Could not check restrictions pin"); } Loading @@ -684,16 +673,17 @@ public class UserManager { } /** * @hide * Checks whether the user has restrictions that are PIN-protected. An application that * participates in restrictions can check if the owner has requested a PIN challenge for * any restricted operations. If there is a PIN in effect, the application should launch * the PIN challenge activity {@link android.content.Intent#ACTION_RESTRICTIONS_PIN_CHALLENGE}. * @see android.content.Intent#ACTION_RESTRICTIONS_PIN_CHALLENGE * the PIN challenge activity {@link android.content.Intent#ACTION_RESTRICTIONS_CHALLENGE}. * @see android.content.Intent#ACTION_RESTRICTIONS_CHALLENGE * @return whether a restrictions PIN is in effect. */ public boolean hasRestrictionsPin() { public boolean hasRestrictionsChallenge() { try { return mService.hasRestrictionsPin(); return mService.hasRestrictionsChallenge(); } catch (RemoteException re) { Log.w(TAG, "Could not change restrictions pin"); } Loading core/java/com/android/internal/app/RestrictionsPinActivity.java +4 −4 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public class RestrictionsPinActivity extends AlertActivity super.onCreate(icicle); mUserManager = (UserManager) getSystemService(Context.USER_SERVICE); mHasRestrictionsPin = mUserManager.hasRestrictionsPin(); mHasRestrictionsPin = mUserManager.hasRestrictionsChallenge(); initUi(); setupAlert(); } Loading Loading @@ -83,7 +83,7 @@ public class RestrictionsPinActivity extends AlertActivity super.onResume(); setPositiveButtonState(false); boolean hasPin = mUserManager.hasRestrictionsPin(); boolean hasPin = mUserManager.hasRestrictionsChallenge(); if (hasPin) { mPinErrorMessage.setVisibility(View.INVISIBLE); mPinText.setOnEditorActionListener(this); Loading @@ -100,7 +100,7 @@ public class RestrictionsPinActivity extends AlertActivity private boolean updatePinTimer(int pinTimerMs) { if (pinTimerMs < 0) { pinTimerMs = mUserManager.checkRestrictionsPin(null); pinTimerMs = mUserManager.checkRestrictionsChallenge(null); } boolean enableInput; if (pinTimerMs >= 200) { Loading Loading @@ -128,7 +128,7 @@ public class RestrictionsPinActivity extends AlertActivity } protected void performPositiveButtonAction() { int result = mUserManager.checkRestrictionsPin(mPinText.getText().toString()); int result = mUserManager.checkRestrictionsChallenge(mPinText.getText().toString()); if (result == UserManager.PIN_VERIFICATION_SUCCESS) { setResult(RESULT_OK); finish(); Loading Loading
api/current.txt +1 −3 Original line number Diff line number Diff line Loading @@ -6373,7 +6373,6 @@ package android.content { field public static final java.lang.String ACTION_PROVIDER_CHANGED = "android.intent.action.PROVIDER_CHANGED"; field public static final java.lang.String ACTION_QUICK_CLOCK = "android.intent.action.QUICK_CLOCK"; field public static final java.lang.String ACTION_REBOOT = "android.intent.action.REBOOT"; field public static final java.lang.String ACTION_RESTRICTIONS_PIN_CHALLENGE = "android.intent.action.RESTRICTIONS_PIN_CHALLENGE"; field public static final java.lang.String ACTION_RUN = "android.intent.action.RUN"; field public static final java.lang.String ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF"; field public static final java.lang.String ACTION_SCREEN_ON = "android.intent.action.SCREEN_ON"; Loading Loading @@ -18604,14 +18603,13 @@ package android.os { method public java.lang.String getUserName(); method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasRestrictionsPin(); method public boolean isUserAGoat(); method public boolean isUserRunning(android.os.UserHandle); method public boolean isUserRunningOrStopping(android.os.UserHandle); method public boolean setRestrictionsChallenge(java.lang.String); method public void setUserRestriction(java.lang.String, boolean); method public void setUserRestrictions(android.os.Bundle); method public void setUserRestrictions(android.os.Bundle, android.os.UserHandle); field public static final java.lang.String DISALLOW_APP_RESTRICTIONS = "no_app_restrictions"; field public static final java.lang.String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth"; field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials"; field public static final java.lang.String DISALLOW_CONFIG_WIFI = "no_config_wifi";
core/java/android/content/Intent.java +7 −4 Original line number Diff line number Diff line Loading @@ -2469,16 +2469,19 @@ public class Intent implements Parcelable, Cloneable { "android.intent.action.GET_RESTRICTION_ENTRIES"; /** * @hide * Activity to challenge the user for a PIN that was configured when setting up * restrictions. Launch the activity using * restrictions. Restrictions include blocking of apps and preventing certain user operations, * controlled by {@link android.os.UserManager#setUserRestrictions(Bundle). * Launch the activity using * {@link android.app.Activity#startActivityForResult(Intent, int)} and check if the * result is {@link android.app.Activity#RESULT_OK} for a successful response to the * challenge.<p/> * Before launching this activity, make sure that there is a PIN in effect, by calling * {@link android.os.UserManager#hasRestrictionsPin()}. * {@link android.os.UserManager#hasRestrictionsChallenge()}. */ public static final String ACTION_RESTRICTIONS_PIN_CHALLENGE = "android.intent.action.RESTRICTIONS_PIN_CHALLENGE"; public static final String ACTION_RESTRICTIONS_CHALLENGE = "android.intent.action.RESTRICTIONS_CHALLENGE"; /** * Sent the first time a user is starting, to allow system apps to Loading
core/java/android/os/IUserManager.aidl +3 −3 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ interface IUserManager { int userHandle); Bundle getApplicationRestrictions(in String packageName); Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle); boolean changeRestrictionsPin(in String newPin); int checkRestrictionsPin(in String pin); boolean hasRestrictionsPin(); boolean setRestrictionsChallenge(in String newPin); int checkRestrictionsChallenge(in String pin); boolean hasRestrictionsChallenge(); void removeRestrictions(); }
core/java/android/os/UserManager.java +13 −23 Original line number Diff line number Diff line Loading @@ -140,16 +140,6 @@ public class UserManager { */ public static final String DISALLOW_REMOVE_USER = "no_remove_user"; /** * Key for user restrictions. Specifies if a user is disallowed from setting app restrictions * via a restrictions PIN. The default is <code>false</code>. If app restrictions have already * been set up, then this user restriction cannot be set to true. * <p/> * Type: Boolean * @see #hasRestrictionsPin() */ public static final String DISALLOW_APP_RESTRICTIONS = "no_app_restrictions"; /** @hide */ public static final int PIN_VERIFICATION_FAILED_INCORRECT = -3; /** @hide */ Loading Loading @@ -650,15 +640,14 @@ public class UserManager { } /** * @hide * Sets a new restrictions PIN. This should only be called after verifying that there * currently isn't a PIN set, or after the user successfully enters the current PIN. * @param newPin * @return Returns true if the PIN was changed successfully. * Sets a new challenge PIN for restrictions. This is only for use by pre-installed * apps and requires the MANAGE_USERS permission. * @param newPin the PIN to use for challenge dialogs. * @return Returns true if the challenge PIN was set successfully. */ public boolean changeRestrictionsPin(String newPin) { public boolean setRestrictionsChallenge(String newPin) { try { return mService.changeRestrictionsPin(newPin); return mService.setRestrictionsChallenge(newPin); } catch (RemoteException re) { Log.w(TAG, "Could not change restrictions pin"); } Loading @@ -674,9 +663,9 @@ public class UserManager { * Returns {@link #PIN_VERIFICATION_SUCCESS} if the input matches the saved PIN. Returns * {@link #PIN_VERIFICATION_FAILED_NOT_SET} if there is no PIN set. */ public int checkRestrictionsPin(String pin) { public int checkRestrictionsChallenge(String pin) { try { return mService.checkRestrictionsPin(pin); return mService.checkRestrictionsChallenge(pin); } catch (RemoteException re) { Log.w(TAG, "Could not check restrictions pin"); } Loading @@ -684,16 +673,17 @@ public class UserManager { } /** * @hide * Checks whether the user has restrictions that are PIN-protected. An application that * participates in restrictions can check if the owner has requested a PIN challenge for * any restricted operations. If there is a PIN in effect, the application should launch * the PIN challenge activity {@link android.content.Intent#ACTION_RESTRICTIONS_PIN_CHALLENGE}. * @see android.content.Intent#ACTION_RESTRICTIONS_PIN_CHALLENGE * the PIN challenge activity {@link android.content.Intent#ACTION_RESTRICTIONS_CHALLENGE}. * @see android.content.Intent#ACTION_RESTRICTIONS_CHALLENGE * @return whether a restrictions PIN is in effect. */ public boolean hasRestrictionsPin() { public boolean hasRestrictionsChallenge() { try { return mService.hasRestrictionsPin(); return mService.hasRestrictionsChallenge(); } catch (RemoteException re) { Log.w(TAG, "Could not change restrictions pin"); } Loading
core/java/com/android/internal/app/RestrictionsPinActivity.java +4 −4 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public class RestrictionsPinActivity extends AlertActivity super.onCreate(icicle); mUserManager = (UserManager) getSystemService(Context.USER_SERVICE); mHasRestrictionsPin = mUserManager.hasRestrictionsPin(); mHasRestrictionsPin = mUserManager.hasRestrictionsChallenge(); initUi(); setupAlert(); } Loading Loading @@ -83,7 +83,7 @@ public class RestrictionsPinActivity extends AlertActivity super.onResume(); setPositiveButtonState(false); boolean hasPin = mUserManager.hasRestrictionsPin(); boolean hasPin = mUserManager.hasRestrictionsChallenge(); if (hasPin) { mPinErrorMessage.setVisibility(View.INVISIBLE); mPinText.setOnEditorActionListener(this); Loading @@ -100,7 +100,7 @@ public class RestrictionsPinActivity extends AlertActivity private boolean updatePinTimer(int pinTimerMs) { if (pinTimerMs < 0) { pinTimerMs = mUserManager.checkRestrictionsPin(null); pinTimerMs = mUserManager.checkRestrictionsChallenge(null); } boolean enableInput; if (pinTimerMs >= 200) { Loading Loading @@ -128,7 +128,7 @@ public class RestrictionsPinActivity extends AlertActivity } protected void performPositiveButtonAction() { int result = mUserManager.checkRestrictionsPin(mPinText.getText().toString()); int result = mUserManager.checkRestrictionsChallenge(mPinText.getText().toString()); if (result == UserManager.PIN_VERIFICATION_SUCCESS) { setResult(RESULT_OK); finish(); Loading