Commit Graph

22 Commits

Author SHA1 Message Date
Mårten Kongstad
a3bd3491cc OMS: ensure framework overlays affect newly installed apps
Make sure to tell the package manager about an application's overlay
paths if there is at least one enabled overlay affecting the
application. This includes looking at framework overlays (which affect
all applications).

Also, add a test to verify the following flow:

  - Enable an overlay targeting "android"
  - Install an app
  - Launch the newly installed app
  - Assert that the newly installed app uses the framework overlay

Also, update InstallOverlayTests#installPlatformSignedFrameworkOverlay\
AndUpdate to assert the correct resource (framework instead of app
resource).

Bug: 78808367
Test: atest 'OverlayHostTests:InstallOverlayTests#enabledFrameworkOverlayMustAffectNewlyInstalledPackage'
Change-Id: Ic3450af6c2e827efce056874606caf1d853359eb
2018-04-30 17:28:35 +01:00
jdesprez
60b0348c3d Update a bunch of AndroidTest for apct suite
Test: build device-tests
Bug: 74440293
Change-Id: I3c64eb8b5b2932632dd5dd46a5894a68a4835790
2018-03-14 10:03:56 -07:00
Anton Hansson
ab6ec61251 frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 15:13:23 +00:00
Adam Lesinski
7b03181ab1 OMS: Make updates to category not reset the overlay's state
- Also change how default overlays are applied. Apply them if no other
overlay is enabled for the same category as the default overlay.

Bug: 73740686
Test: manual
Test: adb shell rm /data/system/overlays.xml && adb reboot #verify that colors are blue
Test: adb pull /data/system/overlays.xml \
          && <edit overlay to remove categories> \
          && adb push overlays.xml /data/system/overlays.xml \
          && adb reboot # verify that colors are blue

Change-Id: If42afd287703e2e159d0087e477c19409f724124
2018-02-22 23:16:08 +00:00
Mårten Kongstad
db0e34ed83 OMS: handle overlay package upgrades, uninstalls
Teach the overlay manager about upgrades and uninstalls of overlay
packages. Add two transient overlay states STATE_TARGET_UPGRADING and
STATE_OVERLAY_UPGRADING.

Test: atest OverlayHostTests
Change-Id: I2d04204150f9e749f070b4e4363eacbd59355014
2018-02-05 19:26:24 -08:00
Adam Lesinski
c1ef447548 OMS: Migrate device tests to atest
Test: atest OverlayDeviceTests
Change-Id: Ie1040ee45e4ffef060a4e21257b0a61fd4f4c660
2018-01-24 11:30:56 -08:00
Adam Lesinski
b67fc5fbfc OMS: Enable uninstallation of overlays
Test: atest OverlayHostTests
Change-Id: I8d43f5bcad6adac9ea5dab2837f85234e6482b7b
2018-01-24 11:30:56 -08:00
Paul Duffin
aad6c9841c Merge "Build overlaytests as part of the normal build" am: ce2362fc7d am: 08d7ee4111
am: 58257c8891

Change-Id: I6ff4f390aa2e5084aab93a0a82bcdcdbebadb5f3
2017-12-01 10:44:52 +00:00
Paul Duffin
6117fa8b0f Switch usages of legacy-test to android.test.base
The legacy-test library has been deprecated in favour of the
android.test.base library which is part of the SDK.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* core/tests/overlaytests/OverlayAppFiltered/Android.mk
    Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
    for module 'com.android.overlaytest.filtered_app_overlay' does not
    depend on classes from legacy-test

* core/tests/overlaytests/OverlayAppFirst/Android.mk
    Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
    for module 'com.android.overlaytest.first_app_overlay' does not
    depend on classes from legacy-test

* core/tests/overlaytests/OverlayAppSecond/Android.mk
    Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
    for module 'com.android.overlaytest.second_app_overlay' does not
    depend on classes from legacy-test

* core/tests/overlaytests/OverlayTest/Android.mk
    Replaced 'legacy-test' with 'android.test.base' in
    LOCAL_JAVA_LIBRARIES because the source for module 'OverlayTest'
    depends on classes from android.test.base

* core/tests/overlaytests/OverlayTestOverlay/Android.mk
    Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
    for module 'com.android.overlaytest.overlay' does not depend on
    classes from legacy-test

* test-mock/Android.mk
    Removed legacy-test from LOCAL_JAVA_LIBRARIES because the source
    for module 'repackaged.android.test.mock' does not depend on
    classes from legacy-test

Bug: 30188076
Test: make checkbuild
Change-Id: I729412304884cf5da88b05dbe8fbe645ad7b5b15
2017-11-30 16:17:16 +00:00
Paul Duffin
69f9ee77c4 Build overlaytests as part of the normal build
Test: make checkbuild
Change-Id: I1ebdbfd309246b24f1f64e3555c6dfdc592b1868
2017-11-30 12:30:25 +00:00
Todd Lee
d5566c6c47 OEM single-build/multi-SKU via dynamic RRO support
The purpose here is to provide support for selectively
enabling Runtime Resource Overlays (RROs) (specifically
those pertaining to a specific SKU, within a OEM's "single
build" covering multiple SKUs) at boot based on the value
of a pre-defined system property.

This mechanism is designed to be compatible with other,
recent changes to Runtime Resource Overlays - specifically:

- has no effect on 'isStatic'. Resource overlays must be
  attributed as static in order to qualify for loading into
  the system_server. The 'requiredSystemPropertyName/
  requiredSystemPropertyValue' mechanism operates
  independent of this and can be used on both static and
  non static overlays. The effect of specifying a conditional
  property on any overlay is that it will ONLY be enabled
  in the event that the system reflects both the property
  and the specified value (Note that in the ABSENCE of a
  conditional property, overlays are assumed to be enabled).

- has no effect on OverlayManagerService (OMS) API. The
  OMS provides the system with an interface through which
  overlays can be enabled/disabled and even rearranged at
  runtime. This provides the basis of support for various
  user-level features (e.g. dynamic theme selection).
  The 'requiredSystemPropertyName/requiredSystemPropertyValue'
  mechanism operates independent of this -
  with enablement being completely coupled to the available
  system properties on the device and NOT subject to change
  at runtime.

Note: as part of this change, original overlay tests have been
updated (fixed) and expanded to include tests to cover the
conditional property implementation.

Issue: http://b/35100249
Test: frameworks/base/core/tests/overlaytests/testrunner.py

Change-Id: I1990ce21a27a385db1e2f53294b69dd03988351e
2017-04-13 19:33:11 -07:00
Stephen Smalley
415fa1f5c0 overlaytests: fix testrunner.py md5sum invocation
The overlaytests testrunner.py script wants to invoke adb shell md5sum
to compute the md5 of a file, but wrongly invokes it as md5.  Maybe
it used to have that name, but it doesn't exist under that name in master.
Fix it.

Change-Id: I3ec4be162fab0cd3915f010f9b1add37b5397973
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-06-19 14:37:58 -04:00
Mårten Kongstad
840796a3c2 RRO tests: fix potential NPE
Bug: 17765434

Check for null before closing streams.

Change-Id: I651785649575725009f270d4d8eb5f4bf90952a6
2014-11-07 16:07:21 +01:00
Mårten Kongstad
97b5df7643 RRO tests: adapt tests to split apks
The introduction of support for split apks has resulted in the move of
applications from /partition/app/pkg.apk to /partition/app/pkg/pkg.apk.
Update the RRO testrunner to use the new paths.

Bug: 17765434
Change-Id: I6eebfb6f879404077b9447c750ddc395ecd9a547
2014-11-07 16:06:18 +01:00
Adam Lesinski
e75b2c2677 Fix runtime overlay tests
The runtime overlay tests were crafting bad locales.

Change-Id: I33c87e71752756f40a954db9f01ea3cdde488a42
2014-06-17 01:22:57 +00:00
Mårten Kongstad
ad6ed950db Runtime resource overlay, iteration 2, test cases
Add automated test cases for runtime resource overlay, iteration 2.

The test cases are a mixture of 'adb shell' commands and regular
instrumentation tests. The device is rebooted between tests to setup
different overlay scenarios for framework-res.apk.

To verify Runtime resoure overlay, iteration 2, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py

For a list of supported options, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py --help

Change-Id: I692aa1a7ad073efd116b24f9ec7f197dfd65dfef
2014-02-03 11:20:33 +01:00
Jean-Baptiste Queru
647867ad5a am 63d944d6: am 93a8225e: Merge "Improve robustness of resource overlay test suite."
* commit '63d944d62e9c85e2b2aa611be1a8d5a6c6ff973f':
  Improve robustness of resource overlay test suite.
2012-05-01 10:09:21 -07:00
Jean-Baptiste Queru
39b58ba2b2 resolved conflicts for merge of bc2fb7b9 to jb-dev-plus-aosp
Change-Id: I5386585e473201268c6ed8b05e0a16569d434ea2
2012-05-01 09:54:38 -07:00
Jeff Brown
c458ce98ce Add support for using the lid switch to turn off the screen.
Added a config option to allow the lid switch to turn off the
screen.  This is a closer match to what a lid switch should be
doing.

Removed an old feature to bypass keyguard when keyboard is visible
because the way it was plumbed in made bad assumptions about
the meaning of the lid switch.  Also, the last product we shipped
that had a physical keyboard turned this config option off.
So away it goes.  We can bring it back someday if we really want it.
It's questionable how useful the feature is anyhow, since it only
works when the keyguard is unsecure and when the lid switch is
unlikely to be jostled in the user's pocket.

Fixed a bug where we would tell the power manager that the keyboard
was visible even if the lid switch did not control the keyboard.
This used to cause the power manager to try to set the keyboard
brightness, which doesn't work.

Bug: 6377115
Bug: 6406726
Change-Id: Ic84b71d09563d51c92cd1cf132fa8bdee6509103
2012-04-30 15:48:42 -07:00
Mårten Kongstad
2c7ea732a6 Improve robustness of resource overlay test suite.
Test runner will now create directory /vendor/overlay/framework, if
missing.

Also, move wallpaper from drawable to drawable-nodpi for it to actually
take effect on ICS code.

Change-Id: I7615345e847c5fca91aedc459f6aa3316a45aab5
2012-02-16 16:52:11 +01:00
Mårten Kongstad
c761d8b008 Build overlay packages just like regular packages.
Previously, building overlay packages required passing aapt its -o flag.
This commit decouples the idmap generation code from the effects of the
-o flag.

Since this commit renders the -o flag obsolete, support for the flag was
removed from aapt as well.

Change-Id: Ied2e0ab8cb800e49623f0a2044b06cd4935473d5
2012-02-07 19:14:28 +01:00
Mårten Kongstad
57f4b77c89 Runtime resource overlay, iteration 1.
Runtime resource overlay allows unmodified applications to appear
as if they had been compiled with additional resources defined. See
libs/utils/README for more information.

This commit is the first iteration of runtime resource overlay. It
provides the actual overlay modifications and loading of trusted overlay
packages (ie residing in /vendor) targeting framework-res.apk.

This commit loads exactly one overlay package. The overlay,
if present, must target framework-res.apk and be located at
/vendor/overlay/framework/framework-res.apk.

Change-Id: If26ee7754813004a96c043dba37fbe99fa3919db
2011-04-01 14:12:10 +02:00