Skip to content

Commit

Permalink
Focus window can handle null windows. Revert the null check (#2666)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Jan 17, 2020
1 parent 5b6c98e commit 446f824
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public void moveWindowLeft(@NonNull WindowWidget aWindow) {
}
}

public void focusWindow(@NonNull WindowWidget aWindow) {
public void focusWindow(@Nullable WindowWidget aWindow) {
if (aWindow != mFocusedWindow) {
WindowWidget prev = mFocusedWindow;
mFocusedWindow = aWindow;
Expand Down Expand Up @@ -518,15 +518,10 @@ public void enterPrivateMode() {

if (mPrivateWindows.size() == 0) {
WindowWidget window = addWindow();
if (window != null) {
window.loadHome();
}
window.loadHome();

} else {
WindowWidget window = getWindowWithPlacement(mRegularWindowPlacement);
if (window != null) {
focusWindow(window);
}
focusWindow(getWindowWithPlacement(mPrivateWindowPlacement));
}
updateViews();
mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);
Expand Down

0 comments on commit 446f824

Please sign in to comment.