Loading core/java/android/util/imetracing/ImeTracingServerImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -41,9 +41,9 @@ import java.io.PrintWriter; */ class ImeTracingServerImpl extends ImeTracing { private static final String TRACE_DIRNAME = "/data/misc/wmtrace/"; private static final String TRACE_FILENAME_CLIENTS = "ime_trace_clients.pb"; private static final String TRACE_FILENAME_IMS = "ime_trace_service.pb"; private static final String TRACE_FILENAME_IMMS = "ime_trace_managerservice.pb"; private static final String TRACE_FILENAME_CLIENTS = "ime_trace_clients.winscope"; private static final String TRACE_FILENAME_IMS = "ime_trace_service.winscope"; private static final String TRACE_FILENAME_IMMS = "ime_trace_managerservice.winscope"; private static final int BUFFER_CAPACITY = 4096 * 1024; // Needed for winscope to auto-detect the dump type. Explained further in Loading core/java/com/android/internal/protolog/ProtoLogImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import java.io.File; */ public class ProtoLogImpl extends BaseProtoLogImpl { private static final int BUFFER_CAPACITY = 1024 * 1024; private static final String LOG_FILENAME = "/data/misc/wmtrace/wm_log.pb"; private static final String LOG_FILENAME = "/data/misc/wmtrace/wm_log.winscope"; private static final String VIEWER_CONFIG_FILENAME = "/system/etc/protolog.conf.json.gz"; private static ProtoLogImpl sServiceInstance = null; Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/PipAppHelper.kt +32 −28 Original line number Diff line number Diff line Loading @@ -17,11 +17,14 @@ package com.android.wm.shell.flicker.helpers import android.app.Instrumentation import android.graphics.Rect import android.media.session.MediaController import android.media.session.MediaSessionManager import android.os.SystemClock import androidx.test.uiautomator.By import androidx.test.uiautomator.BySelector import androidx.test.uiautomator.Until import com.android.server.wm.flicker.helpers.FIND_TIMEOUT import com.android.server.wm.flicker.helpers.SYSTEMUI_PACKAGE import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper import com.android.wm.shell.flicker.pip.tv.closeTvPipWindow Loading Loading @@ -85,6 +88,10 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper( // Wait on WMHelper or simply wait for 3 seconds wmHelper?.waitFor("hasPipWindow") { it.wmState.hasPipWindow() } ?: SystemClock.sleep(3_000) // when entering pip, the dismiss button is visible at the start. to ensure the pip // animation is complete, wait until the pip dismiss button is no longer visible. // b/176822698: dismiss-only state will be removed in the future uiDevice.wait(Until.gone(By.res(SYSTEMUI_PACKAGE, "dismiss")), FIND_TIMEOUT) } fun clickStartMediaSessionButton() { Loading Loading @@ -113,25 +120,25 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper( } } private fun getWindowRect(wmHelper: WindowManagerStateHelper): Rect { val windowRegion = wmHelper.getWindowRegion(component) require(!windowRegion.isEmpty) { "Unable to find a PIP window in the current state" } return windowRegion.bounds } /** * Expands the pip window and dismisses it by clicking on the X button. * * Note, currently the View coordinates reported by the accessibility are relative to * the window, so the correct coordinates need to be calculated * * For example, in a PIP window located at Rect(508, 1444 - 1036, 1741), the * dismiss button coordinates are shown as Rect(650, 0 - 782, 132), with center in * Point(716, 66), instead of Point(970, 1403) * * See b/179337864 */ fun closePipWindow(wmHelper: WindowManagerStateHelper) { if (isTelevision) { uiDevice.closeTvPipWindow() } else { expandPipWindow(wmHelper) val windowRect = getWindowRect(wmHelper) uiDevice.click(windowRect.centerX(), windowRect.centerY()) val exitPipObject = uiDevice.findObject(By.res(SYSTEMUI_PACKAGE, "dismiss")) requireNotNull(exitPipObject) { "PIP window dismiss button not found" } ?: error("PIP window dismiss button not found") val dismissButtonBounds = exitPipObject.visibleBounds uiDevice.click(dismissButtonBounds.centerX(), dismissButtonBounds.centerY()) } Loading @@ -142,32 +149,29 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper( } /** * Click once on the PIP window to expand it * Close the pip window by pressing the expand button */ fun expandPipWindow(wmHelper: WindowManagerStateHelper) { val windowRegion = wmHelper.getWindowRegion(component) require(!windowRegion.isEmpty) { "Unable to find a PIP window in the current state" } val windowRect = windowRegion.bounds fun expandPipWindowToApp(wmHelper: WindowManagerStateHelper) { val windowRect = getWindowRect(wmHelper) uiDevice.click(windowRect.centerX(), windowRect.centerY()) // Ensure WindowManagerService wait until all animations have completed // search and interact with the expand button val expandSelector = By.res(SYSTEMUI_PACKAGE, "expand_button") uiDevice.wait(Until.hasObject(expandSelector), FIND_TIMEOUT) val expandPipObject = uiDevice.findObject(expandSelector) ?: error("PIP window expand button not found") val expandButtonBounds = expandPipObject.visibleBounds uiDevice.click(expandButtonBounds.centerX(), expandButtonBounds.centerY()) wmHelper.waitFor("!hasPipWindow") { !it.wmState.hasPipWindow() } wmHelper.waitForAppTransitionIdle() mInstrumentation.uiAutomation.syncInputTransactions() } /** * Double click on the PIP window to reopen to app * Double click on the PIP window to expand it */ fun expandPipWindowToApp(wmHelper: WindowManagerStateHelper) { val windowRegion = wmHelper.getWindowRegion(component) require(!windowRegion.isEmpty) { "Unable to find a PIP window in the current state" } val windowRect = windowRegion.bounds fun doubleClickPipWindow(wmHelper: WindowManagerStateHelper) { val windowRect = getWindowRect(wmHelper) uiDevice.click(windowRect.centerX(), windowRect.centerY()) uiDevice.click(windowRect.centerX(), windowRect.centerY()) wmHelper.waitFor("!hasPipWindow") { !it.wmState.hasPipWindow() } wmHelper.waitForAppTransitionIdle() } Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitPrimarySplitScreenShowSecondaryFullscreen.kt +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.wm.shell.flicker.legacysplitscreen import android.content.ComponentName import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import android.view.Surface import androidx.test.filters.FlakyTest Loading Loading @@ -113,7 +112,7 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen( override fun visibleLayersShownMoreThanOneConsecutiveEntry() = super.visibleLayersShownMoreThanOneConsecutiveEntry() @Postsubmit @Presubmit @Test override fun visibleWindowsShownMoreThanOneConsecutiveEntry() = super.visibleWindowsShownMoreThanOneConsecutiveEntry() Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/LegacySplitScreenToLauncher.kt +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ class LegacySplitScreenToLauncher( @Presubmit @Test fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.endRotation) fun entireScreenCovered() = testSpec.entireScreenCovered() @Presubmit @Test Loading Loading
core/java/android/util/imetracing/ImeTracingServerImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -41,9 +41,9 @@ import java.io.PrintWriter; */ class ImeTracingServerImpl extends ImeTracing { private static final String TRACE_DIRNAME = "/data/misc/wmtrace/"; private static final String TRACE_FILENAME_CLIENTS = "ime_trace_clients.pb"; private static final String TRACE_FILENAME_IMS = "ime_trace_service.pb"; private static final String TRACE_FILENAME_IMMS = "ime_trace_managerservice.pb"; private static final String TRACE_FILENAME_CLIENTS = "ime_trace_clients.winscope"; private static final String TRACE_FILENAME_IMS = "ime_trace_service.winscope"; private static final String TRACE_FILENAME_IMMS = "ime_trace_managerservice.winscope"; private static final int BUFFER_CAPACITY = 4096 * 1024; // Needed for winscope to auto-detect the dump type. Explained further in Loading
core/java/com/android/internal/protolog/ProtoLogImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import java.io.File; */ public class ProtoLogImpl extends BaseProtoLogImpl { private static final int BUFFER_CAPACITY = 1024 * 1024; private static final String LOG_FILENAME = "/data/misc/wmtrace/wm_log.pb"; private static final String LOG_FILENAME = "/data/misc/wmtrace/wm_log.winscope"; private static final String VIEWER_CONFIG_FILENAME = "/system/etc/protolog.conf.json.gz"; private static ProtoLogImpl sServiceInstance = null; Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/PipAppHelper.kt +32 −28 Original line number Diff line number Diff line Loading @@ -17,11 +17,14 @@ package com.android.wm.shell.flicker.helpers import android.app.Instrumentation import android.graphics.Rect import android.media.session.MediaController import android.media.session.MediaSessionManager import android.os.SystemClock import androidx.test.uiautomator.By import androidx.test.uiautomator.BySelector import androidx.test.uiautomator.Until import com.android.server.wm.flicker.helpers.FIND_TIMEOUT import com.android.server.wm.flicker.helpers.SYSTEMUI_PACKAGE import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper import com.android.wm.shell.flicker.pip.tv.closeTvPipWindow Loading Loading @@ -85,6 +88,10 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper( // Wait on WMHelper or simply wait for 3 seconds wmHelper?.waitFor("hasPipWindow") { it.wmState.hasPipWindow() } ?: SystemClock.sleep(3_000) // when entering pip, the dismiss button is visible at the start. to ensure the pip // animation is complete, wait until the pip dismiss button is no longer visible. // b/176822698: dismiss-only state will be removed in the future uiDevice.wait(Until.gone(By.res(SYSTEMUI_PACKAGE, "dismiss")), FIND_TIMEOUT) } fun clickStartMediaSessionButton() { Loading Loading @@ -113,25 +120,25 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper( } } private fun getWindowRect(wmHelper: WindowManagerStateHelper): Rect { val windowRegion = wmHelper.getWindowRegion(component) require(!windowRegion.isEmpty) { "Unable to find a PIP window in the current state" } return windowRegion.bounds } /** * Expands the pip window and dismisses it by clicking on the X button. * * Note, currently the View coordinates reported by the accessibility are relative to * the window, so the correct coordinates need to be calculated * * For example, in a PIP window located at Rect(508, 1444 - 1036, 1741), the * dismiss button coordinates are shown as Rect(650, 0 - 782, 132), with center in * Point(716, 66), instead of Point(970, 1403) * * See b/179337864 */ fun closePipWindow(wmHelper: WindowManagerStateHelper) { if (isTelevision) { uiDevice.closeTvPipWindow() } else { expandPipWindow(wmHelper) val windowRect = getWindowRect(wmHelper) uiDevice.click(windowRect.centerX(), windowRect.centerY()) val exitPipObject = uiDevice.findObject(By.res(SYSTEMUI_PACKAGE, "dismiss")) requireNotNull(exitPipObject) { "PIP window dismiss button not found" } ?: error("PIP window dismiss button not found") val dismissButtonBounds = exitPipObject.visibleBounds uiDevice.click(dismissButtonBounds.centerX(), dismissButtonBounds.centerY()) } Loading @@ -142,32 +149,29 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper( } /** * Click once on the PIP window to expand it * Close the pip window by pressing the expand button */ fun expandPipWindow(wmHelper: WindowManagerStateHelper) { val windowRegion = wmHelper.getWindowRegion(component) require(!windowRegion.isEmpty) { "Unable to find a PIP window in the current state" } val windowRect = windowRegion.bounds fun expandPipWindowToApp(wmHelper: WindowManagerStateHelper) { val windowRect = getWindowRect(wmHelper) uiDevice.click(windowRect.centerX(), windowRect.centerY()) // Ensure WindowManagerService wait until all animations have completed // search and interact with the expand button val expandSelector = By.res(SYSTEMUI_PACKAGE, "expand_button") uiDevice.wait(Until.hasObject(expandSelector), FIND_TIMEOUT) val expandPipObject = uiDevice.findObject(expandSelector) ?: error("PIP window expand button not found") val expandButtonBounds = expandPipObject.visibleBounds uiDevice.click(expandButtonBounds.centerX(), expandButtonBounds.centerY()) wmHelper.waitFor("!hasPipWindow") { !it.wmState.hasPipWindow() } wmHelper.waitForAppTransitionIdle() mInstrumentation.uiAutomation.syncInputTransactions() } /** * Double click on the PIP window to reopen to app * Double click on the PIP window to expand it */ fun expandPipWindowToApp(wmHelper: WindowManagerStateHelper) { val windowRegion = wmHelper.getWindowRegion(component) require(!windowRegion.isEmpty) { "Unable to find a PIP window in the current state" } val windowRect = windowRegion.bounds fun doubleClickPipWindow(wmHelper: WindowManagerStateHelper) { val windowRect = getWindowRect(wmHelper) uiDevice.click(windowRect.centerX(), windowRect.centerY()) uiDevice.click(windowRect.centerX(), windowRect.centerY()) wmHelper.waitFor("!hasPipWindow") { !it.wmState.hasPipWindow() } wmHelper.waitForAppTransitionIdle() } Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitPrimarySplitScreenShowSecondaryFullscreen.kt +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.wm.shell.flicker.legacysplitscreen import android.content.ComponentName import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import android.view.Surface import androidx.test.filters.FlakyTest Loading Loading @@ -113,7 +112,7 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen( override fun visibleLayersShownMoreThanOneConsecutiveEntry() = super.visibleLayersShownMoreThanOneConsecutiveEntry() @Postsubmit @Presubmit @Test override fun visibleWindowsShownMoreThanOneConsecutiveEntry() = super.visibleWindowsShownMoreThanOneConsecutiveEntry() Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/LegacySplitScreenToLauncher.kt +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ class LegacySplitScreenToLauncher( @Presubmit @Test fun entireScreenCovered() = testSpec.entireScreenCovered(testSpec.config.endRotation) fun entireScreenCovered() = testSpec.entireScreenCovered() @Presubmit @Test Loading