summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorFyodor Kupolov <fkupolov@google.com>2015-05-09 00:19:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-09 00:19:41 +0000
commit220eef4a4abc15d42b8693667e2450bb7a1552a7 (patch)
tree79ae255f55490d5e2a4b6e55489e596f05c551a7 /core
parentea4eb326cfc4a8221be5fdab9639d468c632aee2 (diff)
parentb501330a1b6ef14ff512a5727f7a01bc423d6fbb (diff)
downloadframeworks_base-220eef4a4abc15d42b8693667e2450bb7a1552a7.zip
frameworks_base-220eef4a4abc15d42b8693667e2450bb7a1552a7.tar.gz
frameworks_base-220eef4a4abc15d42b8693667e2450bb7a1552a7.tar.bz2
Merge "Disable multi-user background recording" into mnc-dev
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/ActivityManagerInternal.java7
-rw-r--r--core/java/android/app/AppOpsManager.java2
-rw-r--r--core/java/android/os/IUserManager.aidl2
-rw-r--r--core/java/android/os/UserManager.java18
4 files changed, 25 insertions, 4 deletions
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java
index bde8f39..40eb799 100644
--- a/core/java/android/app/ActivityManagerInternal.java
+++ b/core/java/android/app/ActivityManagerInternal.java
@@ -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);
}
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 5aa399b..7104185 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -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
diff --git a/core/java/android/os/IUserManager.aidl b/core/java/android/os/IUserManager.aidl
index 811418b..f212daf 100644
--- a/core/java/android/os/IUserManager.aidl
+++ b/core/java/android/os/IUserManager.aidl
@@ -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);
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index c7ac7ce..cc37d5e 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -412,6 +412,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);
+ }
}
/**