blob: 7b21eae2dc6ae13afcf695576c49d244a88b0a32 [file] [log] [blame]
From 11609f76801c9995fb3b1eb92e0ab25a79f7b977 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 29 Aug 2018 11:05:54 +0200
Subject: [PATCH 21/28] Add a property to override pre-o max aspect ratio
Conflicts:
services/core/java/com/android/server/am/ActivityRecord.java
Change-Id: I523b4e99bf647bb202a70003dbad1fb8551f3942
---
.../core/java/com/android/server/am/ActivityRecord.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index 4a9f8fc5a6e..8c5465a5134 100644
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -164,6 +164,7 @@ import android.os.PersistableBundle;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.storage.StorageManager;
import android.service.voice.IVoiceInteractionSession;
@@ -2416,7 +2417,6 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
// TODO(b/36505427): Consider moving this method and similar ones to ConfigurationContainer.
private void computeBounds(Rect outBounds) {
outBounds.setEmpty();
-
float maxAspectRatio = info.maxAspectRatio;
if (maxAspectRatio != 0.0f && higherAspectRatio && service.getAspectRatioApps() != null) {
if (service.getAspectRatioApps().contains(packageName)) {
@@ -2438,6 +2438,12 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
return;
}
+ if(info.applicationInfo.targetSdkVersion < O) {
+ try {
+ maxAspectRatio = Float.parseFloat(SystemProperties.get("persist.sys.max_aspect_ratio.pre_o", ""));
+ } catch (Throwable t) {}
+ Log.d("PHH", "Overrode aspect ratio because pre-o to " + maxAspectRatio);
+ }
// We must base this on the parent configuration, because we set our override
// configuration's appBounds based on the result of this method. If we used our own
// configuration, it would be influenced by past invocations.
--
2.21.0