Jon West | eb45d5e | 2019-03-17 16:58:43 -0400 | [diff] [blame] | 1 | From 7acb0b76ae43d46c6c310063e01c036efabb5bbf Mon Sep 17 00:00:00 2001 |
| 2 | From: Pierre-Hugues Husson <phh@phh.me> |
| 3 | Date: Wed, 29 Aug 2018 11:05:54 +0200 |
| 4 | Subject: [PATCH 23/27] Add a property to override pre-o max aspect ratio |
| 5 | |
| 6 | Conflicts: |
| 7 | services/core/java/com/android/server/am/ActivityRecord.java |
| 8 | |
| 9 | Change-Id: I523b4e99bf647bb202a70003dbad1fb8551f3942 |
| 10 | --- |
| 11 | .../core/java/com/android/server/am/ActivityRecord.java | 8 +++++++- |
| 12 | 1 file changed, 7 insertions(+), 1 deletion(-) |
| 13 | |
| 14 | diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java |
| 15 | index 4a9f8fc5a6e..8c5465a5134 100644 |
| 16 | --- a/services/core/java/com/android/server/am/ActivityRecord.java |
| 17 | +++ b/services/core/java/com/android/server/am/ActivityRecord.java |
| 18 | @@ -164,6 +164,7 @@ import android.os.PersistableBundle; |
| 19 | import android.os.Process; |
| 20 | import android.os.RemoteException; |
| 21 | import android.os.SystemClock; |
| 22 | +import android.os.SystemProperties; |
| 23 | import android.os.UserHandle; |
| 24 | import android.os.storage.StorageManager; |
| 25 | import android.service.voice.IVoiceInteractionSession; |
| 26 | @@ -2416,7 +2417,6 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo |
| 27 | // TODO(b/36505427): Consider moving this method and similar ones to ConfigurationContainer. |
| 28 | private void computeBounds(Rect outBounds) { |
| 29 | outBounds.setEmpty(); |
| 30 | - |
| 31 | float maxAspectRatio = info.maxAspectRatio; |
| 32 | if (maxAspectRatio != 0.0f && higherAspectRatio && service.getAspectRatioApps() != null) { |
| 33 | if (service.getAspectRatioApps().contains(packageName)) { |
| 34 | @@ -2438,6 +2438,12 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo |
| 35 | return; |
| 36 | } |
| 37 | |
| 38 | + if(info.applicationInfo.targetSdkVersion < O) { |
| 39 | + try { |
| 40 | + maxAspectRatio = Float.parseFloat(SystemProperties.get("persist.sys.max_aspect_ratio.pre_o", "")); |
| 41 | + } catch (Throwable t) {} |
| 42 | + Log.d("PHH", "Overrode aspect ratio because pre-o to " + maxAspectRatio); |
| 43 | + } |
| 44 | // We must base this on the parent configuration, because we set our override |
| 45 | // configuration's appBounds based on the result of this method. If we used our own |
| 46 | // configuration, it would be influenced by past invocations. |
| 47 | -- |
| 48 | 2.17.1 |
| 49 | |