Commit Graph

3553 Commits

Author SHA1 Message Date
Louis Pullen-Freilich
0d2db8feb9 Merge "Removes framework Preference demos" 2018-11-16 17:16:17 +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
Yohei Yukawa
7bdd3d35c0 Make MultiClientInputMethod optional build target
Otherwise SDK build will fail because this target puts artifacts to
privileged app dir, which is not expected for samples in the SDK
build.

You can still build MultiClientInputMethod on command line by
explicitly specifying this in the build target.

Bug: 115784148
Test: locally verified as follows:
  lunch sdk_phone_armv7-userdebug
  make -j PRODUCT-sdk_phone_armv7-sdk
Change-Id: I09282fa39d13f8078881a3b215cad7d3c0e81486
2018-11-12 20:21:37 -08:00
Yohei Yukawa
eb0868906c Add a sample multi-client IME
This CL adds a sample multi-client IME.  Ahthough there are still many
limitations and missing features in this sample IME, this CL
demonstrates how a multi-client IME can be implemented.

Fix: 115784148
Test: prebuilts/checkstyle/checkstyle.py -f \
      development/samples/MultiClientInputMethod/
Test: Manually verified as follows:
  1. make -j MultiClientInputMethod
  2. adb install -r $OUT/system/priv-app/MultiClientInputMethod/MultiClientInputMethod.apk
  3. adb root
  4. adb shell setprop persist.debug.multi_client_ime \
       com.example.android.multiclientinputmethod/.MultiClientInputMethod
  5. adb reboot
  6. Try multiple text input scenario
Change-Id: Ide43e16448fa00355a2c08bc45ae94d98553da50
2018-11-12 15:09:07 -08:00
Andrii Kulian
91ca37c380 Update MD Launcher for large/external screens
- Added support for multiple launcher activity instances.
- Launcher now shows default wallpaper as background.
- The activity now expands behind system decor windows.
- App drawer can be invoked by clicking on FAB.
- Apps can be pinned on the screen.
- Wallpaper setting flow can be started from launcher.
- UI is optimized for large and xlarge screens.
- Launching a new instance is now optional.
- Other minor UI tweaks.

Bug: 116684201
Bug: 112452592
Bug: 112451761
Test: Manual
Change-Id: I52b5efa4362eab7fcaa5d23923329b68b1783847
2018-10-19 16:33:00 -07:00
Nicole Borrelli
719811d0ea Merge "Remove deprecated media sample." am: 8f7bfcff2b am: a3bb3b5f27
am: b6c72278ff

Change-Id: I0765254483613d37fab8839d47021d48bcf5fffa
2018-08-21 10:42:45 -07:00
Nicole Borrelli
ce3abea5df Remove deprecated media sample.
For a cononical sample of a media player, see the Universal Music Player:
https://github.com/googlesamples/android-UniversalMusicPlayer

Bug: 33676939
Test: Verified projects compile when code removed.

Change-Id: I56e09ccf85647296c29da9a06b03b0fae98d50e6
2018-08-20 10:26:07 -07:00
Andrii Kulian
9048eea32c MultiDisplay launcher sample
Demo launcher that allows starting activities on secondary displays.

Test: Manual
Change-Id: I9d6652b81fc928767d47f94a6ac5bc9de0fb8f37
2018-07-31 21:58:46 +08:00
KOUSHIK PANUGANTI
09824249c4 Migrated various apps under development/samples/IntentPlayground to androidx
Bug: 76692459
Test: make IntentPlayground
Change-Id: I9bb3f3492e41d48968caa023861d1552cf0278bd
2018-05-24 20:12:03 +00:00
TreeHugger Robot
d898ad06d0 Merge "Migrated various apps under development/samples/ShortcutDemo/publisher to androidx" 2018-05-22 23:28:27 +00:00
vineel sadineni
7bb444d8b1 Migrated various apps under development/samples/ShortcutDemo/publisher to androidx
Bug: 76692459
Test:  mmma development/samples/ShortcutDemo/publisher
Change-Id: Ia0150e2579f286a34de7d5accffeafffe69de635
2018-05-18 14:11:46 -07:00
vineel sadineni
7a629ba096 Migrated various apps under development/samples/ShortcutDemo/launcher to androidx
Bug: 76692459
Test:  mmma development/samples/ShortcutDemo/launcher
Change-Id: Ic68392460192d91af2dcbfb4790f020b95d2bfee
2018-05-18 10:36:49 -07:00
vineel sadineni
a55e5516d0 Migrated various apps under development/samples/ShortcutSample to androidx
Bug: 76692459
Test:  mmma development/samples/ShortcutSample
Change-Id: I5e2430aefe4c8f4ebcd48845393b2e845216bf2b
2018-05-17 16:09:35 -07: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
TreeHugger Robot
dcd3618c54 Merge "Migrate to AAPT2" 2018-02-27 21:54:22 +00: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
Anton Hansson
97f205fcc1 Merge "development: Set LOCAL_SDK_VERSION where possible." am: 76ce83e999 am: 132d4f2bc2
am: 5fad00498b

Change-Id: Ib16c0ff647fe0d6da63c6f562458ea047c6756d4
2018-02-26 16:53:23 +00:00
Anton Hansson
5fad00498b Merge "development: Set LOCAL_SDK_VERSION where possible." am: 76ce83e999
am: 132d4f2bc2

Change-Id: I4cfa3f21c957c32c8497051925fb34f3155817be
2018-02-26 16:45:11 +00:00
Anton Hansson
44b2e0dfcb development: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I371bd0b43e66bcc4be1e26decb95c70519ac3342
2018-02-21 19:02:11 +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
Jiyong Park
d1d75c073f Merge "Build libsimplejni using SDK" am: 86c0968a05 am: bebb47b683
am: fd41a528f4

Change-Id: Id621990d8b02fe279806fc4f1c794f567b7c83ff
2018-02-15 08:03:13 +00:00
Jiyong Park
fd41a528f4 Merge "Build libsimplejni using SDK" am: 86c0968a05
am: bebb47b683

Change-Id: Ib263bb9e4ecc987edc1de86c97ceff20f3119862
2018-02-15 07:56:37 +00:00
Jiyong Park
6a91a9ad8a Build libsimplejni using SDK
The lib hasn't been built using SDK and thus has been causing link-type
check warning from SimpleJNI which is built using SDK. Since the warning
will turn into error soon, fixing the warning by correctly building the
lib with SDK.

Bug: 69899800
Test: m -j SimpleJNI is successful and does not show any link-type check
warning

Change-Id: I51edfe296c70ac99ac7698b5e06ec0e0c678945c
2018-02-14 17:10:57 +09: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
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
f1c79d99bf Clarified conditions that require client-side unbindService() call.
am: a57908a18e

Change-Id: I5348f96ec2ea72637c54951a87dfd9b2d1421bcd
2018-01-17 01:12:13 +00: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
a57908a18e 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-12 13:58:57 -08: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
Yohei Yukawa
45ef8b0a9e Add ThemedNavBarKeyboard sample
This CL adds a sample IME that demonstrates how an IME can now control
the appearance of bottom navigation bar like typical Activities can
do.

This sample IME covers the following 3 use cases to control the
appearance of bottom navigation bar.

A. (Bottom) navigation bar has solid background color.
    Like typical Activities, IMEs can
    - call Window#setNavigationBarColor() to change the background
      color. (Bug 25706186)
    - set SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR to tell the SysUI to
      optimize the navigation bar button colors. (Bug 69002467)

B. (Bottom) navigation background is seamlessly extended from the main
   InputView of the IME, like typical Activities can do with
   SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION.  Note that essentially this
   is a super set of the mode A, because IMEs (and apps) can also fill
   the navigation bar region with a solid color in this mode.

C. The appearance of (bottom) navigation bar is controlled by the
   target application, not by the IME.
   - This is useful for floating IME (Bug 22564251).

Bug: 25706186
Bug: 69002467
Test: Build and manually test as follows.
  1. make -j ThemedNavBarKeyboard
  2. adb install -r $OUT/system/app/ThemedNavBarKeyboard/ThemedNavBarKeyboard.apk
  3. adb shell ime enable com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
  4. adb shell ime set com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
Change-Id: I4b10a19641bd3ce6c43e7629404b6f202d4186e8
2017-12-25 16:45:24 -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
Jon Dormody
05e8c5bcf9 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

Change-Id: Ib841238c938c210f35f4f623de969038b9192779
2017-12-22 22:22:45 +00:00