import static android.content.pm.ActivityInfo.FLAG_RESUME_WHILE_PAUSING;
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
import static android.content.res.Configuration.SCREENLAYOUT_UNDEFINED;
+import static android.view.Display.DEFAULT_DISPLAY;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ADD_REMOVE;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ALL;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_APP;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.am.ActivityManagerService.LOCK_SCREEN_SHOWN;
+import static com.android.server.am.ActivityManagerService.TAKE_FULLSCREEN_SCREENSHOTS;
import static com.android.server.am.ActivityRecord.APPLICATION_ACTIVITY_TYPE;
import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE;
import static com.android.server.am.ActivityRecord.STARTING_WINDOW_REMOVED;
final boolean isOnHomeDisplay() {
return isAttached() &&
- mActivityContainer.mActivityDisplay.mDisplayId == Display.DEFAULT_DISPLAY;
+ mActivityContainer.mActivityDisplay.mDisplayId == DEFAULT_DISPLAY;
}
void moveToFront(String reason) {
int w = mService.mThumbnailWidth;
int h = mService.mThumbnailHeight;
+
+ if (w <= 0) {
+ Slog.e(TAG, "\tInvalid thumbnail dimensions: " + w + "x" + h);
+ return null;
+ }
+
+ if (mStackId == DOCKED_STACK_ID && mStackSupervisor.mIsDockMinimized) {
+ // When the docked stack is minimized its app windows are cropped significantly so any
+ // screenshot taken will not display the apps contain. So, we avoid taking a screenshot
+ // in that case.
+ if (DEBUG_SCREENSHOTS) Slog.e(TAG, "\tIn minimized docked stack");
+ return null;
+ }
+
float scale = 1f;
- if (w > 0) {
- if (DEBUG_SCREENSHOTS) Slog.d(TAG_SCREENSHOTS, "\tTaking screenshot");
+ if (DEBUG_SCREENSHOTS) Slog.d(TAG_SCREENSHOTS, "\tTaking screenshot");
- // When this flag is set, we currently take the fullscreen screenshot of the activity
- // but scaled to half the size. This gives us a "good-enough" fullscreen thumbnail to
- // use within SystemUI while keeping memory usage low.
- if (ActivityManagerService.TAKE_FULLSCREEN_SCREENSHOTS) {
- w = h = -1;
- scale = mService.mFullscreenThumbnailScale;
- }
- return mWindowManager.screenshotApplications(who.appToken, Display.DEFAULT_DISPLAY,
- w, h, scale);
+ // When this flag is set, we currently take the fullscreen screenshot of the activity but
+ // scaled to half the size. This gives us a "good-enough" fullscreen thumbnail to use within
+ // SystemUI while keeping memory usage low.
+ if (TAKE_FULLSCREEN_SCREENSHOTS) {
+ w = h = -1;
+ scale = mService.mFullscreenThumbnailScale;
}
- Slog.e(TAG, "Invalid thumbnail dimensions: " + w + "x" + h);
- return null;
+
+ return mWindowManager.screenshotApplications(who.appToken, DEFAULT_DISPLAY, w, h, scale);
}
/**