Commit Graph

3501 Commits

Author SHA1 Message Date
Paul Duffin
4fe452b0e7 Add android.test.base/stubs dependency
In preparation for the removal of the non-junit classes in the
android.test.base library from the android.jar this adds a dependency
on android.test.base/stubs to ensure this code will continue to
compile.

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.

* samples/ApiDemos/tests/Android.mk
    Added 'android.test.base.stubs' to LOCAL_JAVA_LIBRARIES because
    ApiDemosTests's will need them in order to compile once its classes
    are removed from the current SDK on which it currently depends.

* samples/BrokenKeyDerivation/tests/Android.mk
    Added 'android.test.base.stubs' to LOCAL_JAVA_LIBRARIES because
    BrokenKeyDerivationTests's will need them in order to compile once
    its classes are removed from the current SDK on which it currently
    depends.

* samples/HelloActivity/tests/Android.mk
    Added 'android.test.base.stubs' to LOCAL_JAVA_LIBRARIES because
    HelloActivityTests's will need them in order to compile once its
    classes are removed from the current SDK on which it currently
    depends.

* samples/LunarLander/tests/Android.mk
    Added 'android.test.base.stubs' to LOCAL_JAVA_LIBRARIES because
    LunarLanderTests's will need them in order to compile once its
    classes are removed from the current SDK on which it currently
    depends.

* samples/SkeletonApp/tests/Android.mk
    Added 'android.test.base.stubs' to LOCAL_JAVA_LIBRARIES because
    SkeletonAppTests's will need them in order to compile once its
    classes are removed from the current SDK on which it currently
    depends.

* samples/Snake/tests/Android.mk
    Added 'android.test.base.stubs' to LOCAL_JAVA_LIBRARIES because
    SnakeTests's will need them in order to compile once its classes
    are removed from the current SDK on which it currently depends.

* samples/Vault/Android.mk
    Added 'android.test.base.stubs' to LOCAL_JAVA_LIBRARIES because
    Vault's will need them in order to compile once its classes are
    removed from the current SDK on which it currently depends.

Bug: 30188076
Test: make dist
Change-Id: Id7fb558504706668a85bf840529f6cd075499d6a
2017-12-15 07:22:37 +00:00
Peter Visontay
e746637688 Merge "Add an ApiDemo for showing an overlay window." 2017-12-14 14:02:53 +00:00
Paul Duffin
ec8144a066 Merge "Stop statically including legacy-android-test" 2017-12-12 20:11:25 +00:00
Peter Visontay
48f2a3142e Use FileProvider (instead of a world-readable file) in the APK installer demo.
World-readable files have been disallowed since N.

Test: Manually.
Change-Id: Iab174799403023378200d75dac5e8cd02e64dbf8
2017-12-12 18:16:29 +00:00
Peter Visontay
ad360d40be Add an ApiDemo for showing an overlay window.
Test: manually.
Change-Id: I9eaa9c0eeb3bc04389c27a7fe5e74fc5acdc59fd
2017-12-12 15:44:02 +00:00
Paul Duffin
aa592fea27 Stop statically including legacy-android-test
Statically including legacy-android-test leads to duplicate classes
which causes build time problems (with Proguard) and runtime problems on
older SDK versions. This change:
* Stops statically including legacy-android-test.
* Adds compile time dependencies on andoid.test.base, android.test.mock
  and android.test.runner where necessary.
* Adds <uses-library android:name="android.test.runner"/> to any
  affected package to ensure that the classes that were included by
  legacy-android-test are still available at runtime. That also adds a
  dependency on android.test.base and android.test.mock.

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.

* samples/ApiDemos/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in ApiDemosTests results
    in duplicate classes which leads to build time and compile time
    issues.

* samples/BrokenKeyDerivation/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in
    BrokenKeyDerivationTests results in duplicate classes which leads
    to build time and compile time issues.

* samples/HelloActivity/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in HelloActivityTests
    results in duplicate classes which leads to build time and compile
    time issues.

* samples/LunarLander/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in LunarLanderTests
    results in duplicate classes which leads to build time and compile
    time issues.

* samples/SkeletonApp/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SkeletonAppTests
    results in duplicate classes which leads to build time and compile
    time issues.

* samples/Snake/tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SnakeTests results in
    duplicate classes which leads to build time and compile time
    issues.

* samples/Vault/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in Vault results in
    duplicate classes which leads to build time and compile time
    issues.

    Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
    Vault's source depends on its classes and because of these changes
    they are no longer present on the compilation path.

* samples/Vault/AndroidManifest.xml
    Add uses-library for android.test.runner because otherwise this
    change would change the set of files available to Vault at runtime.

Bug: 30188076
Test: make checkbuild
Change-Id: I9f42f9216b7a40f1f139699e9c4df04325d577a1
2017-12-12 15:24:57 +00:00
Paul Duffin
50840e6a26 Flatten dependency hierarchy of legacy-android-test
Previous changes statically included legacy-android-test in preparation
for removing android.test.* and junit.* classes from the android.jar.
Unfortunately, that lead to duplicate classes between APKs and the
bootclasspath which caused build problems (Proguard) and also runtime
problems (when targeting and running on older releases).

Switching from statically including the classes to using the runtime
libraries cannot be done in one step because legacy-android-test is
statically included in libraries which are used in many APKs and so
removing it from those libraries requires that all APKs be updated at
once. Doing that atomically across dozens of projects is not practical.

This change modifies APKS that statically include the
legacy-android-test library indirectly.

* If the APK manifest uses the android.test.runner library then the APK
  is modified to stop statically including legacy-android-test and
  instead build against android.test.base/mock/runner libraries instead.

* Otherwise, the APK statically includes legacy-android-test.

Also, any libraries that statically include are modified to stop
statically including it and if it has source dependencies on the classes
is changed to build against the android.test.base/mock/runner libraries.

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.

* samples/UiAutomator/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    uiautomator.samples has a source dependency on its classes

Bug: 30188076
Test: make checkbuild
Change-Id: I07b9638373eae0e36c365b604748b1279793620b
2017-12-08 23:43:32 +00:00
Peter Visontay
6b7860e588 Remove obsolete code from the InstallApk API demo.
1) Remove the "Refresh package" demo. This was using Intent.EXTRA_ALLOW_REPLACE, which was deprecated in API 16.
2) Java code cleanup.

Test: Manually.
Change-Id: I0cbff934ca223a3fe73a1044ed68f3e079be8237
2017-11-17 10:00:02 +00:00
Peter Visontay
5425b98c78 Merge "Update the HelloActivity.apk bundled with ApiDemos, used to demonstrate the package installer API." 2017-11-17 09:55:46 +00:00
Peter Visontay
75bca25be1 Add a demo of the Session-based PackageInstaller to ApiDemos.
Test: Manually.
Change-Id: If084477e8970777ef5cd90c55afe86a116ee1458
2017-11-16 21:49:17 +00:00
Peter Visontay
78f7e6b048 Update the HelloActivity.apk bundled with ApiDemos, used to demonstrate the package installer API.
The current APK was built to target the ICS SDK, and cannot be installed on newer versions:
"Failure [INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl1087711068.tmp/base.apk (at Binary XML file line #0): Requires development platform IceCreamSandwich (current platform is any of [P])]"

The APK I'm checking in was built from development/samples/HelloActivity, with this added to the manifest:
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23" />
This is the same as the ApiDemos app's minSdk and targetSdk.

Test: Manually rebuilt ApiDemos, and installed the package using the InstallApk activity.
Change-Id: I337200234662277b0253fd7fdfa96e1ee229e912
2017-11-15 17:48:20 +00:00
Fyodor Kupolov
e454568215 Merge "APK Cache Demo App" am: cd3a0fe97c am: 09408cb0e6
am: 2d5e4260ef

Change-Id: Ie80183e6e47e9a79a6cd37b69a7af85875fd38c4
2017-11-13 22:44:55 +00:00
Fyodor Kupolov
2d5e4260ef Merge "APK Cache Demo App" am: cd3a0fe97c
am: 09408cb0e6

Change-Id: I04a47027504c8e6c7c292ee940ba11fe082fac20
2017-11-13 22:41:47 +00:00
Fyodor Kupolov
cd3a0fe97c Merge "APK Cache Demo App" 2017-11-13 22:33:17 +00:00
Felipe Leme
e47849665c Added autofill tags on dialog sample.
Bug: 68816440
Test: mmm -j50 development/samples/ApiDemos && adb install -r $OUT/data/app/ApiDemos/ApiDemos.apk

Change-Id: Ia7514ba3edb7e057fe8490079856d0a233c77fcd
2017-11-08 12:53:55 -08:00
Chih-Hung Hsieh
64fb92956b Merge "Use -Werror in development" am: 14b2eeb009 am: cee88a6a9a
am: a38ca6bb58

Change-Id: I2ad9578e5185253478dd28c5b9e24ba539149036
2017-10-28 00:29:04 +00:00
Chih-Hung Hsieh
a38ca6bb58 Merge "Use -Werror in development" am: 14b2eeb009
am: cee88a6a9a

Change-Id: I04f10d5d80f6ca8c58ad5ba609b95ba98507b250
2017-10-27 23:57:58 +00:00
Chih-Hung Hsieh
62f253dc80 Use -Werror in development
* Fix/suppress existing warnings.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Iacc9052f81e6fe7e8a10b00a6fcea912a7d636d3
2017-10-27 14:43:17 -07:00
Makoto Onuki
8671b509d1 Generate the shortcut sample app with different version numbers
Test: manual
Change-Id: Ic86b2d33ee37655104809bc8e9cefe1379f9c905
2017-10-05 09:13:54 -07:00
Fyodor Kupolov
d704ae2552 APK Cache Demo App
Simple app that lists files in the app's preloaded cache directory.
(/data/preloads/file_cache/com.android.apkcachetest)

Test: make ApkCacheTest
Bug: 38434471
Change-Id: Ia98650e41bc383d45ebf620bc065deb68076a75f
2017-08-03 00:01:09 +00:00
Mathieu Chartier
8f85766087 Disable proguard for BusinessCard app
Otherwise the com.example.android.businesscard.ContactAccessorSdk*
classes get removed by proguard. This cause a class not found
exception during app launch.

Bug: 62554875
Test: launch the app

Change-Id: Ic3d44b50f51be6514fd6af822717e0864a6126db
2017-07-25 14:46:57 -07:00
Willie Koomson
c1247c43a8 Merge "The base files for the project & activities and XML resources Test: build and run manually Change-Id: I6eb7f1a444703e99f592ac9106261f9c6bd90127" 2017-07-13 21:22:27 +00:00
Willie Koomson
2bf50179b3 The base files for the project & activities and XML resources
Test: build and run manually
Change-Id: I6eb7f1a444703e99f592ac9106261f9c6bd90127
2017-07-12 12:08:15 -07:00
Makoto Onuki
c27bcaea5d Sample authenticator that creates a "DPM-whitelisted" account.
This account will not prevent a test-only DO/PO from being activated.

Test: Manual test
Change-Id: I6407c8c85b4476436db3379752488557d58bc617
2017-07-11 10:23:36 -07:00
Clara Bayarri
e38828eaac Merge "Replace fonts of unclear origin" into oc-dev
am: ac2a416a5b

Change-Id: I5592ae97240969a7cc68f38a1599c50bc03322f2
2017-06-07 16:42:27 +00:00
TreeHugger Robot
ac2a416a5b Merge "Replace fonts of unclear origin" into oc-dev 2017-06-07 16:36:48 +00:00
Makoto Onuki
c6df549cdd Merge "Use support lib shortcut manager in sample apps" into oc-dev
am: b0bcb8f365

Change-Id: I4d0ddab6405fe8990cab0de1e0a38e0060e74163
2017-06-06 16:27:56 +00:00
Clara Bayarri
a3516bc957 Replace fonts of unclear origin
The font being used in the ApiDemos is of unclear origin, replace
it with a font we created. Also cleanup the code around it

Test: manual
Bug: 37726227
Change-Id: I7e30c3afddc731473c9bbe5a767fa0e1144a20d6
2017-06-01 11:08:13 +01:00
Makoto Onuki
8c445e5b1f Use support lib shortcut manager in sample apps
Bug 62193112
Test: manual

Change-Id: I157f13b4fffbe5ffd48cf97094362ae1be1c0658
2017-05-30 16:37:49 -07:00
Makoto Onuki
19e43703e1 The test launcher should work on N-MR2 too.
am: d057d9f027

Change-Id: I22f37a4b2b7dccfde2ca3a42a748188982ac48ee
2017-05-16 21:13:21 +00:00
Makoto Onuki
d057d9f027 The test launcher should work on N-MR2 too.
Fixes 38345873
Test: manual
Change-Id: I72cedfe860c0c57672d057b209df03917ed6411c
2017-05-16 12:07:57 -07:00
Wale Ogunwale
b9ed669d6b Commented out caption API.
am: bbfa17e179

Change-Id: Iec508f2049825077088dccd830e11523112ebbd3
2017-04-25 02:29:57 +00:00
Wale Ogunwale
bbfa17e179 Commented out caption API.
Not ready inO. May you have better luck in P!

Test: N/A
Change-Id: I9489b14e41845b2aca522d8ab5058b895845e3ae
2017-04-24 19:23:33 -07:00
Dianne Hackborn
d1035aead1 Add sample for enqueuing work in a job.
am: 5229a90146

Change-Id: Idc0461e19fd7e14e2a41940b0db8a64f995d6db2
2017-04-22 00:37:41 +00:00
Dianne Hackborn
5229a90146 Add sample for enqueuing work in a job.
Basically this is to have sample code to include in the java docs.

Bug: 37544153  API Review: JobWorkItem

Test: none

Change-Id: Ie4ed3ce4af8239010da2647fab00ed2aadb1d348
2017-04-21 15:02:25 -07:00
Dan Shi
c3f8e12ec7 Merge "Add ApiDemos to device-tests as it's needed by JankMicroBenchmarkTests" am: 285aca0218 am: d5f5352f05
am: 6749625947

Change-Id: I9afb2edfa21fa91dfd29561b1fcc0b7a2beaaa8d
2017-04-05 00:16:08 +00:00
Dan Shi
285aca0218 Merge "Add ApiDemos to device-tests as it's needed by JankMicroBenchmarkTests" 2017-04-05 00:05:07 +00:00
Dan Shi
b73a7a2f4c Add ApiDemos to device-tests as it's needed by JankMicroBenchmarkTests
Bug: 35882476
Test: local test
make -j32 JankMicroBenchmarkTests ApiDemos  && \
tradefed.sh run template/local --template:map test=JankMicroBenchmarkTests \
      --test-tag testname --log-level-display VERBOSE

Change-Id: I6d6eceaaefa1d78656630e950022e3b1636b6f05
2017-03-31 23:07:09 -07:00
Makoto Onuki
2d11c909ea Merge "Fix potential NPE and also add more log." into oc-dev
am: b57ce71006

Change-Id: I70e86c3620de8a06ba167522af0096a2319f19e3
2017-03-30 22:55:58 +00:00
Makoto Onuki
4ddd7cecca Fix potential NPE and also add more log.
Test: Manual test, launch, tc.

Change-Id: I9e540ee8a0daa540ef1cc1b02a9a46c772773586
2017-03-30 13:26:14 -07:00
Robin Lee
739b274dfb Merge "Make ToyVpn a little more realistic" am: 5387f7163d am: e58f77f2f3
am: 40458405a3

Change-Id: I76de3ae554d029c4b0ad9e999cf0d99a5269c5cf
2017-03-28 16:25:52 +00:00
Robin Lee
e58f77f2f3 Merge "Make ToyVpn a little more realistic"
am: 5387f7163d

Change-Id: I5ce97f677253a310048074601f6308d5db6ce1c6
2017-03-28 16:17:50 +00:00
Robin Lee
72f57c9946 Make ToyVpn a little more realistic
Now it shows how to:
- start as an always-on VPN.
- take over the last connection using protect().

Bug: 35802839
Test: manual connection
Change-Id: I4699afbcf4bd0933dbeb3bf77a2d91f49d6ede1d
2017-03-28 14:53:09 +01:00
TreeHugger Robot
62e6b0467b Merge "Change the AdaptiveIconSample to use mipmap-anydpi directory for AdaptiveIconDrawable location Bug: 36068314 Bug: 35908647 Bug: 35400815 Test: manual" 2017-03-13 20:04:08 +00:00
Ben Lin
77e01745b8 Merge "Update DocumentsContract call." 2017-03-13 17:27:18 +00:00
Hyunyoung Song
db94008bc6 Change the AdaptiveIconSample to use mipmap-anydpi directory for AdaptiveIconDrawable location
Bug: 36068314
Bug: 35908647
Bug: 35400815
Test: manual

Change-Id: Icc20f1d0989e2bca2ad1c3b484a60d99dfcc5d8c
2017-03-12 23:36:58 -07:00
Ben Lin
9cf5fd65aa Update DocumentsContract call.
Test: Builds properly.
Bug: 36023174
Change-Id: I6d8c604a9660741dda1c997f949efd0f570cc506
2017-03-09 11:04:44 -08:00
Joachim Sauer
96f6845b80 Merge "Renaming Czech Republic to Czechia." am: a824f044c3 am: e7b9cff32e
am: cb632200b0

Change-Id: I79436472ad4a60803db657cbf82b2cde008558a2
2017-03-08 17:49:22 +00:00
Joachim Sauer
e7b9cff32e Merge "Renaming Czech Republic to Czechia."
am: a824f044c3

Change-Id: Iaa98ab9b06edc1adc70bf3a4661069eed9c6f05b
2017-03-08 17:38:52 +00:00
Joachim Sauer
a824f044c3 Merge "Renaming Czech Republic to Czechia." 2017-03-08 17:31:27 +00:00