Loading core/java/android/view/IWindowManager.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ interface IWindowManager /** * Create a screenshot of the applications currently displayed. */ Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth, int maxHeight); Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth, int maxHeight, boolean force565); /** * Called by the status bar to notify Views of changes to System UI visiblity. Loading services/java/com/android/server/am/ActivityManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final boolean IS_USER_BUILD = "user".equals(Build.TYPE); // Maximum number of recent tasks that we can remember. static final int MAX_RECENT_TASKS = 20; static final int MAX_RECENT_TASKS = ActivityManager.isLowRamDeviceStatic() ? 10 : 20; // Amount of time after a call to stopAppSwitches() during which we will // prevent further untrusted switches from happening. Loading services/java/com/android/server/am/ActivityStack.java +5 −2 Original line number Diff line number Diff line Loading @@ -121,6 +121,9 @@ final class ActivityStack { // convertToTranslucent(). static final long TRANSLUCENT_CONVERSION_TIMEOUT = 2000; static final boolean SCREENSHOT_FORCE_565 = ActivityManager .isLowRamDeviceStatic() ? true : false; enum ActivityState { INITIALIZING, RESUMED, Loading Loading @@ -691,10 +694,10 @@ final class ActivityStack { || mLastScreenshotBitmap.getHeight() != h) { mLastScreenshotActivity = who; mLastScreenshotBitmap = mWindowManager.screenshotApplications( who.appToken, Display.DEFAULT_DISPLAY, w, h); who.appToken, Display.DEFAULT_DISPLAY, w, h, SCREENSHOT_FORCE_565); } if (mLastScreenshotBitmap != null) { return mLastScreenshotBitmap.copy(Config.ARGB_8888, true); return mLastScreenshotBitmap.copy(mLastScreenshotBitmap.getConfig(), true); } } return null; Loading services/java/com/android/server/wm/WindowManagerService.java +6 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import android.content.pm.PackageManager; import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.PixelFormat; Loading Loading @@ -5513,9 +5514,12 @@ public class WindowManagerService extends IWindowManager.Stub * @param displayId the Display to take a screenshot of. * @param width the width of the target bitmap * @param height the height of the target bitmap * @param force565 if true the returned bitmap will be RGB_565, otherwise it * will be the same config as the surface */ @Override public Bitmap screenshotApplications(IBinder appToken, int displayId, int width, int height) { public Bitmap screenshotApplications(IBinder appToken, int displayId, int width, int height, boolean force565) { if (!checkCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER, "screenshotApplications()")) { throw new SecurityException("Requires READ_FRAME_BUFFER permission"); Loading Loading @@ -5718,7 +5722,7 @@ public class WindowManagerService extends IWindowManager.Stub return null; } Bitmap bm = Bitmap.createBitmap(width, height, rawss.getConfig()); Bitmap bm = Bitmap.createBitmap(width, height, force565 ? Config.RGB_565 : rawss.getConfig()); frame.scale(scale); Matrix matrix = new Matrix(); ScreenRotationAnimation.createRotationMatrix(rot, dw, dh, matrix); Loading Loading
core/java/android/view/IWindowManager.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ interface IWindowManager /** * Create a screenshot of the applications currently displayed. */ Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth, int maxHeight); Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth, int maxHeight, boolean force565); /** * Called by the status bar to notify Views of changes to System UI visiblity. Loading
services/java/com/android/server/am/ActivityManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final boolean IS_USER_BUILD = "user".equals(Build.TYPE); // Maximum number of recent tasks that we can remember. static final int MAX_RECENT_TASKS = 20; static final int MAX_RECENT_TASKS = ActivityManager.isLowRamDeviceStatic() ? 10 : 20; // Amount of time after a call to stopAppSwitches() during which we will // prevent further untrusted switches from happening. Loading
services/java/com/android/server/am/ActivityStack.java +5 −2 Original line number Diff line number Diff line Loading @@ -121,6 +121,9 @@ final class ActivityStack { // convertToTranslucent(). static final long TRANSLUCENT_CONVERSION_TIMEOUT = 2000; static final boolean SCREENSHOT_FORCE_565 = ActivityManager .isLowRamDeviceStatic() ? true : false; enum ActivityState { INITIALIZING, RESUMED, Loading Loading @@ -691,10 +694,10 @@ final class ActivityStack { || mLastScreenshotBitmap.getHeight() != h) { mLastScreenshotActivity = who; mLastScreenshotBitmap = mWindowManager.screenshotApplications( who.appToken, Display.DEFAULT_DISPLAY, w, h); who.appToken, Display.DEFAULT_DISPLAY, w, h, SCREENSHOT_FORCE_565); } if (mLastScreenshotBitmap != null) { return mLastScreenshotBitmap.copy(Config.ARGB_8888, true); return mLastScreenshotBitmap.copy(mLastScreenshotBitmap.getConfig(), true); } } return null; Loading
services/java/com/android/server/wm/WindowManagerService.java +6 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import android.content.pm.PackageManager; import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.PixelFormat; Loading Loading @@ -5513,9 +5514,12 @@ public class WindowManagerService extends IWindowManager.Stub * @param displayId the Display to take a screenshot of. * @param width the width of the target bitmap * @param height the height of the target bitmap * @param force565 if true the returned bitmap will be RGB_565, otherwise it * will be the same config as the surface */ @Override public Bitmap screenshotApplications(IBinder appToken, int displayId, int width, int height) { public Bitmap screenshotApplications(IBinder appToken, int displayId, int width, int height, boolean force565) { if (!checkCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER, "screenshotApplications()")) { throw new SecurityException("Requires READ_FRAME_BUFFER permission"); Loading Loading @@ -5718,7 +5722,7 @@ public class WindowManagerService extends IWindowManager.Stub return null; } Bitmap bm = Bitmap.createBitmap(width, height, rawss.getConfig()); Bitmap bm = Bitmap.createBitmap(width, height, force565 ? Config.RGB_565 : rawss.getConfig()); frame.scale(scale); Matrix matrix = new Matrix(); ScreenRotationAnimation.createRotationMatrix(rot, dw, dh, matrix); Loading