diff options
| author | Richard Ho <richo@google.com> | 2021-03-24 12:29:31 -0700 |
|---|---|---|
| committer | Richard Ho <richo@google.com> | 2021-03-25 12:22:14 -0700 |
| commit | 2e1428bdc590218b91a35c579ff2cc1edd22192f (patch) | |
| tree | 732b2b7691744f12acacbcd0ceb5fc9d43918fb7 /core/java/android | |
| parent | f15e43f250bba26b01514e864920666d30da3934 (diff) | |
Add policy for nearby app streaming
App streaming is when the device starts an app on a virtual display and sends a video stream of the app to nearby devices. The policy specifies options in which app streaming is supported. The default policy is streaming only to devices with the same managed account.
Bug: 179910177
Test: Builds successfully
Change-Id: I1a9424d0de524a0cdfcc00b2bc39196e7f231480
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 36 | ||||
| -rw-r--r-- | core/java/android/app/admin/IDevicePolicyManager.aidl | 3 |
2 files changed, 39 insertions, 0 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 6de7b5c47556..89d08ccefb79 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -7221,6 +7221,42 @@ public class DevicePolicyManager { } /** + * Called by a device/profile owner to set nearby app streaming policy. App streaming is when + * the device starts an app on a virtual display and sends a video stream of the app to nearby + * devices. + * + * @param policy One of the {@code NearbyStreamingPolicy} constants. + * @throws SecurityException if caller is not a device or profile owner. + */ + public void setNearbyAppStreamingPolicy(@NearbyStreamingPolicy int policy) { + throwIfParentInstance("setNearbyAppStreamingPolicy"); + if (mService == null) { + return; + } + try { + mService.setNearbyAppStreamingPolicy(policy); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * 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() { + throwIfParentInstance("getNearbyAppStreamingPolicy"); + if (mService == null) { + return NEARBY_STREAMING_DISABLED; + } + try { + return mService.getNearbyAppStreamingPolicy(); + } catch (RemoteException re) { + throw re.rethrowFromSystemServer(); + } + } + + /** * Called by a device owner, or alternatively a profile owner from Android 8.0 (API level 26) or * higher, to set whether auto time is required. If auto time is required, no user will be able * set the date and time and network date and time will be used. diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl index 394e53fbe3af..8a8c69c10379 100644 --- a/core/java/android/app/admin/IDevicePolicyManager.aidl +++ b/core/java/android/app/admin/IDevicePolicyManager.aidl @@ -135,6 +135,9 @@ interface IDevicePolicyManager { void setNearbyNotificationStreamingPolicy(int policy); int getNearbyNotificationStreamingPolicy(); + void setNearbyAppStreamingPolicy(int policy); + int getNearbyAppStreamingPolicy(); + void setKeyguardDisabledFeatures(in ComponentName who, int which, boolean parent); int getKeyguardDisabledFeatures(in ComponentName who, int userHandle, boolean parent); |
