Skip to content

Commit 5d0a560

Browse files
cwrenAndroid Git Automerger
authored andcommitted
am 4a01f2b: Merge "delay onDreamingStarted() to work around asynchrony." into jb-mr1-dev
* commit '4a01f2b5dcb5bcb72358905db402731013195cfd': delay onDreamingStarted() to work around asynchrony.
2 parents 1deaf3c + 4a01f2b commit 5d0a560

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

core/java/android/service/dreams/DreamService.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -612,18 +612,23 @@ private final void attach(IBinder windowToken) {
612612
View.SYSTEM_UI_FLAG_LOW_PROFILE);
613613
getWindowManager().addView(mWindow.getDecorView(), mWindow.getAttributes());
614614
} catch (Throwable t) {
615-
Slog.w("Crashed adding window view", t);
615+
Slog.w(TAG, "Crashed adding window view", t);
616616
safelyFinish();
617617
return;
618618
}
619619

620620
// start it up
621-
try {
622-
onDreamingStarted();
623-
} catch (Throwable t) {
624-
Slog.w("Crashed in onDreamingStarted()", t);
625-
safelyFinish();
626-
}
621+
mHandler.post(new Runnable() {
622+
@Override
623+
public void run() {
624+
try {
625+
onDreamingStarted();
626+
} catch (Throwable t) {
627+
Slog.w(TAG, "Crashed in onDreamingStarted()", t);
628+
safelyFinish();
629+
}
630+
}
631+
});
627632
}
628633

629634
private void safelyFinish() {

0 commit comments

Comments
 (0)