Loading PREUPLOAD.cfg +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ hidden_api_txt_checksorted_hook = ${REPO_ROOT}/tools/platform-compat/hiddenapi/c hidden_api_txt_exclude_hook = ${REPO_ROOT}/frameworks/base/tools/hiddenapi/exclude.sh ${PREUPLOAD_COMMIT} ${REPO_ROOT} ktfmt_hook = ${REPO_ROOT}/external/ktfmt/ktfmt.py --check -i ${REPO_ROOT}/frameworks/base/ktfmt_includes.txt ${PREUPLOAD_FILES} ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py -f ${PREUPLOAD_FILES} owners_hook = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} "OWNERS$" Loading core/java/android/content/pm/ActivityInfo.java +22 −29 Original line number Diff line number Diff line Loading @@ -1108,6 +1108,16 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { @TestApi public static final float OVERRIDE_MIN_ASPECT_RATIO_LARGE_VALUE = 16 / 9f; /** * Enables the use of split screen aspect ratio. This allows an app to use all the available * space in split mode avoiding letterboxing. * @hide */ @ChangeId @Disabled @Overridable public static final long OVERRIDE_MIN_ASPECT_RATIO_TO_ALIGN_WITH_SPLIT_SCREEN = 208648326L; /** * Compares activity window layout min width/height with require space for multi window to * determine if it can be put into multi window mode. Loading Loading @@ -1317,8 +1327,8 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { * Returns true if the activity has maximum or minimum aspect ratio. * @hide */ public boolean hasFixedAspectRatio(@ScreenOrientation int orientation) { return getMaxAspectRatio() != 0 || getMinAspectRatio(orientation) != 0; public boolean hasFixedAspectRatio() { return getMaxAspectRatio() != 0 || getMinAspectRatio() != 0; } /** Loading Loading @@ -1460,30 +1470,10 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { } /** * Returns the min aspect ratio of this activity. * * This takes into account the minimum aspect ratio as defined in the app's manifest and * possible overrides as per OVERRIDE_MIN_ASPECT_RATIO. * * In the rare cases where the manifest minimum aspect ratio is required, use * {@code getManifestMinAspectRatio}. * Returns the min aspect ratio of this activity as defined in the manifest file. * @hide */ public float getMinAspectRatio(@ScreenOrientation int orientation) { if (applicationInfo == null || !isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO) || ( isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_PORTRAIT_ONLY) && !isFixedOrientationPortrait(orientation))) { return mMinAspectRatio; } if (isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_LARGE)) { return Math.max(OVERRIDE_MIN_ASPECT_RATIO_LARGE_VALUE, mMinAspectRatio); } if (isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_MEDIUM)) { return Math.max(OVERRIDE_MIN_ASPECT_RATIO_MEDIUM_VALUE, mMinAspectRatio); } public float getMinAspectRatio() { return mMinAspectRatio; } Loading Loading @@ -1512,7 +1502,13 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { } } private boolean isChangeEnabled(long changeId) { /** * Checks if a changeId is enabled for the current user * @param changeId The changeId to verify * @return True of the changeId is enabled * @hide */ public boolean isChangeEnabled(long changeId) { return CompatChanges.isChangeEnabled(changeId, applicationInfo.packageName, UserHandle.getUserHandleForUid(applicationInfo.uid)); } Loading Loading @@ -1633,12 +1629,9 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { if (getMaxAspectRatio() != 0) { pw.println(prefix + "maxAspectRatio=" + getMaxAspectRatio()); } final float minAspectRatio = getMinAspectRatio(screenOrientation); final float minAspectRatio = getMinAspectRatio(); if (minAspectRatio != 0) { pw.println(prefix + "minAspectRatio=" + minAspectRatio); if (getManifestMinAspectRatio() != minAspectRatio) { pw.println(prefix + "getManifestMinAspectRatio=" + getManifestMinAspectRatio()); } } if (supportsSizeChanges) { pw.println(prefix + "supportsSizeChanges=true"); Loading core/java/android/view/SurfaceView.java +103 −106 Original line number Diff line number Diff line Loading @@ -724,9 +724,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall private void releaseSurfaces(boolean releaseSurfacePackage) { mSurfaceAlpha = 1f; mSurface.destroy(); synchronized (mSurfaceControlLock) { mSurface.destroy(); if (mBlastBufferQueue != null) { mBlastBufferQueue.destroy(); mBlastBufferQueue = null; Loading Loading @@ -775,6 +775,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall Transaction surfaceUpdateTransaction) { boolean realSizeChanged = false; mSurfaceLock.lock(); try { mDrawingStopped = !mVisible; if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " " Loading Loading @@ -814,6 +816,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall setBufferSize(surfaceUpdateTransaction); } if (sizeChanged || creating || !isHardwareAccelerated()) { // Set a window crop when creating the surface or changing its size to // crop the buffer to the surface size since the buffer producer may // use SCALING_MODE_SCALE and submit a larger size than the surface Loading Loading @@ -851,6 +854,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall } applyTransactionOnVriDraw(surfaceUpdateTransaction); updateEmbeddedAccessibilityMatrix(false); mSurfaceFrame.left = 0; mSurfaceFrame.top = 0; if (translator == null) { Loading @@ -867,7 +871,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall || mLastSurfaceHeight != surfaceHeight; mLastSurfaceWidth = surfaceWidth; mLastSurfaceHeight = surfaceHeight; } finally { mSurfaceLock.unlock(); } return realSizeChanged; } Loading Loading @@ -1133,30 +1139,21 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall * Surface for compatibility reasons. */ private void copySurface(boolean surfaceControlCreated, boolean bufferSizeChanged) { if (surfaceControlCreated) { mSurface.copyFrom(mBlastBufferQueue); } if (bufferSizeChanged && getContext().getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.O) { // Some legacy applications use the underlying native {@link Surface} object // as a key to whether anything has changed. In these cases, updates to the // existing {@link Surface} will be ignored when the size changes. // Therefore, we must explicitly recreate the {@link Surface} in these // cases. boolean needsWorkaround = bufferSizeChanged && getContext().getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.O; if (!surfaceControlCreated && !needsWorkaround) { return; } mSurfaceLock.lock(); try { if (surfaceControlCreated) { mSurface.copyFrom(mBlastBufferQueue); } if (needsWorkaround) { if (mBlastBufferQueue != null) { mSurface.transferFrom(mBlastBufferQueue.createSurfaceWithHandle()); } } } finally { mSurfaceLock.unlock(); } } private void setBufferSize(Transaction transaction) { Loading core/res/res/color/system_bar_background_semi_transparent.xml 0 → 100644 +19 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2022 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/system_neutral2_900" android:alpha="0.5" /> </selector> core/res/res/values/colors.xml +0 −3 Original line number Diff line number Diff line Loading @@ -211,9 +211,6 @@ <color name="Red_700">#ffc53929</color> <color name="Red_800">#ffb93221</color> <!-- Status bar color for semi transparent mode. --> <color name="system_bar_background_semi_transparent">#66000000</color> <!-- 40% black --> <color name="resize_shadow_start_color">#2a000000</color> <color name="resize_shadow_end_color">#00000000</color> Loading Loading
PREUPLOAD.cfg +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ hidden_api_txt_checksorted_hook = ${REPO_ROOT}/tools/platform-compat/hiddenapi/c hidden_api_txt_exclude_hook = ${REPO_ROOT}/frameworks/base/tools/hiddenapi/exclude.sh ${PREUPLOAD_COMMIT} ${REPO_ROOT} ktfmt_hook = ${REPO_ROOT}/external/ktfmt/ktfmt.py --check -i ${REPO_ROOT}/frameworks/base/ktfmt_includes.txt ${PREUPLOAD_FILES} ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py -f ${PREUPLOAD_FILES} owners_hook = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} "OWNERS$" Loading
core/java/android/content/pm/ActivityInfo.java +22 −29 Original line number Diff line number Diff line Loading @@ -1108,6 +1108,16 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { @TestApi public static final float OVERRIDE_MIN_ASPECT_RATIO_LARGE_VALUE = 16 / 9f; /** * Enables the use of split screen aspect ratio. This allows an app to use all the available * space in split mode avoiding letterboxing. * @hide */ @ChangeId @Disabled @Overridable public static final long OVERRIDE_MIN_ASPECT_RATIO_TO_ALIGN_WITH_SPLIT_SCREEN = 208648326L; /** * Compares activity window layout min width/height with require space for multi window to * determine if it can be put into multi window mode. Loading Loading @@ -1317,8 +1327,8 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { * Returns true if the activity has maximum or minimum aspect ratio. * @hide */ public boolean hasFixedAspectRatio(@ScreenOrientation int orientation) { return getMaxAspectRatio() != 0 || getMinAspectRatio(orientation) != 0; public boolean hasFixedAspectRatio() { return getMaxAspectRatio() != 0 || getMinAspectRatio() != 0; } /** Loading Loading @@ -1460,30 +1470,10 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { } /** * Returns the min aspect ratio of this activity. * * This takes into account the minimum aspect ratio as defined in the app's manifest and * possible overrides as per OVERRIDE_MIN_ASPECT_RATIO. * * In the rare cases where the manifest minimum aspect ratio is required, use * {@code getManifestMinAspectRatio}. * Returns the min aspect ratio of this activity as defined in the manifest file. * @hide */ public float getMinAspectRatio(@ScreenOrientation int orientation) { if (applicationInfo == null || !isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO) || ( isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_PORTRAIT_ONLY) && !isFixedOrientationPortrait(orientation))) { return mMinAspectRatio; } if (isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_LARGE)) { return Math.max(OVERRIDE_MIN_ASPECT_RATIO_LARGE_VALUE, mMinAspectRatio); } if (isChangeEnabled(OVERRIDE_MIN_ASPECT_RATIO_MEDIUM)) { return Math.max(OVERRIDE_MIN_ASPECT_RATIO_MEDIUM_VALUE, mMinAspectRatio); } public float getMinAspectRatio() { return mMinAspectRatio; } Loading Loading @@ -1512,7 +1502,13 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { } } private boolean isChangeEnabled(long changeId) { /** * Checks if a changeId is enabled for the current user * @param changeId The changeId to verify * @return True of the changeId is enabled * @hide */ public boolean isChangeEnabled(long changeId) { return CompatChanges.isChangeEnabled(changeId, applicationInfo.packageName, UserHandle.getUserHandleForUid(applicationInfo.uid)); } Loading Loading @@ -1633,12 +1629,9 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { if (getMaxAspectRatio() != 0) { pw.println(prefix + "maxAspectRatio=" + getMaxAspectRatio()); } final float minAspectRatio = getMinAspectRatio(screenOrientation); final float minAspectRatio = getMinAspectRatio(); if (minAspectRatio != 0) { pw.println(prefix + "minAspectRatio=" + minAspectRatio); if (getManifestMinAspectRatio() != minAspectRatio) { pw.println(prefix + "getManifestMinAspectRatio=" + getManifestMinAspectRatio()); } } if (supportsSizeChanges) { pw.println(prefix + "supportsSizeChanges=true"); Loading
core/java/android/view/SurfaceView.java +103 −106 Original line number Diff line number Diff line Loading @@ -724,9 +724,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall private void releaseSurfaces(boolean releaseSurfacePackage) { mSurfaceAlpha = 1f; mSurface.destroy(); synchronized (mSurfaceControlLock) { mSurface.destroy(); if (mBlastBufferQueue != null) { mBlastBufferQueue.destroy(); mBlastBufferQueue = null; Loading Loading @@ -775,6 +775,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall Transaction surfaceUpdateTransaction) { boolean realSizeChanged = false; mSurfaceLock.lock(); try { mDrawingStopped = !mVisible; if (DEBUG) Log.i(TAG, System.identityHashCode(this) + " " Loading Loading @@ -814,6 +816,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall setBufferSize(surfaceUpdateTransaction); } if (sizeChanged || creating || !isHardwareAccelerated()) { // Set a window crop when creating the surface or changing its size to // crop the buffer to the surface size since the buffer producer may // use SCALING_MODE_SCALE and submit a larger size than the surface Loading Loading @@ -851,6 +854,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall } applyTransactionOnVriDraw(surfaceUpdateTransaction); updateEmbeddedAccessibilityMatrix(false); mSurfaceFrame.left = 0; mSurfaceFrame.top = 0; if (translator == null) { Loading @@ -867,7 +871,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall || mLastSurfaceHeight != surfaceHeight; mLastSurfaceWidth = surfaceWidth; mLastSurfaceHeight = surfaceHeight; } finally { mSurfaceLock.unlock(); } return realSizeChanged; } Loading Loading @@ -1133,30 +1139,21 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall * Surface for compatibility reasons. */ private void copySurface(boolean surfaceControlCreated, boolean bufferSizeChanged) { if (surfaceControlCreated) { mSurface.copyFrom(mBlastBufferQueue); } if (bufferSizeChanged && getContext().getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.O) { // Some legacy applications use the underlying native {@link Surface} object // as a key to whether anything has changed. In these cases, updates to the // existing {@link Surface} will be ignored when the size changes. // Therefore, we must explicitly recreate the {@link Surface} in these // cases. boolean needsWorkaround = bufferSizeChanged && getContext().getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.O; if (!surfaceControlCreated && !needsWorkaround) { return; } mSurfaceLock.lock(); try { if (surfaceControlCreated) { mSurface.copyFrom(mBlastBufferQueue); } if (needsWorkaround) { if (mBlastBufferQueue != null) { mSurface.transferFrom(mBlastBufferQueue.createSurfaceWithHandle()); } } } finally { mSurfaceLock.unlock(); } } private void setBufferSize(Transaction transaction) { Loading
core/res/res/color/system_bar_background_semi_transparent.xml 0 → 100644 +19 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2022 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/system_neutral2_900" android:alpha="0.5" /> </selector>
core/res/res/values/colors.xml +0 −3 Original line number Diff line number Diff line Loading @@ -211,9 +211,6 @@ <color name="Red_700">#ffc53929</color> <color name="Red_800">#ffb93221</color> <!-- Status bar color for semi transparent mode. --> <color name="system_bar_background_semi_transparent">#66000000</color> <!-- 40% black --> <color name="resize_shadow_start_color">#2a000000</color> <color name="resize_shadow_end_color">#00000000</color> Loading