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

Commit a39b5ff0 authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android Git Automerger
Browse files

am 8bc22f52: am 85dbc345: am 4f434a04: Merge "Remove restrictions PIN functionality" into mnc-dev

* commit '8bc22f52':
  Remove restrictions PIN functionality
parents 853676dd 8bc22f52
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23635,7 +23635,7 @@ package android.os {
    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 deprecated boolean setRestrictionsChallenge(java.lang.String);
    method public deprecated void setUserRestriction(java.lang.String, boolean);
    method public deprecated void setUserRestrictions(android.os.Bundle);
    method public deprecated void setUserRestrictions(android.os.Bundle, android.os.UserHandle);
+1 −1
Original line number Diff line number Diff line
@@ -25546,7 +25546,7 @@ package android.os {
    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 deprecated boolean setRestrictionsChallenge(java.lang.String);
    method public deprecated void setUserRestriction(java.lang.String, boolean);
    method public deprecated void setUserRestrictions(android.os.Bundle);
    method public deprecated void setUserRestrictions(android.os.Bundle, android.os.UserHandle);
+0 −15
Original line number Diff line number Diff line
@@ -2588,21 +2588,6 @@ public class Intent implements Parcelable, Cloneable {
    public static final String ACTION_GET_RESTRICTION_ENTRIES =
            "android.intent.action.GET_RESTRICTION_ENTRIES";

    /**
     * @hide
     * Activity to challenge the user for a PIN that was configured when setting up
     * 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#hasRestrictionsChallenge()}.
     */
    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
     * perform one time initialization.  (This will not be seen by third
+0 −3
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@ interface IUserManager {
            int userHandle);
    Bundle getApplicationRestrictions(in String packageName);
    Bundle getApplicationRestrictionsForUser(in String packageName, int userHandle);
    boolean setRestrictionsChallenge(in String newPin);
    int checkRestrictionsChallenge(in String pin);
    boolean hasRestrictionsChallenge();
    void removeRestrictions();
    void setDefaultGuestRestrictions(in Bundle restrictions);
    Bundle getDefaultGuestRestrictions();
+3 −42
Original line number Diff line number Diff line
@@ -1252,49 +1252,10 @@ public class UserManager {
     * 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.
     * @deprecated The restrictions PIN functionality is no longer provided by the system.
     * This method is preserved for backwards compatibility reasons and always returns false.
     */
    public boolean setRestrictionsChallenge(String newPin) {
        try {
            return mService.setRestrictionsChallenge(newPin);
        } catch (RemoteException re) {
            Log.w(TAG, "Could not change restrictions pin");
        }
        return false;
    }

    /**
     * @hide
     * @param pin The PIN to verify, or null to get the number of milliseconds to wait for before
     * allowing the user to enter the PIN.
     * @return Returns a positive number (including zero) for how many milliseconds before
     * you can accept another PIN, when the input is null or the input doesn't match the saved PIN.
     * 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 checkRestrictionsChallenge(String pin) {
        try {
            return mService.checkRestrictionsChallenge(pin);
        } catch (RemoteException re) {
            Log.w(TAG, "Could not check restrictions pin");
        }
        return PIN_VERIFICATION_FAILED_INCORRECT;
    }

    /**
     * @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_CHALLENGE}.
     * @see android.content.Intent#ACTION_RESTRICTIONS_CHALLENGE
     * @return whether a restrictions PIN is in effect.
     */
    public boolean hasRestrictionsChallenge() {
        try {
            return mService.hasRestrictionsChallenge();
        } catch (RemoteException re) {
            Log.w(TAG, "Could not change restrictions pin");
        }
        return false;
    }

Loading