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

Commit 1b33ec13 authored by Lucas Silva's avatar Lucas Silva
Browse files

Check DreamActivity callback type to prevent class cast exception

This keeps the type-checking introduced in http://ag/21518427, but removes the NO_HISTORY flag which causes the lowlight system dream on tablets to break

This reverts commit be563358.

Reason for revert: fix-forward

Change-Id: Idc5ce791fb07f2a7a181fb0b875bf001968b6889
parent be563358
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -58,11 +58,13 @@ public class DreamActivity extends Activity {
            setTitle(title);
        }

        final Bundle extras = getIntent().getExtras();
        mCallback = (DreamService.DreamActivityCallbacks) extras.getBinder(EXTRA_CALLBACK);

        if (mCallback != null) {
        final Object callback = getIntent().getExtras().getBinder(EXTRA_CALLBACK);
        if (callback instanceof DreamService.DreamActivityCallbacks) {
            mCallback = (DreamService.DreamActivityCallbacks) callback;
            mCallback.onActivityCreated(this);
        } else {
            mCallback = null;
            finishAndRemoveTask();
        }
    }