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

Commit 3c134b58 authored by Felipe Leme's avatar Felipe Leme Committed by Android (Google) Code Review
Browse files

Merge "Expose ACTION_SHOW_NEW_USER_DISCLAIMER and acknowledgeNewUserDisclaimer()"

parents bd4ea64e 1e7e2ece
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -55,6 +55,15 @@ package android.app {

}

package android.app.admin {

  public class DevicePolicyManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void acknowledgeNewUserDisclaimer();
    field public static final String ACTION_SHOW_NEW_USER_DISCLAIMER = "android.app.action.SHOW_NEW_USER_DISCLAIMER";
  }

}

package android.app.usage {

  public class NetworkStatsManager {
+13 −4
Original line number Diff line number Diff line
@@ -3116,11 +3116,19 @@ public class DevicePolicyManager {
        }
    }
    /** @hide */
    public void resetNewUserDisclaimer() {
    /**
     * Acknoledges that the new managed user disclaimer was viewed by the (human) user
     * so that {@link #ACTION_SHOW_NEW_USER_DISCLAIMER broadcast} is not sent again the next time
     * this user is switched to.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public void acknowledgeNewUserDisclaimer() {
        if (mService != null) {
            try {
                mService.resetNewUserDisclaimer();
                mService.acknowledgeNewUserDisclaimer();
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
@@ -5651,9 +5659,10 @@ public class DevicePolicyManager {
     *
     * @hide
     */
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_SHOW_NEW_USER_DISCLAIMER =
            "android.app.action.ACTION_SHOW_NEW_USER_DISCLAIMER";
            "android.app.action.SHOW_NEW_USER_DISCLAIMER";
    /**
     * Widgets are enabled in keyguard
+1 −1
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ interface IDevicePolicyManager {
    int stopUser(in ComponentName who, in UserHandle userHandle);
    int logoutUser(in ComponentName who);
    List<UserHandle> getSecondaryUsers(in ComponentName who);
    void resetNewUserDisclaimer();
    void acknowledgeNewUserDisclaimer();

    void enableSystemApp(in ComponentName admin, in String callerPackage, in String packageName);
    int enableSystemAppWithIntent(in ComponentName admin, in String callerPackage, in Intent intent);
+1 −1
Original line number Diff line number Diff line
@@ -709,7 +709,7 @@
    <protected-broadcast android:name="android.scheduling.action.REBOOT_READY" />
    <protected-broadcast android:name="android.app.action.DEVICE_POLICY_CONSTANTS_CHANGED" />
    <protected-broadcast android:name="android.app.action.SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED" />
    <protected-broadcast android:name="android.app.action.ACTION_SHOW_NEW_USER_DISCLAIMER" />
    <protected-broadcast android:name="android.app.action.SHOW_NEW_USER_DISCLAIMER" />

    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
+1 −1
Original line number Diff line number Diff line
@@ -10701,7 +10701,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
    }
    @Override
    public void resetNewUserDisclaimer() {
    public void acknowledgeNewUserDisclaimer() {
        CallerIdentity callerIdentity = getCallerIdentity();
        canManageUsers(callerIdentity);