diff options
15 files changed, 27 insertions, 121 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 2e82ce2535c2..33c15d775ff1 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -12817,15 +12817,6 @@ public final class Settings { "render_shadows_in_compositor"; /** - * If true, submit buffers using blast in ViewRootImpl. - * (0 = false, 1 = true) - * @hide - */ - @Readable - public static final String DEVELOPMENT_USE_BLAST_ADAPTER_VR = - "use_blast_adapter_vr"; - - /** * Path to the WindowManager display settings file. If unset, the default file path will * be used. * diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 04ae0aff10d0..bf09ec181c1f 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -273,8 +273,8 @@ public abstract class WallpaperService extends Service { int mCurHeight; float mZoom = 0f; int mWindowFlags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE; - int mWindowPrivateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS - | WindowManager.LayoutParams.PRIVATE_FLAG_USE_BLAST; + int mWindowPrivateFlags = + WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS; int mCurWindowFlags = mWindowFlags; int mCurWindowPrivateFlags = mWindowPrivateFlags; Rect mPreviewSurfacePosition; diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index 6c3b8ab19792..17bbee6d020f 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -114,8 +114,6 @@ interface IWindowManager IWindowSession openSession(in IWindowSessionCallback callback); - boolean useBLAST(); - @UnsupportedAppUsage void getInitialDisplaySize(int displayId, out Point size); @UnsupportedAppUsage diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index ac2c5509cac4..145af2e7ab67 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -442,9 +442,6 @@ public final class ViewRootImpl implements ViewParent, */ private boolean mForceNextConfigUpdate; - private boolean mUseBLASTAdapter; - private boolean mForceDisableBLAST; - /** lazily-initialized in getAudioManager() */ private boolean mFastScrollSoundEffectsEnabled = false; @@ -1290,8 +1287,6 @@ public final class ViewRootImpl implements ViewParent, if (mWindowAttributes.packageName == null) { mWindowAttributes.packageName = mBasePackageName; } - mWindowAttributes.privateFlags |= - WindowManager.LayoutParams.PRIVATE_FLAG_USE_BLAST; attrs = mWindowAttributes; setTag(); @@ -1502,9 +1497,6 @@ public final class ViewRootImpl implements ViewParent, Slog.i(mTag, "(" + mBasePackageName + ") Initial DisplayState: " + mAttachInfo.mDisplayState, new Throwable()); } - if ((res & WindowManagerGlobal.ADD_FLAG_USE_BLAST) != 0) { - mUseBLASTAdapter = true; - } if (view instanceof RootViewSurfaceTaker) { mInputQueueCallback = @@ -1901,8 +1893,7 @@ public final class ViewRootImpl implements ViewParent, mWindowAttributes.insetsFlags.appearance = appearance; mWindowAttributes.insetsFlags.behavior = behavior; mWindowAttributes.privateFlags |= compatibleWindowFlag - | appearanceAndBehaviorPrivateFlags - | WindowManager.LayoutParams.PRIVATE_FLAG_USE_BLAST; + | appearanceAndBehaviorPrivateFlags; if (mWindowAttributes.preservePreviousSurfaceInsets) { // Restore old surface insets. @@ -8692,11 +8683,7 @@ public final class ViewRootImpl implements ViewParent, } if (mSurfaceControl.isValid()) { - if (!useBLAST()) { - mSurface.copyFrom(mSurfaceControl); - } else { - updateBlastSurfaceIfNeeded(); - } + updateBlastSurfaceIfNeeded(); if (mAttachInfo.mThreadedRenderer != null) { mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl, mBlastBufferQueue); } @@ -11533,7 +11520,7 @@ public final class ViewRootImpl implements ViewParent, SurfaceControl.Transaction transaction = new SurfaceControl.Transaction(); transaction.setBlurRegions(surfaceControl, regionCopy); - if (useBLAST() && mBlastBufferQueue != null) { + if (mBlastBufferQueue != null) { mBlastBufferQueue.mergeWithNextTransaction(transaction, frameNumber); } } @@ -11550,18 +11537,6 @@ public final class ViewRootImpl implements ViewParent, mUnbufferedInputSource = mView.mUnbufferedInputSource; } - /** - * Force disabling use of the BLAST adapter regardless of the system - * flag. Needs to be called before addView. - */ - void forceDisableBLAST() { - mForceDisableBLAST = true; - } - - boolean useBLAST() { - return mUseBLASTAdapter && !mForceDisableBLAST; - } - int getSurfaceSequenceId() { return mSurfaceSequenceId; } diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index d4bd9e5bab92..92ce9f7e5d4c 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -3251,13 +3251,6 @@ public interface WindowManager extends ViewManager { public static final int PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC = 1 << 24; /** - * Flag to request creation of a BLAST (Buffer as LayerState) Layer. - * If not specified the client will receive a BufferQueue layer. - * @hide - */ - public static final int PRIVATE_FLAG_USE_BLAST = 1 << 25; - - /** * Flag to indicate that the window is controlling the appearance of system bars. So we * don't need to adjust it by reading its system UI flags for compatibility. * @hide @@ -3342,7 +3335,6 @@ public interface WindowManager extends ViewManager { PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION, PRIVATE_FLAG_NOT_MAGNIFIABLE, PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC, - PRIVATE_FLAG_USE_BLAST, PRIVATE_FLAG_APPEARANCE_CONTROLLED, PRIVATE_FLAG_BEHAVIOR_CONTROLLED, PRIVATE_FLAG_FIT_INSETS_CONTROLLED, @@ -3441,10 +3433,6 @@ public interface WindowManager extends ViewManager { equals = PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC, name = "COLOR_SPACE_AGNOSTIC"), @ViewDebug.FlagToString( - mask = PRIVATE_FLAG_USE_BLAST, - equals = PRIVATE_FLAG_USE_BLAST, - name = "USE_BLAST"), - @ViewDebug.FlagToString( mask = PRIVATE_FLAG_APPEARANCE_CONTROLLED, equals = PRIVATE_FLAG_APPEARANCE_CONTROLLED, name = "APPEARANCE_CONTROLLED"), diff --git a/core/java/android/view/WindowManagerGlobal.java b/core/java/android/view/WindowManagerGlobal.java index d20d95d50d61..214f1ec3d1ec 100644 --- a/core/java/android/view/WindowManagerGlobal.java +++ b/core/java/android/view/WindowManagerGlobal.java @@ -60,8 +60,6 @@ import java.util.function.IntConsumer; public final class WindowManagerGlobal { private static final String TAG = "WindowManager"; - private static boolean sUseBLASTAdapter = false; - /** * This is the first time the window is being drawn, * so the client must call drawingFinished() when done @@ -99,7 +97,6 @@ public final class WindowManagerGlobal { public static final int ADD_FLAG_IN_TOUCH_MODE = 0x1; public static final int ADD_FLAG_APP_VISIBLE = 0x2; - public static final int ADD_FLAG_USE_BLAST = 0x8; /** * Like {@link #RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS}, but as a "hint" when adding the @@ -176,7 +173,6 @@ public final class WindowManagerGlobal { if (sWindowManagerService != null) { ValueAnimator.setDurationScale( sWindowManagerService.getCurrentAnimatorScale()); - sUseBLASTAdapter = sWindowManagerService.useBLAST(); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); @@ -218,13 +214,6 @@ public final class WindowManagerGlobal { } } - /** - * Whether or not to use BLAST for ViewRootImpl - */ - public static boolean useBLAST() { - return sUseBLASTAdapter; - } - @UnsupportedAppUsage public String[] getViewRootNames() { synchronized (mLock) { diff --git a/core/java/android/view/WindowlessWindowManager.java b/core/java/android/view/WindowlessWindowManager.java index 652fe2445ddc..2746340dce13 100644 --- a/core/java/android/view/WindowlessWindowManager.java +++ b/core/java/android/view/WindowlessWindowManager.java @@ -245,8 +245,7 @@ public class WindowlessWindowManager implements IWindowSession { } } - final int res = WindowManagerGlobal.ADD_OKAY | WindowManagerGlobal.ADD_FLAG_APP_VISIBLE | - WindowManagerGlobal.ADD_FLAG_USE_BLAST; + final int res = WindowManagerGlobal.ADD_OKAY | WindowManagerGlobal.ADD_FLAG_APP_VISIBLE; sendLayoutParamsToParent(); // Include whether the window is in touch mode. diff --git a/core/java/android/window/SnapshotDrawerUtils.java b/core/java/android/window/SnapshotDrawerUtils.java index 758582615a46..cc875ad7ad1b 100644 --- a/core/java/android/window/SnapshotDrawerUtils.java +++ b/core/java/android/window/SnapshotDrawerUtils.java @@ -37,7 +37,6 @@ import static android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH; import static android.view.WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY; -import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_USE_BLAST; import static com.android.internal.policy.DecorView.NAVIGATION_BAR_COLOR_VIEW_ATTRIBUTES; import static com.android.internal.policy.DecorView.STATUS_BAR_COLOR_VIEW_ATTRIBUTES; @@ -426,7 +425,7 @@ public class SnapshotDrawerUtils { // Setting as trusted overlay to let touches pass through. This is safe because this // window is controlled by the system. layoutParams.privateFlags = (windowPrivateFlags & PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS) - | PRIVATE_FLAG_TRUSTED_OVERLAY | PRIVATE_FLAG_USE_BLAST; + | PRIVATE_FLAG_TRUSTED_OVERLAY; layoutParams.token = token; layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT; diff --git a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java index c0d83c4c08d5..f1b53edbb1cd 100644 --- a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +++ b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java @@ -233,7 +233,6 @@ public class SettingsBackupTest { Settings.Global.DEVELOPMENT_FORCE_RTL, Settings.Global.DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW, Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR, - Settings.Global.DEVELOPMENT_USE_BLAST_ADAPTER_VR, Settings.Global.DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH, Settings.Global.DEVICE_DEMO_MODE, Settings.Global.DISABLE_WINDOW_BLURS, diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java index f6c431fe6234..2b77ffffece0 100644 --- a/services/core/java/com/android/server/wm/WindowContainer.java +++ b/services/core/java/com/android/server/wm/WindowContainer.java @@ -3950,7 +3950,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< return true; } - boolean useBLASTSync() { + boolean syncNextBuffer() { return mSyncState != SYNC_STATE_NONE; } diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 0a986c8a6f2f..0e1391470dd3 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -660,11 +660,6 @@ public class WindowManagerService extends IWindowManager.Stub @NonNull final RootWindowContainer mRoot; - // Whether the system should use BLAST for ViewRootImpl - final boolean mUseBLAST; - // Whether to enable BLASTSyncEngine Transaction passing. - static final boolean USE_BLAST_SYNC = true; - final BLASTSyncEngine mSyncEngine; boolean mIsPc; @@ -1219,8 +1214,6 @@ public class WindowManagerService extends IWindowManager.Stub mRoot = new RootWindowContainer(this); final ContentResolver resolver = context.getContentResolver(); - mUseBLAST = Settings.Global.getInt(resolver, - Settings.Global.DEVELOPMENT_USE_BLAST_ADAPTER_VR, 1) == 1; mSyncEngine = new BLASTSyncEngine(this); @@ -1741,13 +1734,6 @@ public class WindowManagerService extends IWindowManager.Stub } // From now on, no exceptions or errors allowed! - - res = ADD_OKAY; - - if (mUseBLAST) { - res |= WindowManagerGlobal.ADD_FLAG_USE_BLAST; - } - if (displayContent.mCurrentFocus == null) { displayContent.mWinAddedSinceNullFocus.add(win); } @@ -2555,7 +2541,7 @@ public class WindowManagerService extends IWindowManager.Stub if (outSyncIdBundle != null) { final int maybeSyncSeqId; - if (USE_BLAST_SYNC && win.useBLASTSync() && viewVisibility == View.VISIBLE + if (win.syncNextBuffer() && viewVisibility == View.VISIBLE && win.mSyncSeqId > lastSyncSeqId) { maybeSyncSeqId = win.shouldSyncWithBuffers() ? win.mSyncSeqId : -1; win.markRedrawForSyncReported(); @@ -5818,15 +5804,6 @@ public class WindowManagerService extends IWindowManager.Stub } @Override - public boolean useBLAST() { - return mUseBLAST; - } - - public boolean useBLASTSync() { - return USE_BLAST_SYNC; - } - - @Override public void getInitialDisplaySize(int displayId, Point size) { synchronized (mGlobalLock) { final DisplayContent displayContent = mRoot.getDisplayContent(displayId); diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 4e17011c7141..8ded38b7901e 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -3368,7 +3368,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP mAnimatingExit = false; ProtoLog.d(WM_DEBUG_ANIM, "Clear animatingExit: reason=destroySurface win=%s", this); - if (useBLASTSync()) { + if (syncNextBuffer()) { immediatelyNotifyBlastSync(); } } @@ -5799,7 +5799,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // Consume the transaction because the sync group will merge it. postDrawTransaction = null; } - } else if (useBLASTSync()) { + } else if (syncNextBuffer()) { // Sync that is not using BLAST layoutNeeded = onSyncFinishedDrawing(); } @@ -5855,7 +5855,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // drawing for being visible, then no need to request redraw. return false; } - return useBLASTSync(); + return syncNextBuffer(); } int getSyncMethod() { @@ -5880,11 +5880,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP * it's next draw in to a transaction). If we have pending draw handlers, we are * looking for the client to sync. * - * See {@link WindowState#mPendingDrawHandlers} + * See {@link WindowState#mDrawHandlers} */ @Override - boolean useBLASTSync() { - return super.useBLASTSync() || (mDrawHandlers.size() != 0); + boolean syncNextBuffer() { + return super.syncNextBuffer() || (mDrawHandlers.size() != 0); } /** diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java index 209d93421fc1..6c15c227a3b4 100644 --- a/services/core/java/com/android/server/wm/WindowSurfaceController.java +++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java @@ -37,7 +37,6 @@ import android.util.Slog; import android.util.proto.ProtoOutputStream; import android.view.SurfaceControl; import android.view.WindowContentFrameStats; -import android.view.WindowManager; import com.android.internal.protolog.common.ProtoLog; @@ -73,7 +72,7 @@ class WindowSurfaceController { mWindowSession = win.mSession; Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "new SurfaceControl"); - final SurfaceControl.Builder b = win.makeSurface() + mSurfaceControl = win.makeSurface() .setParent(win.getSurfaceControl()) .setName(name) .setFormat(format) @@ -81,16 +80,8 @@ class WindowSurfaceController { .setMetadata(METADATA_WINDOW_TYPE, windowType) .setMetadata(METADATA_OWNER_UID, mWindowSession.mUid) .setMetadata(METADATA_OWNER_PID, mWindowSession.mPid) - .setCallsite("WindowSurfaceController"); - - final boolean useBLAST = mService.mUseBLAST && ((win.getAttrs().privateFlags - & WindowManager.LayoutParams.PRIVATE_FLAG_USE_BLAST) != 0); - - if (useBLAST) { - b.setBLASTLayer(); - } - - mSurfaceControl = b.build(); + .setCallsite("WindowSurfaceController") + .setBLASTLayer().build(); Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); } diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java index 1494f94f2052..28e0c6b65599 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java @@ -1337,8 +1337,8 @@ public class WindowOrganizerTests extends WindowTestsBase { // Since we have a window we have to wait for it to draw to finish sync. verify(mockCallback, never()).onTransactionReady(anyInt(), any()); - assertTrue(w1.useBLASTSync()); - assertTrue(w2.useBLASTSync()); + assertTrue(w1.syncNextBuffer()); + assertTrue(w2.syncNextBuffer()); // Make second (bottom) ready. If we started with the top, since activities fillsParent // by default, the sync would be considered finished. @@ -1348,16 +1348,16 @@ public class WindowOrganizerTests extends WindowTestsBase { assertEquals(SYNC_STATE_READY, w2.mSyncState); // Even though one Window finished drawing, both windows should still be using blast sync - assertTrue(w1.useBLASTSync()); - assertTrue(w2.useBLASTSync()); + assertTrue(w1.syncNextBuffer()); + assertTrue(w2.syncNextBuffer()); // A drawn window can complete the sync state automatically. w1.mWinAnimator.mDrawState = WindowStateAnimator.HAS_DRAWN; makeLastConfigReportedToClient(w1, true /* visible */); mWm.mSyncEngine.onSurfacePlacement(); verify(mockCallback).onTransactionReady(anyInt(), any()); - assertFalse(w1.useBLASTSync()); - assertFalse(w2.useBLASTSync()); + assertFalse(w1.syncNextBuffer()); + assertFalse(w2.syncNextBuffer()); } @Test diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java index 014d57dd9970..67384b2d9e18 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java @@ -551,7 +551,7 @@ public class WindowStateTests extends WindowTestsBase { final SurfaceControl.Transaction[] handledT = { null }; // The normal case that the draw transaction is applied with finishing drawing. win.applyWithNextDraw(t -> handledT[0] = t); - assertTrue(win.useBLASTSync()); + assertTrue(win.syncNextBuffer()); final SurfaceControl.Transaction drawT = new StubTransaction(); final SurfaceControl.Transaction currT = win.getSyncTransaction(); clearInvocations(currT); @@ -560,12 +560,12 @@ public class WindowStateTests extends WindowTestsBase { // The draw transaction should be merged to current transaction even if the state is hidden. verify(currT).merge(eq(drawT)); assertEquals(drawT, handledT[0]); - assertFalse(win.useBLASTSync()); + assertFalse(win.syncNextBuffer()); // If the window is gone before reporting drawn, the sync state should be cleared. win.applyWithNextDraw(t -> handledT[0] = t); win.destroySurfaceUnchecked(); - assertFalse(win.useBLASTSync()); + assertFalse(win.syncNextBuffer()); assertNotEquals(drawT, handledT[0]); } |