Commit Graph

19632 Commits

Author SHA1 Message Date
yinxu
cd56112962 Merge "Address the API review comments." am: 322ff16301
am: 904826d293

Change-Id: I4de5c601e23004c934684d995bb916b654a42247
2018-03-07 19:15:01 +00:00
Jason Monk
23b73c45fb Merge "Remove BIND_SLICE" into pi-dev 2018-03-07 18:01:26 +00:00
Treehugger Robot
322ff16301 Merge "Address the API review comments." 2018-03-07 17:40:20 +00:00
TreeHugger Robot
5a169cf2f6 Merge "System sounds get its own dnd toggle" into pi-dev 2018-03-07 16:39:40 +00:00
Sungsoo Lim
df0e8fdffd Remove MediaPlaylistController, add MediaPlaylistAgent
MediaPlaylistAgent is the abstract class an application needs to
derive from to pass an object to a MediaSession2 that will override
default playlist handling behaviors. It contains a set of notify*
methods to signal MediaSession2 that playlist-related state has
changed.

Bug: 64098437
Test: make update-api
Change-Id: Icb3c57ddc14eba276f49d4ba85f11adbeb3e0917
2018-03-07 16:41:19 +09:00
Jaewan Kim
87086f59ad MediaSession2: Add SessionCallback#onCurrentMediaItemChanged()
Added callback for session to know the currently playing media item has
changed.

Note that the callback is called in response to the
MediaPlayerBase#PlayerEventCallback#onCurrentDataSourceChanged(mpb, dsd
is called. Session will translate dsd to the media item and calls
onCurrentMediaItemChanged().

Following changes are also included
  - Removed MediaPlaylistController#getCurrentPlaylistItem(),
    because currently playing item is managed by the MediaPlayerBase.
  - Renamed ControllerCallback#onCurrentPlaylistItemChanged() to the
    ControllerCallback#onCurrentMediaItemChanged(), to make it more
    obvious that the event is from MediaPlayerBase, not
    MediaPlaylistController.
  - Added SessionCallback#onCurrentMediaItemChanged()

Bug: 64098437
Test: Run MediaComponents test
Change-Id: I78b124a7da0f968b097b2576507b9a73e36081ec
2018-03-07 16:31:56 +09:00
Jaewan Kim
4d4a8c95ae MediaSession2: Add onDataSourceMissingHelper
This allows a developer to create DataSourceDesc when the item is about
to be played. Typical example of the usages are,

    1. For a playlist consists of FileDescriptors, its developer may not
        want to open all files when MediaSession2.setPlaylist() is
        called.
    2. A controller has called setPlaylist(), addPlaylistItem(), or
        replacePlaylistItem(). Controller cannot know the
        DataSourceDesc, and only the session developer can know about
        it.

Bug: 64098437
Test: Run MediaComponents test
Change-Id: I73f27ca0a799b1cddf5046b41f0ca01d08037103
2018-03-07 16:31:53 +09:00
TreeHugger Robot
2b00eaed27 Merge "IME API: rename IMS methods." into pi-dev 2018-03-07 00:19:55 +00:00
Jaewan Kim
ccf41b87a9 Merge changes from topic "session2-pi-listcallback" into pi-dev
* changes:
  MediaSession2: Pass player info for the callbacks from MediaPlayerBase
  MediaSession2: Add MediaPlaylistController.PlaylistEventCallback
2018-03-07 00:02:09 +00:00
Dianne Hackborn
16268a69d6 Merge "Fix issue #72116995: Add permission guarding Service#startForeground" into pi-dev 2018-03-06 23:04:16 +00:00
Chen Xu
b15225cd88 Merge "API review: rename CarrierIdentification to Carrier id" into pi-dev 2018-03-06 22:57:32 +00:00
Jason Monk
0f73c65958 Remove BIND_SLICE
Its not being used anymore and shouldn't be API.

Test: update-api
Fixes: 74240589
Change-Id: I27d8e3fa5e0570ff268e6160c683d7190c96ef9b
2018-03-06 18:39:15 +00:00
Andrew Grieve
0fec93682e Expose Process.isIsolated()
Rather than have a process attempt to perform IO / IPC and check if it
fails, it makes much more sense to expose this getter.

My specific motivation for exposing this information more directly is to
be able to perform process-specific initialization logic in
Application.attachBaseContext():

https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java?rcl=ac2e180a1265f88dd4030bb35d69f5d0b2dc488d&l=54

Bug: 73343822
Test: Same code that's used in Chrome via reflection.
Change-Id: I1505962679da36ac42401230b204bff7b3376b73
2018-03-06 17:17:43 +00:00
Treehugger Robot
c18b175d87 Merge "Update the RTT features constant." 2018-03-06 16:07:16 +00:00
Jaewan Kim
42a36c341d MediaSession2: Pass player info for the callbacks from MediaPlayerBase
Player can be updated meantime, and player event from the previous
player can be sent after the update. Providing player information will
provide developers more opportunity to filter out unecessary callbacks.

Bug: 64098437
Test: Run MediaComponents test
Change-Id: I9c23101df139e26351c008462c726ae7069130eb
2018-03-07 00:12:14 +09:00
Jaewan Kim
273130dc9a MediaSession2: Add MediaPlaylistController.PlaylistEventCallback
This includes following changes per offline discussion
  - Add MediaPlaylistController.PlaylistEventCallback
  - Add following APIs to the MediaPlaylistController
    * registerPlaylistControllerCallback() /
      unregisterPlaylistControllerCallback()
    * getRepeatMode() / setRepeatMode()
    * getShuffleMode() / setShuffleMode()
    * setPlaylist() with metadata
    * setPlaylistMetadata() / getPlaylistMetadata()
  - Add following APIs to the SessionCallback
    * onMediaPrepared()
    * onPlayerStateChanged()
    * onBufferingStateChanged()
  - Remove following methods from ControllerCallback
    * onPlaylistChanged()

Bug: 64098437
Bug: 74157064
Test: passed MediaComponentTest
Change-Id: I5ad12a9a5d6a7d9e23a577dca8ea26fbacb8f259
2018-03-07 00:11:25 +09:00
Beverly
d696476fb3 System sounds get its own dnd toggle
- Added logic for streams to be muted by dnd (unassociated with ringer)

Test: runtest -x frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java
Bug: 73362490
Change-Id: I1101e67282f7331497e91eb510d2bf4f1ea6b4b1
2018-03-06 09:08:29 -05:00
Tarandeep Singh
164cfba536 IME API: rename IMS methods.
Incorporating API Review feedback:
* Use IMS.switchInputMethod(id) instead of IMS.setInputMethod()
* Use IMS.switchInputMethod(id, subtypeId) instead of
  IMS.setInputMethodAndSubtype()
* Renamed switchToLastInputMethod() to switchToPreviousInputMethod()

Bug: 73954137
Test: atest InputMethodServiceTest
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I6efd5ca473e33e6faeadb7eea7772b9d2b8ca12b
2018-03-06 02:23:15 +00:00
Dianne Hackborn
dd027b3ab2 Fix issue #72116995: Add permission guarding Service#startForeground
Now requires permission if targeting P.

Note that this is a separate permission from the existing one
that is required for instant apps to use foreground services.  The
reason for this is that their semantics are different (the instant
apps permission is associated with an app op for control over what
the app is allowed, while the regular app permission is just a
normal permission that is always granted and only there for
auditing of apps), and there are probably going to be cases where
a developer will want to use a foreground service in the full
version of their app but not as an instant app.

Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: I883c9515c307ed8e39f0bf888c4045944c8183ac
2018-03-05 16:59:21 -08:00
Wei Jia
d526bc3b88 MediaPlayer2: clarify sync/async for API's
Test: MediaPlayer2 plays
Bug: 63934228
Change-Id: I48b73c75311dbb31dcebe7c7a38e444d7dc65ed8
2018-03-05 16:40:59 -08:00
fionaxu
62bc747275 API review: rename CarrierIdentification to Carrier id
Bug: 73953797
Test: unit test
Change-Id: Id89c9100e8963a3cb890ebec347e4aabcd5fd4b8
(cherry picked from commit 4281d0ff57)
Merged-in: Id89c9100e8963a3cb890ebec347e4aabcd5fd4b8
2018-03-05 15:50:34 -08:00
Chen Xu
f01600d5f9 Merge "API review: rename CarrierIdentification to Carrier id" 2018-03-05 22:59:21 +00:00
Adrian Roos
9bbd9661c0 DisplayCutout API: Make constructor public and adjust javadoc
Change-Id: I093cf4f9ea60f00e187aeb4a548f3f5789d87fa1
Fixes: 73953880
Test: make update-api
(cherry picked from commit d61db603fe)
2018-03-05 13:52:32 +00:00
TreeHugger Robot
3a4f974c91 Merge "AID: Change loop to repeat and set from xml" 2018-03-05 01:23:19 +00:00
TreeHugger Robot
f8f0c8df78 Merge "Revert "Introduce InputConnection#reportLanguageHint()"" 2018-03-03 23:36:37 +00:00
nharold
082cfca292 Merge "Expose Carrier Name Override CarrierConfig Values" am: a60e42cc2d am: f0b3b84a13
am: 5bc9756f8b

Change-Id: I747e769a5d278e90fa880d9d26011c6d010fd95d
2018-03-03 02:57:41 +00:00
Yohei Yukawa
4397591f3d Revert "Introduce InputConnection#reportLanguageHint()"
This reverts commit e77386e8fb [1].

Reason for revert:
The protocol is not yet ready to be exposed and we are still unsure
what is the best approach.

 [1]: Ie86edafd1ed68b58f702116f561fc448fdbb57a8

Bug: 7031513
Bug: 72522601
Fix: 74087970
Test: atest CtsInputMethodTestCases
Change-Id: Ia61dc9b3d5b116199382994430fb16ee804942b3
2018-03-02 17:35:18 -08:00
Suprabh Shukla
c0fe0626f6 Merge "An api to query usage events for the caller" 2018-03-03 01:32:21 +00:00
yinxu
1abe9b187c Address the API review comments.
Bug:73750871
Test: Unit Test
Change-Id: I8ebb617c819c7604957b3c086098ef5074d70f78
2018-03-02 17:21:36 -08:00
TreeHugger Robot
247779b31c Merge "MediaSession2: Add caller to the callback methods" 2018-03-03 00:54:31 +00:00
Cassie Han
b87a7a749c Merge "Expand use of 'Str' suffix in CellIdentity to 'String'" am: d622eacb9e am: 3bcb6da703
am: d210655d48

Change-Id: Ibc0862fb7ae1063cbee10415c4c21d7d4a835c51
2018-03-03 00:31:34 +00:00
nharold
a60e42cc2d Merge "Expose Carrier Name Override CarrierConfig Values" 2018-03-03 00:11:29 +00:00
TreeHugger Robot
053a3859a8 Merge "MediaSession2: Add reset() to the MediaPlayerBase" 2018-03-02 23:58:14 +00:00
fionaxu
4281d0ff57 API review: rename CarrierIdentification to Carrier id
Bug: 73953797
Test: unit test
Change-Id: Id89c9100e8963a3cb890ebec347e4aabcd5fd4b8
2018-03-02 15:24:49 -08:00
Cassie Han
d622eacb9e Merge "Expand use of 'Str' suffix in CellIdentity to 'String'" 2018-03-02 22:15:56 +00:00
Leon Scroggins III
6de55b88f7 AID: Change loop to repeat and set from xml
Bug: 73529437
Test: I60fbee6d3610070413e8c46f363ec3c19c2e7c52

Allow setting AnimatedImageDrawable's loop count in xml. Use
"repeatCount" to match the existing attr used by other objects, and
change the Java api from "loop" to "repeat".

Cache the repeat count in the State object for the situation where we
inflate but are waiting on a theme, so that when we get a src we can
apply the existing repeat count.

Change-Id: Ie723fe9a40c64dd0e1e8fd7b5d5cf81e5c5ccd0d
2018-03-02 16:11:37 -05:00
TreeHugger Robot
3c4c64455e Merge "Add a HINT_KEYWORDS to Slice" 2018-03-02 19:14:26 +00:00
Holly Jiuyu Sun
45277c7aca Merge "Add result code for eUICC card not found." 2018-03-02 19:01:41 +00:00
Vladislav Kaznacheev
f1aab4de20 Merge "Add ViewConfiguration.shouldShowMenuShortcutsWhenKeyboardPresent" 2018-03-02 17:34:04 +00:00
Jaewan Kim
3fb60d56c2 MediaSession2: Add caller to the callback methods
This is to follow MediaPlayer2 and MediaPlayerBase's API style.

Bug: 64098437
Test: make update-api
Change-Id: I7fe17852d16237fac801c716eab1007cd0337867
2018-03-02 23:14:40 +09:00
TreeHugger Robot
f10700343c Merge "Add HIDDEN_API_BLACKLIST_EXEMPTIONS to @TestApi." 2018-03-02 09:57:14 +00:00
Mathew Inwood
5518c752ba Add HIDDEN_API_BLACKLIST_EXEMPTIONS to @TestApi.
It's used by a CGTS test.

Bug: 64382372
Test: It builds
Change-Id: I4bde625a89896140b2e8bf585d16074d290c0fc9
2018-03-02 09:51:28 +00:00
Jaewan Kim
de2bbb322b MediaSession2: Add reset() to the MediaPlayerBase
This would be used in response to
  - MediaController2#play()
  - KEYCODE_MEDIA_STOP

Bug: 64098437
Test: passed MediaComponentTest
Change-Id: I7cd4d855d5e1bf8e4260a9b920f30dfe2eea44e1
2018-03-02 18:03:42 +09:00
Bo Zhu
0f0d1ab1d3 Merge "Check the public-key signature of the whole certificate file before accepting the certificates" 2018-03-02 08:52:36 +00:00
Nathan Harold
8366bcb8b8 Expose Carrier Name Override CarrierConfig Values
These CarrierConfig values are needed for a
CC app to override the SPN dynamically. Since
Carrier names are very complicated, it's extra
important that these values be exposed so that we
can properly enforce correct behavior through CTS.

Bug: 73734601
Test: compilation (no functional change)
Change-Id: I26dab1bd32d1d5273f707a37026cffca7fd639a3
2018-03-01 19:10:28 -08:00
Mady Mellor
15e2c5d54d Add a HINT_KEYWORDS to Slice
Want to be able to support allowing a Slice to specify some keywords
associated with it; need a new hint to identify these.

Bug: 74086214
Test: make
Change-Id: I79d3f1806eecf416f5e3ae09451b90507b382c24
2018-03-02 00:54:15 +00:00
Holly Jiuyu Sun
e902719b93 Add result code for eUICC card not found.
Bug: 38206971
Test: test on phone
Merged-In: Ia783fe68389d950b664ad312d98c7e3aa200b471
Change-Id: Ia783fe68389d950b664ad312d98c7e3aa200b471
2018-03-01 13:00:30 -08:00
Jiuyu Sun
595182423f Merge "Add result code for eUICC card not found." 2018-03-01 19:21:32 +00:00
TreeHugger Robot
5130fdb0ac Merge "cas: explicitly define possible key id values" 2018-03-01 18:50:18 +00:00
Arthur Ishiguro
f0cda31e00 Merge "Mark location classes as Parcelable appropriately" 2018-03-01 17:10:14 +00:00