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

Commit 376b0200 authored by Galia Peycheva's avatar Galia Peycheva Committed by Automerger Merge Worker
Browse files

Merge "Add isDreaming method to DreamManager" into rvc-dev am: 95f8aba2

Change-Id: Iff2e5e2cdd023e97665508669b74594b0065800a
parents 25631f64 95f8aba2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -431,6 +431,7 @@ package android.app {
  }

  public class DreamManager {
    method @RequiresPermission("android.permission.READ_DREAM_STATE") public boolean isDreaming();
    method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void setActiveDream(@NonNull android.content.ComponentName);
    method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void startDream(@NonNull android.content.ComponentName);
    method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void stopDream();
+19 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class DreamManager {
    @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE)
    public void startDream(@NonNull ComponentName name) {
        try {
            mService.testDream(mContext.getUserId(), name);
            mService.dream();
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
@@ -99,4 +99,22 @@ public class DreamManager {
            e.rethrowFromSystemServer();
        }
    }

    /**
     * Returns whether the device is Dreaming.
     *
     * <p> This is only used for testing the dream service APIs.
     *
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.READ_DREAM_STATE)
    public boolean isDreaming() {
        try {
            return mService.isDreaming();
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
        return false;
    }
}