Currently, BroadcastInterceptingContext always runs broadcast
receivers on the thread that called sendBroadcast. This means:
1. Receivers might run on the wrong thread, making the test less
realistic.
2. If any receiver checks what thread it's running on, then
either the check needs to be modified or deleted, or the test
must call sendBroadcast on the thread that the receiver
expects to run on. The latter is impossible when there is more
than one receiver that needs to run on more than one thread.
This CL adds a setUseRegisteredHandlers method that allows tests
to say that they want each receiver to run on the Handler
specified at registration time.
This CL also enables the new mode for ConnectivityServiceTest,
and resolves a TODO to re-enable a disabled thread check.
The new mode cannot be enabled by default because it would break
most of the tests.
All the below tests pass except for the car bluetooth test
testAutoConnectAdapterOff_returnsImmediately which was already failing.
Bug: 173331190
Test: atest CarInputServiceTest BluetoothProfileDeviceManagerTest
Test: atest NetworkPolicyManagerServiceTest
Test: atest ConnectivityServiceTest
Test: atest TetheringTest TetheringNotificationUpdaterTest
Test: atest VersionedBroadcastListenerTest EntitlementManagerTest
Test: atest TetheringConfigurationTest
Test: atest CachedDeviceStateServiceTest
Test: atest EmergencyAffordanceServiceTest
Change-Id: I3303bb14516f07a55d82a16b59c111ab3f8b0389
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.
Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas. Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:
-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage
Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance. With this extensive
effort, we've now improved our coverage as follows:
-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage
This specific change is automatically generated by a script that
identifies relevant "include" directives.
Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
This change allows the method to throw a more informative exception
containing the file name that has not been found.
Test: used the library in sharedlibs_host_tests
Change-Id: I196385486ef4c121f1c655cd76c3ea5233e2a722
The original code is flawed in that `pm install-abandon` only abandons
the 1st session returned by `pm get-stagedsessions ...`.
1. move AbandonSessionsRule to be shared by multiple host tests
2. use AbandonSessionsRule to do the job
Bug: 160754072
Test: StagedInstallInternalTest
Change-Id: Ib7b32fbd7b1133ac6a8e6782234a4fe2c5a782bd
Merged-In: Ib7b32fbd7b1133ac6a8e6782234a4fe2c5a782bd
(cherry picked from commit 3ac333f2d20e240093235d957ba67ce174fe2db8)
This CL passes the correct install user when creating sessions in
StagingManager and effectively reverts ag/6901350.
Add a test to ensure b/129397974 is not regressed as described in
b/158222747#comment11.
(Cherry-picked from 838dea54caba0c6a17d90757211bc897ef77c963)
Fix: 129744602
Fix: 158222747
Test: atest MultiUserRollbackTest#testStagedRollback
Merged-In: I718992240aa76898ff9e4220ea6a769ee8cd61f5
Change-Id: I718992240aa76898ff9e4220ea6a769ee8cd61f5
See https://source.android.com/setup/contribute/respectful-code for reference
Bug: 161896447
Test: compile (code is not active in use)
Change-Id: Ice71490ff09969f229943d6ef952a09f4e283d14
Merged-In: Ice71490ff09969f229943d6ef952a09f4e283d14
It seems adb shell stop/start has a bug with taking up disk
space. For now, use a full reboot of the device for each
test step.
This will double the already extremely long test time, so the
entire PackageManagerServiceHostTests module has been moved
to postsubmit, except for tests annotated @Presubmit, of which
there are none as of this change.
Bug: 159540015
Bug: 159256824
Test: atest PackageManagerServiceHostTests
Change-Id: I67da61cb02baa572fc298e6f617d6e53ec2c4724
This broke in P. Basic support was broken by a simple negation
issue with the logic that checks for the original package.
That, along with the suggestion in the bug to fix the renamed
package association means this should now work as expected,
carrying data over from a previous installed, differently named
package.
Bug: 131355130
Bug: 132749720
Bug: 111967720
Test: atest PackageManagerServiceHostTests
Change-Id: Ifc4c7af47c4b633cd27ba4a40b6baa0e27960d71
This metrics now is used for calculating the value reported by
Display#getSize. It could be extended to have more function later.
Also replace getCurrentMetrics usages to make them report
Display#getSize value.
Bug: 148904274
Test: atest WindowMetricsHelperTest
Change-Id: I182b6e63f7c28752eee22839cb9e69f073046c3f
The root causes of this issue are:
1. WindowTokenClient#attachContext makes WindowTokenClient has strong
reference to WindowContext, which leads to WindowContext cannot be
GC'd.
2. WMS#removeWindowToken needs MANAGE_APP_TOKEN permission which
normal apps don't hold.
This CL does following things:
1. Use weak reference instead on WindowTokenClient#mContext.
2. Relax WMS#removeWindowToken to check callingUid if
MANAGE_WINDOW_TOKEN permission is not held
3. Deliver config changes to the client side in
WMS#addWindowTokenWithOption
4. Some minor fixes
fixes: 150812449
Bug: 150715095
Test: atest WindowContextTest
Test: atest WindowManagerServiceTests
Test: atest WindowTokenTests
Test: atest WindowManagerPermissionTests#testMANAGE_APP_TOKENS
Test: atest
WindowManagerPermissionTests#testADD_WINDOW_TOKEN_WITH_OPTIONS
Change-Id: I9f1d73af2abb78fc9844e6d9eb25e9f0293514e7
To make PowerManagerServiceTest deterministic,
remove dependency on real time clock by mocking it out.
Use TestLooper, which allows making Handler behaviour deterministic as
well.
Test: atest PowerManagerServiceTest
Bug: 152193749
Change-Id: I4d9cd686ac672261bbb038249c0358e451b58710
Provide a recording insets controller before the window gets
created, and replay the commands once a view gets attached. This
allows the client to use the controller in Activity.onCreate.
Test: WindowInsetsControllerTests
Bug: 118118435
Change-Id: I1a825ecc4367c02b27f2d08cd5442325315d4f89
This reverts commit 288e1bd0455132643cf6e1dc482913f430e56bba.
The previous implementation of computeWindowInsets is to
use last view from WM#addView, which may be invalid because
the last added view is removed and throws NPE when getting
property from the invalid view.
In this CL, we change the approach to always obtain window
insets from server.
fixes: 148789183
fixes: 149480577
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest WindowMetricsTests
Change-Id: I6db5970d14ac9eebe0ab0df65cb1300515ad1754
(cherry picked from commit 6bb2d4f68c02121850c62a83349aa35d36497afa)
The previous implementation of computeWindowInsets is to
use last view from WM#addView, which may be invalid because
the last added view is removed and throws NPE when getting
property from the invalid view.
In this CL, we change the approach to always obtain window
insets from server.
fixes: 148789183
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest WindowMetricsTests
Change-Id: Ic5512c31f86c597d99e13d29df654d3f527d6b55
Adding another library that excludes mockito for WmTests to avoid
conflicting with extended-mockito.
Test: presubmit pass
Change-Id: If3f6d7a2ac52d3e8f72e9cbc88e54f0c4d4c47ce
Hooks AppsFilter to support exposing a target and any overlays
targeting it to the actor specified in its overlayable block.
Sacrifices some install-time performance in favor of less memory
usage and easier to follow code by doing a full search/rebuild
on each change.
Benchmarks TBD
Bug: 143096091
Test: atest OverlayReferenceMapperTests
Change-Id: Ic832818b9aa383f1167ca3e69a11b8459fa9db97
Wire up the appearance and the transient state of system bars between
WMS and System UI. The derived classes of CommandQueue.Callbacks no
longer listen to setSystemUiVisibility, but listen to showTransient,
abortTransient, and onSystemBarAppearanceChanged instead.
Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
InsetsPolicyTest WindowStateTests CommandQueueTest
RegisterStatusBarResultTest InsetsFlagsTest
LightBarControllerTest
Test: build on specific target
Change-Id: Ie35f4b4468bce7ef8c76f091e306610c069fba85
This reverts commit cb1b848084be47118342c4893ede2298067c3d0f.
Reason for revert: Droidcop-triggered revert due to b/142849532
Change-Id: If81eba4e979e21202e78839bb1afbc66691098d2
Wire up the appearance and the transient state of system bars between
WMS and System UI. The derived classes of CommandQueue.Callbacks no
longer listen to setSystemUiVisibility, but listen to showTransient,
abortTransient, and onSystemBarAppearanceChanged instead.
Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
InsetsPolicyTest WindowStateTests CommandQueueTest
RegisterStatusBarResultTest InsetsFlagsTest
LightBarControllerTest
Change-Id: I1dcaff47ae57ccee91146fdc042cde5e26fc0b3f
a) Add a new stopAutoDispatchAndIgnoreExceptions method
This method ignores exceptions raised when there are no messages
dispatched in the looper. Helps write negative unit tests for methods where
the runnables are not posted when some preconditions are not met.
Not starting the looper in these tests would make it
unclear whether the test failed because the looper was not running or
because the preconditions (like permission checks) where not satisfied.
b) Auto dispatch will only stop running when stopAutoDispatch is
invoked. Previously it stops running when it runs a single message. This
causes failures in unit tests for methods which posts multiple runnables
in the same method.
Bug: 138403307
Bug: 117601161
Test: atest com.android.server.wifi
Change-Id: Iab27d92d443c6d7364c52b86d51dd2cb7902358a
Adds policy to decide when focused window can control bars. And also
generalizes control target for:
a) Normal case: The focused window is the control target.
b) Transient bar case: The control target is a special object in WM
that controls the transient animation.
Bug: 118118435
Test: atest InsetsPolicyTest InsetsStateControllerTest WindowStateTests
Change-Id: I4819d85eec745d56abe23dbca0905979da854e5e
This also adds new module for tests that require Extended Mockito.
Bug: 127106719
Test: atest FrameworksCoreTests:android.app.activity.ActivityThreadTest
Change-Id: I7ed5de72d35babbbf72c4c823d3a9e4baa50e3c4
This CL adds android.view.InsetsAnimationControllerImplTest to the
test filter, and adds a comment to each tests mentioning about
FrameworksTestsFilter.
Test: Pass all 91 non-flaky presubmit tests in FrameworksCoreTests
using FrameworksTestsFilter
$ tradefed.sh run commandAndExit FrameworksCoreTests \
--instrumentation-arg selectTest=com.android.server.wm. \
--instrumentation-arg filter=com.android.server.wm.test.filters.FrameworksTestsFilter
--include-annotation android.platform.test.annotations.Presubmit \
--exclude-annotation androidx.test.filters.FlakyTest
Bug: 122451194
Change-Id: I9592ff01158eec1b4ef4d0dd22be243e10bd198e
This CL also moves CoreTestsFilter to frameworks/base/test-util, so
that FrameworksCoreTests, FrameworksServicesTests, and WmTests can use
CoreTestsFilter.
Test: Pass SelectTestTests
$ atest WmTests:com.android.test.filters.SelectTestTests
Test: Pass all 91 non-flaky presubmit tests in FrameworksCoreTests using
CoreTestsFilter
$ tradefed.sh run commandAndExit WmTests \
--instrumentation-arg selectTest=com.android.server.wm. \
--instrumentation-arg filter=com.android.server.wm.test.filters.CoreTestsFilter
--include-annotation android.platform.test.annotations.Presubmit \
--exclude-annotation androidx.test.filters.FlakyTest
Test: Pass all 740 non-flaky presubmit tests in WmTests using
CoreTestsFilter
$ tradefed.sh run commandAndExit WmTests \
--instrumentation-arg selectTest=com.android.server.wm. \
--instrumentation-arg filter=com.android.server.wm.test.filters.CoreTestsFilter
--include-annotation android.platform.test.annotations.Presubmit \
--exclude-annotation androidx.test.filters.FlakyTest
Bug: 122451194
Change-Id: I83d13d9ef82a92677bee67da5ee8a5faa0690f82
See build/soong/README.md for more information.
Note: tests/ImfTest/Android.mk causes conflict as it hasn't been yet
ported to internal master. Do it later.
Note: the conversion in the following directories has to be done in the
internal master first because of the conflicts:
* tests/ActivityManagerPerfTests
* tests/AppLaunch
* tests/AppLaunchWear
* tests/BackgroundDexOptServiceIntegrationTests
* tests/Camera2Tests/CameraToo
* tests/Camera2Tests/SmartCamera/SimpleCamera
* tests/Compatibility
* tests/Internal
* tests/RcsTests
* tests/ServiceCrashTest
* tests/UsbTests
Bug: 122332340
Test: treehugger
Change-Id: Ie17590c6a96aee5caa80d38092a3de5c1b6efe8d
The presense of these files hinders the conversion of the makefiles
to the blueprints (causes failure in the internal builds due to lacking
files).
Bug: 122332340
Test: treehugger
Change-Id: I2a3c38cbba7c14ae1b2880c73c7f6514816f0e68
IME window is attached to the IME target if possible. This ensures
a smooth enter/exit animation when the activity is coming in/going
away.
Furthermore, if the controlling window doesn't span the entire
display, we can't offer controlling it in a frame-by-frame
manner, and we need to do the inset calculations relative to the
display frame.
Test:
adb shell setprop persist.wm.new_insets 1
adb shell setprop persist.pre_render_ime_views 0
Test: Open IME, go home, reopen app
Test: Show dialog with EditText
Bug: 111084606
Change-Id: Id40470f6f8284b48acfa4719049afd14fde332d6
The JUnit filter com.android.test.filters.SelectTest is a generic test
filter that can supersede |-e package| and |-e class| options of
AndroidJUnitRunner.
The com.android.server.wm.test.filters.CoreTestsFilter extends SelectTest
filter to filter out Window Manager Service releated tests in
FrameworksCoreTests.
Bug: 122451194
Test: Can select some tests from WmTests.
$ adb shell am instrument -w \
-e filter com.android.test.filters.SelectTest \
-e selectTest com.android.test.filters.,com.android.server.wm.DummyTests \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Test: CoreTestsFilter works for FrameworksCoreTests.
$ adb shell am instrument -w \
-e filter com.android.server.wm.test.filters.CoreTestsFilter \
-e selectTest_verbose true \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: Ic72637997bf17debef914e2596049f6cf3e753de
Merged-In: Ic72637997bf17debef914e2596049f6cf3e753de
This is a follow up of Ic72637997bf17debef914e2596049f6cf3e753de
Bug: 122451194
Test: atest FrameworksServicesTests:com.android.test.filters.SelectTestTests
Change-Id: I61c5837a097451a204e9602476c68fdda4fc30be
The JUnit filter com.android.test.filters.SelectTest is a generic test
filter that can supersede |-e package| and |-e class| options of
AndroidJUnitRunner.
The com.android.server.wm.test.filters.CoreTestsFilter extends SelectTest
filter to filter out Window Manager Service releated tests in
FrameworksCoreTests.
Bug: 122451194
Test: Can select some tests from WmTests.
$ adb shell am instrument -w \
-e filter com.android.test.filters.SelectTest \
-e selectTest com.android.test.filters.,com.android.server.wm.DockedStackDividerControllerTests \
com.android.frameworks.wmtests/androidx.test.runner.AndroidJUnitRunner
Test: CoreTestsFilter works for FrameworksCoreTests.
$ adb shell am instrument -w \
-e filter com.android.server.wm.test.filters.CoreTestsFilter \
-e selectTest_verbose true \
com.android.frameworks.coretests/androidx.test.runner.AndroidJUnitRunner
Change-Id: Ic72637997bf17debef914e2596049f6cf3e753de
Use androidx.test not android.support.test.
And remove android.support.test from build by removing unnecessary
frameworks-base-testutils > android.support.test dependency
Bug: 117990406
Test: m checkbuild; atest FrameworksServicesTests:StorageManagerServiceTest
Change-Id: Ia825e0926b46855f9056739441cb21a065692076