Commit Graph

913 Commits

Author SHA1 Message Date
Hongwei Wang
e60d337804 Merge "Use FixedAspectRatioImageView to demo auto-enter-pip" into sc-dev am: 0e4d25a19e
Original change: https://googleplex-android-review.googlesource.com/c/platform/development/+/15055021

Change-Id: Idc4f1d75aae9c5e6aeb493c9585c9215cd282d2c
2021-07-15 00:07:30 +00:00
Hongwei Wang
31c5071a72 Use FixedAspectRatioImageView to demo auto-enter-pip
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/bpKcGg1eoOo5Jz5U6IwBYK
Bug: 191310680
Test: manually auto-enter-pip from landscape, see video
Change-Id: I30a728331f0ffa48c537be7b2611dba0b2df053a
2021-07-12 16:07:23 -07:00
Yuntao Xu
aba34f50cc Convert Android.mk to Android.bp
1. Convert ApiDemos/Android.mk to ApiDemos/Android.bp;
2. Convert ApiDemos/tests/Android.mk to ApiDemos/tests/Android.bp

Bug: 186778349
Test: compared the apk files built by Make and Soong
Test: TreeHugger
Change-Id: I7b72a998b56804e647d0908be5a118f9bf2cd896
2021-05-18 23:08:25 -07:00
Hongwei Wang
d1cc26450c Fix flicker in ApiDemos when auto enter PiP from landscape
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cNwi8qI0qukRlaIwutzclD
Bug: 179720719
Test: auto enter PiP from landscape using ApiDemos app, see video
Change-Id: Ic421b3766fbc15bf699885863710a14c3178867f
2021-05-12 19:39:23 -07:00
Treehugger Robot
3291dd14f1 Merge "[LSC] Add LOCAL_LICENSE_KINDS to development" am: e748063d28 am: 347249060a am: dafb7fc537
Original change: https://android-review.googlesource.com/c/platform/development/+/1682225

Change-Id: I8f5e6007cd6803d4dcbfd498045366761be718a2
2021-04-21 20:01:08 +00:00
Bob Badour
40a7447daa [LSC] Add LOCAL_LICENSE_KINDS to development
Added SPDX-license-identifier-Apache-2.0 to:
  apps/Development/Android.mk
  apps/DumpViewer/app/src/main/Android.mk
  apps/OBJViewer/Android.bp
  samples/ApiDemos/Android.mk
  samples/ApiDemos/tests/Android.mk
  samples/HeavyWeight/Android.bp
  samples/IntentPlayground/Android.mk
  samples/MultiClientInputMethod/Android.mk
  samples/MultiDisplay/Android.mk
  samples/MySampleRss/Android.bp
  samples/RenderScript/HelloCompute/Android.mk
  samples/RenderScript/Levels/Android.mk
  samples/ShortcutDemo/launcher/Android.mk
  samples/ShortcutDemo/publisher/Android.mk
  samples/ShortcutSample/Android.mk
  testrunner/tests/Android_java.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I535f73ffa885f723b9dca745f199ce3a3fd409ea
2021-04-20 14:03:26 -07:00
Christopher Tate
6075c16c08 Update to track FGS API development
FGS notification deferral control is now a tri-state.

Bug: 171499612
Bug: 179290175
Test: ApiDemos foreground service paths
Change-Id: Ie426fb64b998ba452ff92f0231811679946500ff
2021-03-23 17:52:14 +00:00
Hongwei Wang
511635184c Fixed the aspect ratio in PictureInPictureAutoEnter
Since the actual aspect ratio is defined in layout file, measuring the
value in layout change listener can only cause irrelevant
onTaskInfoChanged callbacks sent to SysUI due to 1px difference.

Bug: 180630127
Test: enter PiP w/ autoEnter from landscape in button navigation
Change-Id: I25dcf82bfbebde017c2c938d745c23d615a7015b
2021-03-04 16:39:21 -08:00
Hongwei Wang
5e8ce64de0 Use a single TextView to demonstrate seamlessResize
For easy side-by-side comparison turning on/off seamlessResizeEnabled
flag. Adjusted also the wording to emphasize the recommended usage.

Bug: 152554547
Test: use the ApiDemos app
Change-Id: I1fbeee2479d9e93614d040d10e01f9fe2fb4c8d4
2021-03-01 11:24:28 -08:00
Hongwei Wang
35faf69308 Add demo for autoEnterPip w/o sourceRectHint
Video: http://rcll/aaaaaabFQoRHlzixHdtY/cdY8k6V9uhJEXyMAKAUA34
Video: http://rcll/aaaaaabFQoRHlzixHdtY/bvodLNGyrIXH8DSvGHehrp
Bug: 179286893
Test: manual in ApiDemos app, see video
Change-Id: Ib1ae64e24c901d2a921b0b5d40bffb196f8121ba
2021-02-08 16:51:58 -08:00
Galia Peycheva
6160e125d4 Merge "Revert "Remove public usages of FLAG_BLUR_BEHIND"" into sc-dev 2021-02-03 05:49:40 +00:00
Galia Peycheva
e8627d6c0b Revert "Remove public usages of FLAG_BLUR_BEHIND"
Revert "Add pid and uid to SF::setClientStateLocked"

Revert "Add USE_BACKGROUND_BLUR to cts expected permissions"

Revert submission 13350963-blur_system_api

Reason for revert: This topic made blurs a system api. API council voted against that and we will instead aim to make it public for S. None of these changes are relevant in that case.

Reverted Changes:
I3683db296:Remove public usages of FLAG_BLUR_BEHIND
I23b21b603:Add USE_BACKGROUND_BLUR to cts expected permission...
Id21f03793:Add pid and uid to SF::setClientStateLocked
If5d8344a5:Add permission for blur SystemApi
I70d1e1715:Add permission check for blurs in SurfaceFlinger
Icf98c3607:Make window background blurs SystemApi
I0b881ec6e:Make BackgroundBlurDrawable a SystemApi

Bug: 177523043
Change-Id: Ic1f1657eee370a2fcc625c28f876c34e3e0427e9
2021-02-01 10:43:52 +00:00
jorgegil@google.com
371e9e86f1 Add Api Demo for PiP source rect hint
- Demonstrates the source rect hint API (on enter and exit)
- Invoke path: App -> Activity -> Picture In Picture Source Rect Hint

Video: http://rcll/e8RgaQ0dFlwFuh0c7GRpyy/cCQiDoYLvfJ4dKwQQbsaYC
Bug: 167447693
Test: m -j ApiDemos
Change-Id: I80b41b017b021bf6da16a21fe9d5bf8ec0c35ea5
2021-01-28 21:17:30 +00:00
jorgegil@google.com
66780efd43 Add ApiDemo for PiP seamless resize
- Demonstrates the seamless resize API (both enabled and disabled)
- Invoke path: App -> Activiy -> Picture In Picture Seamless Resize

Video: http://rcll/e8RgaQ0dFlwFuh0c7GRpyy/UVHnwihysd2to0Py2IqU2
Bug: 152554547
Test: m -j ApiDemos
Change-Id: I331a0d60e5a93c24c1ad48bb1cdcda9570c0337d
2021-01-25 13:43:55 -08:00
Hongwei Wang
e07065a463 Merge "Add ApiDemo for PiP auto enter API" 2021-01-21 21:54:07 +00:00
Hongwei Wang
b0715f27ef Add ApiDemo for PiP auto enter API
- Demonstrates the autoEnterPip API with multi-activity in original task
- Invoke path: App -> Activity -> Picture in Picture Auto Enter

Video: http://rcll/aaaaaabFQoRHlzixHdtY/gIO4G5dybW7tJWXihkhXfE
Bug: 177335910
Test: m -j ApiDemos
Test: see video
Change-Id: If69116dd52476ead8cc46dc3475447d4bfa64ff8
2021-01-18 16:03:55 -08:00
Galia Peycheva
a4af55c95a Remove public usages of FLAG_BLUR_BEHIND
WindowManager.LayoutParams.FLAG_BLUR_BEHIND has been deprecated since
2011 and has been a no-op ever since.
We are @remove-ing it in S and making it a SystemApi to be used for
cross-app blurs. To that end, we have to remove its public usages.

This CL removes its usage in ApiDemos.

Bug: 177524486
Test: m
Change-Id: I3683db296e8331a9d255d39f23fad7dedc28bb9b
2021-01-15 08:18:47 +01:00
Christopher Tate
e99b9c4ff5 Exercise new 'show immediately' FGS notification
Bug: 171499612
Test: ApiDemos foreground service suite
Change-Id: Iff2cef9a13ee0cd13e5b98d1a6ce59e77e6054a4
2020-11-16 13:48:23 -08:00
Michael Bachman
8c28d0a1c1 Android Inclusive Code Fixit: removing "sanity" from logging line where it is not needed.
Change-Id: Idc20e7e0efad4b1fc6f04e844105339fb4774210
Bug: 162536543
2020-07-31 20:24:08 +00:00
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
7a58326f08 docs: Fix outdated sample code in Context#getExternalFilesDir. Test: make ds-docs
am: f767eb4aa9

Change-Id: I0a5d7d6f6fa9b28f650891d4a70b7efbcc053f45
2019-08-19 18:04:42 -07: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
Bob Badour
801760580f Merge "Clarify license terms for Romain Guy's artwork." am: a37de64bd6
am: fb5f7546b0

Change-Id: I964e6ca1dcc1bf15925d79a80e9707d8e691c4d8
2019-06-27 20:31:48 -07:00
Bob Badour
e72c60e885 Clarify license terms for Romain Guy's artwork.
As discussed with Romain Guy in the email thread, the Apache 2.0
license applies to the affected .jpg files now and retroactively from
the time of import.

Usage terms updated using exiftool:

$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/ApiDemos/res/drawable-nodpi/frantic.jpg
Warning: [minor] Fixed incorrect list type for XMP-xmpRights:UsageTerms - development/samples/ApiDemos/res/drawable-nodpi/frantic.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/ApiDemos/res/drawable-nodpi/frantic.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy
$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/devbytes/animation/PictureViewer/res/drawable-nodpi/p3.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/devbytes/animation/PictureViewer/res/drawable-nodpi/p3.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy
$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/devbytes/animation/PictureViewer/res/drawable-nodpi/p2.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/devbytes/animation/PictureViewer/res/drawable-nodpi/p2.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy
$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/devbytes/animation/ActivityAnimations/res/drawable-nodpi/p3.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/devbytes/animation/ActivityAnimations/res/drawable-nodpi/p3.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy
$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/devbytes/animation/ActivityAnimations/res/drawable-nodpi/p2.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/devbytes/animation/ActivityAnimations/res/drawable-nodpi/p2.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy

Test: doesn't realy apply to images

Change-Id: If060c6ba0f0279e3a7e6446061d50cd8e4cdec3c
2019-06-27 14:58:10 -07:00
Bob Badour
3bdea97ab6 Merge "Clarify license terms for Romain Guy's artwork." am: 0e3bcf70c5
am: bcd745dddc

Change-Id: I330e55df545251008c1940ec9b22732799de7fc5
2019-06-05 14:59:37 -07:00
Bob Badour
d41e5f7851 Clarify license terms for Romain Guy's artwork.
As discussed with Romain Guy in the email thread, the Apache 2.0
license applies to the affected .jpg files now and retroactively from
the time of import.

Each of the images was altered using the exiftool:

exiftool -WebStatement=http://www.apache.org/licenses/LICENSE-2.0

Change-Id: I557d0129617164209a3eec7ec2d228f266643ca0
2019-06-05 20:08:08 +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
Vladislav Kaznacheev
0af910ed69 Merge "Use menu shortcuts in ApiDemos" into pi-dev am: 08207ad842
am: 413f32b4cf

Change-Id: I18463149d3755b1a558dd3c068afaf9fc6f536cf
2018-04-23 14:41:25 -07:00
Vladislav Kaznacheev
603a758caf Use menu shortcuts in ApiDemos
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
2018-04-17 23:02:47 +00: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
Alan Viverette
a3d037382d Migrate to AAPT2
Bug: 73250914
Test: make checkbuild
Change-Id: I64ad5cb08aeb1e1c5cd2594dc0be1bbb105610f6
2018-02-27 20:30:57 +00: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
9f8d264a84 Follow-up to I205cdc00533b19be46c7837012a96705c7a4a62f
Test: mmm development/samples/ApiDemos
Change-Id: I3794c3c94785c4de3b130201ff70d05dbe792256
2018-02-20 12:22:17 +01: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