Commit Graph

913 Commits

Author SHA1 Message Date
Dianne Hackborn
0d3c8bac64 Revert "Fix issue #72116995: Add permission guarding Service#startForeground"
This reverts commit cbe2f1bf27.

Test: NA
Bug: 72116995
2018-01-25 12:55:58 -08:00
Dianne Hackborn
79651091b3 Merge "Fix issue #72116995: Add permission guarding Service#startForeground" 2018-01-24 17:58:49 +00:00
Jiyong Park
8c8cb53a4f Use stubs libs for android.test.base/runner/mock
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
2018-01-24 15:21:38 +09:00
Dianne Hackborn
cbe2f1bf27 Fix issue #72116995: Add permission guarding Service#startForeground
Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: Ib8471d514bc2c126c34a867ca8ff77d90be9661e
2018-01-21 19:57:14 -08:00
Kevin Hufnagle
724482dce9 Merge "Clarified conditions that require client-side unbindService() call." into oc-mr1-dev-plus-aosp
am: d1cd393c57

Change-Id: Id0fb13a23d37ae92844a99f1b81050527b556a53
2018-01-17 01:07:20 +00:00
Kevin Hufnagle
6137a917e5 Clarified conditions that require client-side unbindService() call.
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
2018-01-10 20:47:32 -08:00
Kevin Hufnagle
50da6eb42c Clarified conditions that require client-side unbindService() call.
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
2018-01-09 15:53:58 -08:00
Jon Dormody
f99c699cac Merge "Docs: Moved // BEGIN_INCLUDE a few lines up so readers understand the context of the Binding class (it's an inner-class)" into oc-mr1-dev am: 4204ce2ae1
am: 05e8c5bcf9

Change-Id: Id058d0ef9d65fe6a907860ac28fcf3caed2b1464
2017-12-22 22:25:13 +00:00
Jonathan Dormody
a088275ef3 Docs: Moved // BEGIN_INCLUDE a few lines up so readers understand the
context of the Binding class (it's an inner-class)

Test: make ds-docs

Bug: 2781699
Change-Id: I90c70f9b9f918a941c719e8b020b3c69f826cd43
2017-12-21 10:39:25 -07:00
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
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
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
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
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
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
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
Ben Lin
77e01745b8 Merge "Update DocumentsContract call." 2017-03-13 17:27:18 +00: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
a824f044c3 Merge "Renaming Czech Republic to Czechia." 2017-03-08 17:31:27 +00:00
Paul Duffin
061c702dae Merge "Prepare for removal of junit and android.test classes from Android API (step 1)" am: f2d90cc8d8 am: b017d07b78
am: 18c0851a12

Change-Id: I2dead96af0552919fb06c5298a28034121afa2f0
2017-03-03 10:06:33 +00:00
Paul Duffin
3a87d4fea4 Prepare for removal of junit and android.test classes from Android API (step 1)
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
2017-03-01 13:21:09 +00:00
Fredrik Roubert
3e55022b86 Renaming Czech Republic to Czechia.
Bug: 34964100
Test: n/a
Change-Id: I711723923cefa88c99585518b085a2c8df076b7d
2017-02-23 17:30:02 +01:00
Bryce Lee
f7a0b42d09 Stop screen sharing when exiting MediaProjectionDemo.
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
2017-02-16 14:09:43 -08:00
Vladislav Kaznacheev
5dab9f1f4f Add Pointer capture demo to APIDemos
Bug: 30897034
Test: manually in ApiDemos > Graphics > OpenGL ES > Touch Rotate
Change-Id: Id87b17938cf876b4886de69ffaa8a2b3c4f27143
2017-01-27 09:05:41 -08:00
Dianne Hackborn
8a416b3033 API demo for notification that starts a background service.
Test: not relevant

Change-Id: I9ad6640dccded3be0baf879a6694f9535144d80c
2017-01-23 14:20:03 -08:00
Vladislav Kaznacheev
0f87eb452f Rename View.setTooltip/getTooltip to setTooltipText/getTooltipText
Bug: 34454987
Test: adb shell am start -n com.example.android.apis/.view.Tooltips
Change-Id: I16156e5b928202f50f7290ff30ad36aa80d615d2
2017-01-19 11:05:47 -08:00
Vladislav Kaznacheev
e4b96eb9fc Correct string resources for tooltips demo in ApiDemos
Bug: None
Test: manual
Change-Id: I7bea1d0beb0ec94217fa6aa30c11c32702cd05ba
2016-12-22 14:47:50 -08:00
TreeHugger Robot
3d87989183 Merge "Add tooltip demo to ApiDemos" 2016-11-22 22:15:47 +00:00
Vladislav Kaznacheev
922dea9376 Add tooltip demo to ApiDemos
Test: launch com.example.android.apis.view.Tooltips
Bug: 31515376
Change-Id: I5456740c4e93105c5058c198b22f4fd7634f3b46
2016-10-20 15:28:25 -07:00
Robert Carr
bde918648d API Demos: Specify rotation animation in manifest
Just an example of specifying rotation animation
in manifest.

Test: Try running the activity and verify the rotation animation is crossfade
Change-Id: I4481c0fd317fa4f472822159288bd5521cc52ec2
2016-10-19 14:49:18 -07:00
Robert Carr
3ca1a928a4 Include seamless rotation mode in API Demo.
Test: Try the RotationAnimation activity of API demos.
Change-Id: I4f3aba54d310ecbe06776190a4096c71fdf85d24
2016-10-18 14:42:10 -07:00
Dianne Hackborn
747849e01a Add API demo for running multiple foreground services. am: 9302998b13
am: d9cdb23133

Change-Id: Ied29cf6325a76169b68b91a19fcebbb66b9a70b1
2016-08-02 17:21:38 +00:00
Dianne Hackborn
9302998b13 Add API demo for running multiple foreground services.
Change-Id: I44435f6e7750ccbbadf5e293dd10069c6cef94a4
2016-08-01 17:52:18 -07:00
Dianne Hackborn
9060270b1a Merge "Fix issue #29058724: Improve JobScheduler API demo" into nyc-dev
am: e3d3154c1a

* commit 'e3d3154c1ad7cfd2543bb839623646b942714908':
  Fix issue #29058724: Improve JobScheduler API demo

Change-Id: I671396349d2342c1dc9cd50020281f9711b6d8af
2016-06-01 22:42:35 +00:00
Dianne Hackborn
1f502540b7 Fix issue #29058724: Improve JobScheduler API demo
Change-Id: I551d4d3376e522ee2d790331e8f83711450c9d19
2016-05-31 18:03:28 -07:00
Michael Wright
095780b610 Merge "DO NOT MERGE Remove Pointer Capture API." into nyc-dev
am: d48a67a190

* commit 'd48a67a190f785b5f5d1b41a5a8823592730deb7':
  DO NOT MERGE Remove Pointer Capture API.

Change-Id: I8c3b55f159f30405813f508bc347fe844d092d23
2016-05-26 14:25:55 +00:00
Michael Wright
d48a67a190 Merge "DO NOT MERGE Remove Pointer Capture API." into nyc-dev 2016-05-26 13:40:24 +00:00
Michael Wright
a2f5caf77e Merge "DO NOT MERGE Rename PointerIcon and Pointer Capture APIs" into nyc-dev
am: e575990583

* commit 'e575990583183fc804e1ff41e91dea8c7dd5decc':
  DO NOT MERGE Rename PointerIcon and Pointer Capture APIs

Change-Id: Ida8e72342627123b0be5976236b5a2e0ca60db13
2016-05-19 15:11:56 +00:00
TreeHugger Robot
e575990583 Merge "DO NOT MERGE Rename PointerIcon and Pointer Capture APIs" into nyc-dev 2016-05-19 15:03:35 +00:00