summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-04-30 13:34:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-04-30 13:34:01 +0000
commit78a91deb5ef760be12c4e9c5b2219ba070e24c96 (patch)
treefd707795cc0f44b7273de5ea3879ce070391dfe2 /core/java/android
parent23f05811467df45611e77e158b5e85be8911dc88 (diff)
parentde8fe06dfa69ef0275fa6ae2de2bb5814e897f0a (diff)
Merge "Change streaming policy implementations" into sc-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/admin/DevicePolicyManager.java34
-rw-r--r--core/java/android/app/admin/IDevicePolicyManager.aidl4
2 files changed, 27 insertions, 11 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index cbf2d6a12bec..f07f45389d82 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -1678,23 +1678,30 @@ public class DevicePolicyManager {
})
public @interface PasswordComplexity {}
+ /**
+ * Indicates that nearby streaming is not controlled by policy, which means nearby streaming is
+ * allowed.
+ */
+ public static final int NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY = 0;
+
/** Indicates that nearby streaming is disabled. */
- public static final int NEARBY_STREAMING_DISABLED = 0;
+ public static final int NEARBY_STREAMING_DISABLED = 1;
/** Indicates that nearby streaming is enabled. */
- public static final int NEARBY_STREAMING_ENABLED = 1;
+ public static final int NEARBY_STREAMING_ENABLED = 2;
/**
* Indicates that nearby streaming is enabled only to devices offering a comparable level of
* security, with the same authenticated managed account.
*/
- public static final int NEARBY_STREAMING_SAME_MANAGED_ACCOUNT_ONLY = 2;
+ public static final int NEARBY_STREAMING_SAME_MANAGED_ACCOUNT_ONLY = 3;
/**
* @hide
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = {"NEARBY_STREAMING_"}, value = {
+ NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY,
NEARBY_STREAMING_DISABLED,
NEARBY_STREAMING_ENABLED,
NEARBY_STREAMING_SAME_MANAGED_ACCOUNT_ONLY,
@@ -7199,15 +7206,20 @@ public class DevicePolicyManager {
/**
* Returns the current runtime nearby notification streaming policy set by the device or profile
- * owner. The default is {@link #NEARBY_STREAMING_DISABLED}.
+ * owner.
*/
public @NearbyStreamingPolicy int getNearbyNotificationStreamingPolicy() {
+ return getNearbyNotificationStreamingPolicy(myUserId());
+ }
+
+ /** @hide per-user version */
+ public @NearbyStreamingPolicy int getNearbyNotificationStreamingPolicy(int userId) {
throwIfParentInstance("getNearbyNotificationStreamingPolicy");
if (mService == null) {
- return NEARBY_STREAMING_DISABLED;
+ return NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
}
try {
- return mService.getNearbyNotificationStreamingPolicy();
+ return mService.getNearbyNotificationStreamingPolicy(userId);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
@@ -7235,15 +7247,19 @@ public class DevicePolicyManager {
/**
* Returns the current runtime nearby app streaming policy set by the device or profile owner.
- * The default is {@link #NEARBY_STREAMING_DISABLED}.
*/
public @NearbyStreamingPolicy int getNearbyAppStreamingPolicy() {
+ return getNearbyAppStreamingPolicy(myUserId());
+ }
+
+ /** @hide per-user version */
+ public @NearbyStreamingPolicy int getNearbyAppStreamingPolicy(int userId) {
throwIfParentInstance("getNearbyAppStreamingPolicy");
if (mService == null) {
- return NEARBY_STREAMING_DISABLED;
+ return NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
}
try {
- return mService.getNearbyAppStreamingPolicy();
+ return mService.getNearbyAppStreamingPolicy(userId);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index 8e86f6545f23..370db60fb825 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -134,10 +134,10 @@ interface IDevicePolicyManager {
boolean getScreenCaptureDisabled(in ComponentName who, int userHandle, boolean parent);
void setNearbyNotificationStreamingPolicy(int policy);
- int getNearbyNotificationStreamingPolicy();
+ int getNearbyNotificationStreamingPolicy(int userId);
void setNearbyAppStreamingPolicy(int policy);
- int getNearbyAppStreamingPolicy();
+ int getNearbyAppStreamingPolicy(int userId);
void setKeyguardDisabledFeatures(in ComponentName who, int which, boolean parent);
int getKeyguardDisabledFeatures(in ComponentName who, int userHandle, boolean parent);