Commit Graph

715 Commits

Author SHA1 Message Date
Jeff Sharkey
29bc7dcc26 Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Change-Id: I56dd8778516103367dc17ae55bdff4457185de46
2020-07-30 20:05:08 -06:00
Linus Tufvesson
084c24eff0 Only show Presentations on suitable displays
Bug: 141745510
Test: Manually verifed, App > Activity > Presentation
Change-Id: I0ca4c18bab97f46971ae3eae29e34e74ed6a5810
2020-07-30 13:52:05 +00:00
Nick Cook
f767eb4aa9 docs: Fix outdated sample code in Context#getExternalFilesDir.
Test: make ds-docs

Bug: 129290716
Change-Id: I0b1c1d9222c96c6bb2777f58d273546c81d77eb2
2019-08-20 00:45:50 +00:00
Ivan Chiang
2388037eac Add the sample of adding query content in intent
Add the query content in intent

Bug: 119866469
Test: manually using ApiDemos Content > Storage > Documents
Change-Id: I97ccd1ca6d3e1ecbddefe353b625c145d4c0ecd0
2018-12-27 21:35:15 +08:00
Amin Shaikh
8109cdef05 Test StorageVolume#createOpenDocumentTreeIntent
Also fix bug where persistent uri access was not taken for
OPEN_DOCUMENT_TREE intents.

Change-Id: Iccc3e2434e08e42fa84dc3ceb3fbfe1db1320180
Fixes: 119519300
Test: manually using ApiDemos Content > Storage > Documents
2018-12-18 15:06:58 -05:00
Louis Pullen-Freilich
1496f57583 Removes framework Preference demos
The framework Preference APIs are deprecated, so these samples are
misleading and should be removed.

Trying to submit again now that the relevant sample tags have been removed.

Bug: b/119602280
Test: n/a
Change-Id: I7efb509f5c938122575cf4177b50872bfc089d00
2018-11-19 18:05:33 +00:00
Louis Pullen-Freilich
4b364839bd Revert "Removes framework Preference demos"
This reverts commit 946280d6ce.

Reason for revert: Breaking builds due to doc generation using these samples

Change-Id: I7caf9792e84e0e1eedea4a7294a321c684be2d5c
2018-11-16 18:26:28 +00:00
Louis Pullen-Freilich
946280d6ce Removes framework Preference demos
The framework Preference APIs are being deprecated, so removing the
samples will help avoid confusion.

Bug: b/119602280
Test: n/a
Change-Id: Ib3a2c38b8fbb0f1afc9ef6a35963def46ee931f7
2018-11-15 12:51:50 +00:00
KOUSHIK PANUGANTI
7f203340ff Migrated various apps under development/samples/ApiDemos to androidx
Bug: 76692459
Test: make ApiDemos
Change-Id: Ie02783ba14b294a220383a3d53e96a6fdb3117b8
2018-04-24 17:13:55 -07:00
Christopher Tate
5c624704ac Merge "Add use of PendingIntent.getForegroundService()" into pi-dev am: 827c8e99ee
am: 28f6e065b8

Change-Id: I348ec6111c4edc79fa9bbab919b22a3eb0ca3e24
2018-03-21 21:27:33 +00:00
Christopher Tate
fc7c9f5d5c Add use of PendingIntent.getForegroundService()
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
2018-03-19 16:25:01 -07:00
Adrian Roos
ed6c44154f Merge "ApiDemos: Add maxAspectRatio demo" into pi-dev am: 246c5bb514
am: fc63532956

Change-Id: I5506ba436220e14289ebe9344a976bc3876d25ec
2018-03-15 17:02:02 +00:00
Adrian Roos
59e2e04dc1 ApiDemos: Add maxAspectRatio demo
Bug: 72696928
Test: Install and open ApiDemos > App > Activity > Max Aspect Ratio > 1:1 / 16:9 / Any
Change-Id: Ie76c8c4babd6b4c281eec8ff977a0c02a868ee0e
2018-03-15 15:32:12 +01:00
TreeHugger Robot
9577597bb9 Merge "don't call methods that are now removed" 2018-03-10 00:02:50 +00:00
Dianne Hackborn
7049e08d6f Fix issue #72116995: Add permission guarding Service#startForeground
Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: I3fab8561028d5c2b54a5e8468f7ff51bcd7bc3df
2018-03-05 17:00:51 -08:00
Derek Sollenberger
e99a121cac Remove deprecated android.graphics.Canvas APIs
Bug: 73777445
Test: compile
Change-Id: I0f203dd55d15408b1ebbbbb33e0d0b53366cc241
2018-02-28 20:17:07 -05:00
Jiyong Park
b9d4110d50 Fix link-type check warning on ApiDemos
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
2018-02-28 09:36:54 +09:00
Mike Reed
a46f0a0858 don't call methods that are now removed
Test: make

Bug: 14646703
Change-Id: I55b5936bf8ed2f7832f734068737053cc29580ea
2018-02-27 14:57:17 +00:00
Adrian Roos
71fc3601bd ApiSamples: Add PIP sample
Test: Open ApiSamples > App > Activity > Picture in Picture
Change-Id: I205cdc00533b19be46c7837012a96705c7a4a62f
2018-02-19 18:34:48 +01:00
Ian Pedowitz
b19c1b8ec6 Revert "Fix issue #72116995: Add permission guarding Service#startForeground"
This reverts commit 7890baea48.

Reason for revert: b/73224471

Bug: 73224471
Bug: 72116995
Change-Id: Ife5dc5c14026ae7dcb126b0b3c3e7701ed3eaebe
2018-02-12 16:12:26 +00:00
Dianne Hackborn
7890baea48 Fix issue #72116995: Add permission guarding Service#startForeground
Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: I88e3f6f1395b7ee0c0af41c9f7e9a5971da17631
2018-02-07 14:05:31 -08:00
Makoto Onuki
10d6c41f9b Add while-idle alarm support to apidemos
Test: Manual test
Bug: 72124522
Change-Id: I9d0c0ed4b6a045e4f8f566c4e9844290e850e2fc
2018-01-30 13:20:06 -08:00
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
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
Peter Visontay
e746637688 Merge "Add an ApiDemo for showing an overlay window." 2017-12-14 14:02:53 +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
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
75bca25be1 Add a demo of the Session-based PackageInstaller to ApiDemos.
Test: Manually.
Change-Id: If084477e8970777ef5cd90c55afe86a116ee1458
2017-11-16 21:49:17 +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
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
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
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
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
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
9302998b13 Add API demo for running multiple foreground services.
Change-Id: I44435f6e7750ccbbadf5e293dd10069c6cef94a4
2016-08-01 17:52:18 -07:00
Dianne Hackborn
1f502540b7 Fix issue #29058724: Improve JobScheduler API demo
Change-Id: I551d4d3376e522ee2d790331e8f83711450c9d19
2016-05-31 18:03:28 -07:00
Michael Wright
d48a67a190 Merge "DO NOT MERGE Remove Pointer Capture API." into nyc-dev 2016-05-26 13:40:24 +00:00