Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eebcc0ff authored by John Reck's avatar John Reck Committed by Android Git Automerger
Browse files

am cd6a2d30: am 47dc3248: am 9a93f6f0: Merge "Reduce max recents on lowram" into klp-dev

* commit 'cd6a2d30':
  Reduce max recents on lowram
parents 87e385ef cd6a2d30
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -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.
+5 −2
Original line number Diff line number Diff line
@@ -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,
@@ -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;
+6 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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");
@@ -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);