summaryrefslogtreecommitdiffstats
path: root/samples/ApiDemos
Commit message (Collapse)AuthorAgeFilesLines
* Use menu shortcuts in ApiDemosVladislav Kaznacheev2018-04-171-2/+11
| | | | | | | | | | | | Add alphabetic shortcuts to the menu in ActionBarUsage. This mirrors what is already present in a similar support lib demo. Bug: 31045453 Test: run com.example.android.apis.app.ActionBarUsage on a device with keyboard shortcuts enabled (such as Chromebook). Action menu items should display keyboard shortcuts. Change-Id: I9e6b04df8e2a6cbc728cb60b3706d054521da7cb
* Add use of PendingIntent.getForegroundService()Christopher Tate2018-03-193-0/+31
| | | | | | | | | | | | In particular, we have an example of a foreground-service PendingIntent triggered by a 15-second delayed alarm following a button click. This is enough time to exercise use cases like swiping the app out of recents before the alarm fires, therefore entering the "starting a fg service when the app is not in a fg state" flows. Bug: 73559697 Test: this is it Change-Id: If57908ab852c7a0bfab7bb1da8eda0a47493fc6b
* ApiDemos: Add maxAspectRatio demoAdrian Roos2018-03-153-0/+66
| | | | | | Bug: 72696928 Test: Install and open ApiDemos > App > Activity > Max Aspect Ratio > 1:1 / 16:9 / Any Change-Id: Ie76c8c4babd6b4c281eec8ff977a0c02a868ee0e
* Fix issue #72116995: Add permission guarding Service#startForegroundDianne Hackborn2018-03-052-112/+18
| | | | | | Bug: 72116995 Test: atest CtsAppTestCases Change-Id: I3fab8561028d5c2b54a5e8468f7ff51bcd7bc3df
* Remove deprecated android.graphics.Canvas APIsDerek Sollenberger2018-02-285-37/+5
| | | | | | Bug: 73777445 Test: compile Change-Id: I0f203dd55d15408b1ebbbbb33e0d0b53366cc241
* Fix link-type check warning on ApiDemosJiyong Park2018-02-2827-20/+7620
| | | | | | | | | | | | | | | | | | | ApiDemos has been using private APIs from telephony-common to demonstrate the Mms feature. However, this is causing link-type check warning because ApiDemos itself is built with SDK (LOCAL_SDK_VERSION is set) but telephony-common isn't. As we are working on to promote the warnings into errors, this warnings must be fixed. Fixing the warning by copying the PDU classes from telephony-common, so that there is no need to link to the library. Also the package name for the copied classes are all changed in order to prevent the collision with the same classes in telephony-common which is in the boot class path. Test: m -j ApiDemos is successful and does not show any link-type check warning. Change-Id: Ica508cd4daf3640e4f90fa26dd11dfd03867d717
* Migrate to AAPT2Alan Viverette2018-02-271-6/+9
| | | | | | Bug: 73250914 Test: make checkbuild Change-Id: I64ad5cb08aeb1e1c5cd2594dc0be1bbb105610f6
* Follow-up to I205cdc00533b19be46c7837012a96705c7a4a62fAdrian Roos2018-02-201-5/+5
| | | | | Test: mmm development/samples/ApiDemos Change-Id: I3794c3c94785c4de3b130201ff70d05dbe792256
* ApiSamples: Add PIP sampleAdrian Roos2018-02-194-0/+89
| | | | | Test: Open ApiSamples > App > Activity > Picture in Picture Change-Id: I205cdc00533b19be46c7837012a96705c7a4a62f
* Revert "Fix issue #72116995: Add permission guarding Service#startForeground"Ian Pedowitz2018-02-122-18/+112
| | | | | | | | | | This reverts commit 7890baea48dba67c3c4aa2b07709ead409f16240. Reason for revert: b/73224471 Bug: 73224471 Bug: 72116995 Change-Id: Ife5dc5c14026ae7dcb126b0b3c3e7701ed3eaebe
* Fix issue #72116995: Add permission guarding Service#startForegroundDianne Hackborn2018-02-072-112/+18
| | | | | | Bug: 72116995 Test: atest CtsAppTestCases Change-Id: I88e3f6f1395b7ee0c0af41c9f7e9a5971da17631
* Add while-idle alarm support to apidemosMakoto Onuki2018-01-303-1/+21
| | | | | | Test: Manual test Bug: 72124522 Change-Id: I9d0c0ed4b6a045e4f8f566c4e9844290e850e2fc
* Revert "Fix issue #72116995: Add permission guarding Service#startForeground"Dianne Hackborn2018-01-252-18/+112
| | | | | | | This reverts commit cbe2f1bf274a5fb31f20f6da9810c9b7552b23d4. Test: NA Bug: 72116995
* Merge "Fix issue #72116995: Add permission guarding Service#startForeground"Dianne Hackborn2018-01-242-112/+18
|\
| * Fix issue #72116995: Add permission guarding Service#startForegroundDianne Hackborn2018-01-212-112/+18
| | | | | | | | | | | | Bug: 72116995 Test: atest CtsAppTestCases Change-Id: Ib8471d514bc2c126c34a867ca8ff77d90be9661e
* | Use stubs libs for android.test.base/runner/mockJiyong Park2018-01-241-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | android.test.base/runner/mock libraries are shared libraries that are built without SDK, but with framework interanl libraries (framework.jar, etc). Apps or libs that are built with SDK (LOCAL_SDK_VERSION is set) shouldn't use them, but instead the stubs version of the test framework libraries, which are built using SDK. This is because, the build system does not allow a module built with SDK to depend on another module built without SDK. This has been exceptionally allowed with warnings, but will soon be errors. In order to prevent the expected build breakage, direct reference to the shared libraries are all changed to the stubs libraries. Note: no one has been using these shared libs statically. So, it is guaranteed that they won't encounter a problem due to missing <uses-library name="android.test.runner"/> even after this change. Bug: 69899800 Test: m -j checkbuild Change-Id: I7f25e0127c52c56adf288163a760f3dc9aee6586
* Merge "Clarified conditions that require client-side unbindService() call." ↵Kevin Hufnagle2018-01-171-0/+1
|\ | | | | | | | | | | | | | | into oc-mr1-dev-plus-aosp am: d1cd393c57 Change-Id: Id0fb13a23d37ae92844a99f1b81050527b556a53
| * Clarified conditions that require client-side unbindService() call.Kevin Hufnagle2018-01-101-19/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for android.app.Service includes an example from LocalServiceActivities.java. This example now better shows and explains the distinction between binding and connecting. It also shows the set of conditions that require the client to call unbindService(). Test: make ds-docs -j16 Bug: 63118511 Change-Id: I1276de3f9421e13e1964039d37db9adc87f3039f
* | Clarified conditions that require client-side unbindService() call.Kevin Hufnagle2018-01-091-20/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for android.app.Service includes an example from LocalServiceActivities.java. This example now better shows and explains the distinction between binding and connecting. It also shows the set of conditions that require the client to call unbindService(). Test: make ds-docs -j16 Bug: 63118511 Change-Id: I1276de3f9421e13e1964039d37db9adc87f3039f
* | Merge "Docs: Moved // BEGIN_INCLUDE a few lines up so readers understand the ↵Jon Dormody2017-12-222-6/+7
|\| | | | | | | | | | | | | | | context of the Binding class (it's an inner-class)" into oc-mr1-dev am: 4204ce2ae1 am: 05e8c5bcf9 Change-Id: Id058d0ef9d65fe6a907860ac28fcf3caed2b1464
| * Docs: Moved // BEGIN_INCLUDE a few lines up so readers understand theJonathan Dormody2017-12-212-6/+7
| | | | | | | | | | | | | | | | | | context of the Binding class (it's an inner-class) Test: make ds-docs Bug: 2781699 Change-Id: I90c70f9b9f918a941c719e8b020b3c69f826cd43
* | Add android.test.base/stubs dependencyPaul Duffin2017-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Add an ApiDemo for showing an overlay window."Peter Visontay2017-12-143-0/+180
|\ \
| * | Add an ApiDemo for showing an overlay window.Peter Visontay2017-12-123-0/+180
| | | | | | | | | | | | | | | Test: manually. Change-Id: I9eaa9c0eeb3bc04389c27a7fe5e74fc5acdc59fd
* | | Merge "Stop statically including legacy-android-test"Paul Duffin2017-12-121-1/+1
|\ \ \
| * | | Stop statically including legacy-android-testPaul Duffin2017-12-121-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* / / Use FileProvider (instead of a world-readable file) in the APK installer demo.Peter Visontay2017-12-123-6/+58
|/ / | | | | | | | | | | | | World-readable files have been disallowed since N. Test: Manually. Change-Id: Iab174799403023378200d75dac5e8cd02e64dbf8
* | Remove obsolete code from the InstallApk API demo.Peter Visontay2017-11-172-47/+3
| | | | | | | | | | | | | | | | 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
* | Merge "Update the HelloActivity.apk bundled with ApiDemos, used to ↵Peter Visontay2017-11-171-0/+0
|\ \ | | | | | | | | | demonstrate the package installer API."
| * | Update the HelloActivity.apk bundled with ApiDemos, used to demonstrate the ↵Peter Visontay2017-11-151-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add a demo of the Session-based PackageInstaller to ApiDemos.Peter Visontay2017-11-166-4/+198
|/ / | | | | | | | | Test: Manually. Change-Id: If084477e8970777ef5cd90c55afe86a116ee1458
* / Added autofill tags on dialog sample.Felipe Leme2017-11-082-3/+7
|/ | | | | | | Bug: 68816440 Test: mmm -j50 development/samples/ApiDemos && adb install -r $OUT/data/app/ApiDemos/ApiDemos.apk Change-Id: Ia7514ba3edb7e057fe8490079856d0a233c77fcd
* Merge "Replace fonts of unclear origin" into oc-devClara Bayarri2017-06-073-9/+200
|\ | | | | | | | | | | am: ac2a416a5b Change-Id: I5592ae97240969a7cc68f38a1599c50bc03322f2
| * Replace fonts of unclear originClara Bayarri2017-06-013-9/+200
| | | | | | | | | | | | | | | | | | 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
* | Add sample for enqueuing work in a job.Dianne Hackborn2017-04-225-0/+327
|\| | | | | | | | | | | am: 5229a90146 Change-Id: Idc0461e19fd7e14e2a41940b0db8a64f995d6db2
| * Add sample for enqueuing work in a job.Dianne Hackborn2017-04-215-0/+327
| | | | | | | | | | | | | | | | | | | | Basically this is to have sample code to include in the java docs. Bug: 37544153 API Review: JobWorkItem Test: none Change-Id: Ie4ed3ce4af8239010da2647fab00ed2aadb1d348
* | Merge "Add ApiDemos to device-tests as it's needed by ↵Dan Shi2017-04-051-0/+2
|\ \ | |/ |/| | | | | | | | | | | JankMicroBenchmarkTests" am: 285aca0218 am: d5f5352f05 am: 6749625947 Change-Id: I9afb2edfa21fa91dfd29561b1fcc0b7a2beaaa8d
| * Add ApiDemos to device-tests as it's needed by JankMicroBenchmarkTestsDan Shi2017-03-311-0/+2
| | | | | | | | | | | | | | | | | | | | 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
* | Merge "Update DocumentsContract call."Ben Lin2017-03-131-5/+32
|\ \
| * | Update DocumentsContract call.Ben Lin2017-03-091-5/+32
| | | | | | | | | | | | | | | | | | Test: Builds properly. Bug: 36023174 Change-Id: I6d8c604a9660741dda1c997f949efd0f570cc506
* | | Merge "Renaming Czech Republic to Czechia." am: a824f044c3 am: e7b9cff32eJoachim Sauer2017-03-082-2/+2
|\ \ \ | |/ / |/| / | |/ | | | | am: cb632200b0 Change-Id: I79436472ad4a60803db657cbf82b2cde008558a2
| * Merge "Renaming Czech Republic to Czechia."Joachim Sauer2017-03-082-2/+2
| |\
| | * Renaming Czech Republic to Czechia.Fredrik Roubert2017-02-232-2/+2
| | | | | | | | | | | | | | | | | | Bug: 34964100 Test: n/a Change-Id: I711723923cefa88c99585518b085a2c8df076b7d
* | | Merge "Prepare for removal of junit and android.test classes from Android ↵Paul Duffin2017-03-031-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | API (step 1)" am: f2d90cc8d8 am: b017d07b78 am: 18c0851a12 Change-Id: I2dead96af0552919fb06c5298a28034121afa2f0
| * | Prepare for removal of junit and android.test classes from Android API (step 1)Paul Duffin2017-03-011-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for removing junit and android.test classes from the Android API this change adds explicit dependencies on junit and/or legacy-android-test to ensure that modules will compile properly once it is removed. Care was taken to ensure that any targets that depended, directly or indirectly, on android-support-test did not also depend on junit or hamcrest as they conflict with the versions embedded within android-support-test. Bug: 30188076 Test: make checkbuild Change-Id: I03f7836a1081acda5ed2c6e43cb24e9dc23b944c
* | Stop screen sharing when exiting MediaProjectionDemo.Bryce Lee2017-02-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | The existing implementation will leave screen sharing running after stop, causing the VirtualDisplay to not be destroyed. This change makes sure any screen sharing ends on stop. This change also addresses the the ToggleButton's state being saved. Test: manual Bug: 26221019 Change-Id: I51ac8bf09932a83100776c919146eed8c28f35b3
* | Add Pointer capture demo to APIDemosVladislav Kaznacheev2017-01-271-111/+136
| | | | | | | | | | | | Bug: 30897034 Test: manually in ApiDemos > Graphics > OpenGL ES > Touch Rotate Change-Id: Id87b17938cf876b4886de69ffaa8a2b3c4f27143
* | API demo for notification that starts a background service.Dianne Hackborn2017-01-234-0/+149
| | | | | | | | | | | | Test: not relevant Change-Id: I9ad6640dccded3be0baf879a6694f9535144d80c
* | Rename View.setTooltip/getTooltip to setTooltipText/getTooltipTextVladislav Kaznacheev2017-01-192-9/+9
| | | | | | | | | | | | Bug: 34454987 Test: adb shell am start -n com.example.android.apis/.view.Tooltips Change-Id: I16156e5b928202f50f7290ff30ad36aa80d615d2
* | Correct string resources for tooltips demo in ApiDemosVladislav Kaznacheev2016-12-221-3/+3
| | | | | | | | | | | | Bug: None Test: manual Change-Id: I7bea1d0beb0ec94217fa6aa30c11c32702cd05ba