isSecondaryHome = this instanceof SecondaryHomeActivity;
if(isSecondaryHome) {
- if(!U.isDesktopModeActive(this) && !U.isLibrary(this)) {
+ windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
+ if(windowManager.getDefaultDisplay().getDisplayId() == Display.DEFAULT_DISPLAY
+ || (!U.isDesktopModeActive(this) && !U.isLibrary(this))) {
finish();
return;
}
-
- windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
}
shouldDelayFreeformHack = true;
LauncherHelper helper = LauncherHelper.getInstance();
if(isSecondaryHome) {
- WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
- Display disp = wm.getDefaultDisplay();
- int displayID = disp.getDisplayId();
+ int displayID = windowManager.getDefaultDisplay().getDisplayId();
+ if(displayID == Display.DEFAULT_DISPLAY) {
+ finish();
+ return;
+ }
helper.setOnSecondaryHomeScreen(value, displayID);