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

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

am 220eef4a: Merge "Disable multi-user background recording" into mnc-dev

* commit '220eef4a':
  Disable multi-user background recording
parents 60769445 220eef4a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.app;

import android.annotation.NonNull;
import android.content.ComponentName;

/**
 * Activity manager local system service interface.
@@ -48,4 +49,10 @@ public abstract class ActivityManagerInternal {
         */
        public abstract void release();
    }

    /**
     * Returns home activity for the specified user.
     * @param userId ID of the user or {@link android.os.UserHandle#USER_ALL}
     */
    public abstract ComponentName getHomeActivityForUser(int userId);
}
+1 −1
Original line number Diff line number Diff line
@@ -606,7 +606,7 @@ public class AppOpsManager {
            UserManager.DISALLOW_CREATE_WINDOWS, //SYSTEM_ALERT_WINDOW
            null, //ACCESS_NOTIFICATIONS
            null, //CAMERA
            null, //RECORD_AUDIO
            UserManager.DISALLOW_RECORD_AUDIO, //RECORD_AUDIO
            null, //PLAY_AUDIO
            null, //READ_CLIPBOARD
            null, //WRITE_CLIPBOARD
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ interface IUserManager {
    Bundle getUserRestrictions(int userHandle);
    boolean hasUserRestriction(in String restrictionKey, int userHandle);
    void setUserRestrictions(in Bundle restrictions, int userHandle);
    void setUserRestriction(String key, boolean value, int userId);
    void setSystemControlledUserRestriction(String key, boolean value, int userId);
    void setApplicationRestrictions(in String packageName, in Bundle restrictions,
            int userHandle);
    Bundle getApplicationRestrictions(in String packageName);
+15 −3
Original line number Diff line number Diff line
@@ -411,6 +411,16 @@ public class UserManager {
     */
    public static final String DISALLOW_SAFE_BOOT = "no_safe_boot";

    /**
     * Specifies if a user is not allowed to record audio. This restriction is always enabled for
     * background users. The default value is <code>false</code>.
     *
     * @see #setUserRestrictions(Bundle)
     * @see #getUserRestrictions()
     * @hide
     */
    public static final String DISALLOW_RECORD_AUDIO = "no_record_audio";

    /**
     * Application restriction key that is used to indicate the pending arrival
     * of real restrictions for the app.
@@ -688,9 +698,11 @@ public class UserManager {
     */
    @Deprecated
    public void setUserRestriction(String key, boolean value, UserHandle userHandle) {
        Bundle bundle = getUserRestrictions(userHandle);
        bundle.putBoolean(key, value);
        setUserRestrictions(bundle, userHandle);
        try {
            mService.setUserRestriction(key, value, userHandle.getIdentifier());
        } catch (RemoteException re) {
            Log.w(TAG, "Could not set user restriction", re);
        }
    }

    /**
+8 −0
Original line number Diff line number Diff line
@@ -19951,6 +19951,14 @@ public final class ActivityManagerService extends ActivityManagerNative
                return token;
            }
        }
        @Override
        public ComponentName getHomeActivityForUser(int userId) {
            synchronized (ActivityManagerService.this) {
                ActivityRecord homeActivity = mStackSupervisor.getHomeActivityForUser(userId);
                return homeActivity.realActivity;
            }
        }
    }
    private final class SleepTokenImpl extends SleepToken {
Loading