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

Commit 705622a8 authored by Lucas Silva's avatar Lucas Silva
Browse files

Allow dream previews to be called with only the component name.

Bug: 217556080
Test: locally on device
Change-Id: If6ba2ecd4fb60b9a7e474338f4684bb7ef93392e
parent 5479e1e0
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -454,21 +454,26 @@ public class DreamBackend {
        uiContext.startActivity(intent);
    }

    public void preview(DreamInfo dreamInfo) {
        logd("preview(%s)", dreamInfo);
        if (mDreamManager == null || dreamInfo == null || dreamInfo.componentName == null)
    /**
     * Preview a dream, given the component name.
     */
    public void preview(ComponentName componentName) {
        logd("preview(%s)", componentName);
        if (mDreamManager == null || componentName == null) {
            return;
        }
        try {
            mDreamManager.testDream(mContext.getUserId(), dreamInfo.componentName);
            mDreamManager.testDream(mContext.getUserId(), componentName);
        } catch (RemoteException e) {
            Log.w(TAG, "Failed to preview " + dreamInfo, e);
            Log.w(TAG, "Failed to preview " + componentName, e);
        }
    }

    public void startDreaming() {
        logd("startDreaming()");
        if (mDreamManager == null)
        if (mDreamManager == null) {
            return;
        }
        try {
            mDreamManager.dream();
        } catch (RemoteException e) {