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 be56335883.

Reason for revert: fix-forward

Change-Id: Idc5ce791fb07f2a7a181fb0b875bf001968b6889
This commit is contained in:
Lucas Silva
2023-03-09 20:15:20 +00:00
parent be56335883
commit 1b33ec1335

View File

@@ -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();
}
}