Commit Graph

9 Commits

Author SHA1 Message Date
tomnatan
4d859f35bc Handle multiple users when adding and rechecking overrides.
This is important for multi-user devices that have different
applications or versions installed for each user.

Bug: 190483583
Test: atest FrameworksServicesTests:CompatConfigTest
Test: atest FrameworksServicesTests:OverrideValidatorImplTest
Test: atest FrameworksServicesTests:PlatformCompatTest
Test: atest PlatformCompatGating:PlatformCompatPermissionsTest
Change-Id: I74c061001efbbd9699087e603a580cb2538891ec
2021-07-02 12:25:59 +00:00
Benjamin Franz
360d60d523 Add versioning to app compat framework
With this change, callers can set overrides for specific versions of an
app. The framework falls back to default version when the given version
doesn't have an override set.

Bug: 174043039
Test: atest FrameworksServicesTests:CompatConfigTest
Test: atest FrameworksServicesTests:PlatformCompatTest
Test: atest PlatformCompatGating
Change-Id: Ib5ff67e752a9c5ee94b6e1dd664d324ab5bf4542
2021-02-11 18:33:45 +00:00
Andrei Onea
c202da86ba Improve flakiness of PlatformCompatGating test
The PlatformCompatGating test did not close the ParcelFileDescriptor
opened by UIAutomation.executeShellCommand, which is the likely culprit
of the test throwing a java.io.InterruptedIOException randomly.
The documentation for executeShellCommand requires the users to do the
cleanup themselves.

Test: atest PlatformCompatGating
Bug: 178108878
Change-Id: Iaf4d82d5fe4170931d2c59f2978e545b15e940b0
2021-01-25 16:47:40 +00:00
Andrei Onea
34a78c50b0 Fix compat change CTS test flakiness
Cleanup overrides in the PlatformCompatCommandNotInstalledTest test.

Test: atest PlatformCompatCommandNotInstalledTest
Test: adb shell dumpsys platform_compat | grep override # is empty
Bug: 169235095
Change-Id: Ibd9f2801e8b4c571dca49f0682a8bc3b17ffd545
2020-09-29 17:56:40 +01:00
Winson
db4355fed9 Add am compat enable/disable/reset test for not installed app
Should also cover installed apps, since this mocks at the
ApplicationInfo level.

The not installed behavior is used during package parsing to
pre-disable validation errors for an app that may not yet be
compliant with new targetSdk gated rules.

Bug: 152416067

Test: atest com.android.tests.gating.PlatformCompatCommandNotInstalledTest

Change-Id: Id7d1ff26f40626308d9b2e7c6cea60bce9b7f50f
2020-04-01 05:44:12 +00:00
Andrei Onea
26559bcb40 Add permissions for using PlatformCompat methods
- READ_COMPAT_CHANGE_CONFIG is required to read the current state of the
config
- LOG_COMPAT_CHANGE is required to log the status of a compat change for
a package and/or uid to statsd
- OVERRIDE_COMPAT_CHANGE_CONFIG is required to add overrides

The permissions must be signature|privileged, as there are already
examples of code which this would not be sufficient (e.g.
MediaProvider).

This is a re-landing of https://r.android.com/1209240, which was
reverted due to http://b/142942524. The actual fix was done in
http://ag/10234812.


Bug: 142650523
Test: atest PlatformCompatTest
Test: atest PlatformCompatPermissionsTest
Change-Id: Ie9429477c9a1725b5cb67756787bf742038e5d2b
2020-02-06 12:22:42 +00:00
Andrei Onea
02d81c0c11 Revert "Revert submission from topic "separate-testing"."
This reverts commit 44d9a1d8dd.
Re-land testing for compatibility change gating. This should fix the art
buildbot breakage.

Bug: 140367850
Test: atest PlatformCompatGating
Test: art/tools/buildbot-build.sh --host
Change-Id: I1070e5e62aed67f1b09044b84674b06afc85c8cc
2019-11-18 20:05:54 +00:00
Roland Levillain
44d9a1d8dd Revert submission from topic "separate-testing".
Reason for revert: Breaks master-art builds with this error:

  FAILED: out/soong/.intermediates/development/build/android_stubs_current/android_common/turbine-combined/android_stubs_current.jar
  echo "module android_stubs_current missing dependencies: api-stubs-docs, framework-res" && false
  module android_stubs_current missing dependencies: api-stubs-docs, framework-res

Test: art/tools/buildbot-build.sh --host
Bug: 140367850
Change-Id: Ie05e05d305bc23ac94d19a6565bd37512a6e34c4
2019-11-15 19:27:38 +00:00
Andrei-Valentin Onea
d9f21c03e2 Re-land example for disabling changes at test time
Added Frameworks specific PlatformCompatChangeRule, which
fixes libcore tests dependency on Framework.

Test: atest PlatformCompatGating
Bug: 140367850
Change-Id: I4a97ff43d41110251473868d186462039a889e28
2019-11-14 18:45:39 +00:00