11825 Commits

Author SHA1 Message Date
Rubin Xu
cc586c5ab1 Merge "Introduce quiet mode state to managed profile users" 2015-12-07 21:52:40 +00:00
Yohei Yukawa
3a346cfe8e Merge "Add subtypeId for SpellCheckerSubtype." 2015-12-07 20:58:02 +00:00
Rubin Xu
0a29ecd8a5 Introduce quiet mode state to managed profile users
Quiet mode means the user will be free from visual and audio interruptions
from apps inside the managed profile, including notifications, widgets and
others. This CL adds the underlying state bit to users and exposes various
APIs to control and query the quiet mode state.

Bug: 22541941
Change-Id: If5f8e5a897843050e83b6ec26cb39561098f12b9
2015-12-07 18:17:46 +00:00
Wale Ogunwale
5f986095be APIs for activity to know when its windowing/pip modes change
Added APIs that allow activities to ask the system if they are currently
in multi-window or picture-in-picture mode and also get notified when
their modes change.

Bug: 25509834
Bug: 25683717
Change-Id: I4b8c316a49940bd6a8b31a93b345f9fd725a4721
2015-12-07 07:40:56 -08:00
Tyler Gunn
aa5c2c9303 Merge commit 'bc4da97ce0fcd0ddef228048bc663e383776c323' into tgunn-mncvtdev-to-master-2015-12-04 2015-12-04 21:04:20 -08:00
Tyler Gunn
1cee477bc5 Merge commit '024557b2afdbe2e946d2cc557cb71492d87b0f62' into tgunn-mncvtdev-to-master-2015-12-04
Change-Id: I156930f72a3267b59123469231331e9da5ac6aab
2015-12-04 21:03:30 -08:00
Yohei Yukawa
0894319162 Add subtypeId for SpellCheckerSubtype.
What this CL actually does is just copying the existing concept
"subtypeId" from InputMethodSubtype to SpellCheckerSubtype.

To recap, the underlying problem is that the system has stored only the
return value of SpellCheckerSubtype#hashCode() to track the set of
enabled subtypes, and SpellCheckerSubtype#hashCode() has been
implemented as Arrays.hashCode(new Object[] {locale, extraValue}), which
is problematic because:
  - Spell checker developers cannot change "locale" and/or 'extraValue'
    if they want to keep enabled subtypes enabled.
  - Android Framework developers cannot change the hash function even
    when new fields are added if they want to keep enabled subtypes
    enabled.
InputMethodSubtype has had the same issue, and what we did was
introducing a concept "subtypeId", which allows IME developers to
specify the return value of #hashCode().

For instance, suppose that a subtype X has already been used in
production with the following attributes:
  - locale: "tl_PH"
  - extraValues: "key1=value1,key2=value2"

With "subtypeId", you can change the attributes of subtype X without
losing the enabled state of subtype X on devices as follows.
  - locale: "fil_PH"
  - extraValues: "key1=value1,key2=value2,key3=value3"
  - subtypeId: Arrays.hashCode(new Object[] {
            "tl_PH", "key1=value1,key2=value2"})

This CL also deprecates existing public constructor of
SpellCheckerSubtype, which was probably published as a public API by
mistake.  Note that the constructor of SpellCheckerInfo class is @hide.
Also there is no public API that receives SpellCheckerSubtype object
instantiated by developers with custom data.  Making developers to be
able to instantiate SpellCheckerSubtype does not make sense right now.

Bug: 11736916
Bug: 22858221
Change-Id: I98f05c1e9421c47a93769bc4a6fe11b678bc2509
2015-12-04 16:16:47 -08:00
Sandra Kwan
db9df39992 Merge "AccountManager: add finishSession(...) API." 2015-12-04 23:35:20 +00:00
Sandra Kwan
920f6ef983 AccountManager: add finishSession(...) API.
Adding finishSession API to AccountManager and
AbstractAccountAuthenticator.

Change-Id: I153dd2bb6fe01d2e4b10b41e8b553f59da26bd29
2015-12-04 15:32:47 -08:00
Jeff Sharkey
65196ee28b Merge "Add tagging variants for DatagramSocket." 2015-12-04 22:44:40 +00:00
Jeff Sharkey
f0d7633bdc Add tagging variants for DatagramSocket.
Oops, we missed these along the way.

Bug: 25799174
Change-Id: I4ad368f9faee4b1996d605534dce4c2b23dbe200
2015-12-04 15:32:07 -07:00
Vinit Deshpande
0dfd4faf01 Merge "Mark WIFI_AP_STATE_CHANGED_ACTION and extras @SystemApi." 2015-12-04 19:58:58 +00:00
Jeff Sharkey
0534ac90e5 Merge "Handle non-encryption-aware accounts and sync." 2015-12-04 16:50:38 +00:00
Jeff Sharkey
9d8a1048bb Handle non-encryption-aware accounts and sync.
The system can now boot in a "locked" state where only encryption
aware (EA) components can be safely started.  When in this state,
PackageManager already filters away non-EA components, but system
services like AccountManager and SyncManager need to carefully handle
these temporarily "missing" components.

As a guiding principle, all known Accounts are still present when
the device is locked, but communication with underlying non-EA
authenticators is blocked.

To keep things simple for now, all SyncManager requests are kept
dormant until the user enters the unlocked state.

The core of this logic is that RegisteredServicesCache now works
with all components regardless of EA status, which prevents us from
accidentally thinking a service was removed when the user is locked.

Bug: 25945136
Change-Id: I8714121f6236b00821769023c4df7de1c8a99944
2015-12-04 09:36:39 -07:00
Ricky Wai
ccf15a45cf Merge "Change Contacts.CORP_CONTENT_FILTER_URI to enterprise API" 2015-12-04 16:35:33 +00:00
Ricky Wai
36220e3ed1 Merge "Make Work Directory API as Enterprise API" 2015-12-04 16:34:49 +00:00
Victor Chang
9d7670b466 Merge "Add ENTERPRISE_CONTENT_FILTER_URI to Callable and Phone" 2015-12-04 16:31:57 +00:00
Tomasz Mikolajewski
a4c338aea6 Add a FLAG_ARCHIVE flag to DocumentsContract.
Bug: 20176812
Change-Id: I4bf7c4f228682a68ca5106bfc757fb533e281a86
2015-12-04 19:16:28 +09:00
Jeremy Klein
b8c7badbb5 Mark WIFI_AP_STATE_CHANGED_ACTION and extras @SystemApi.
These will be used by Magic Tether within GmsCore.

Change-Id: I06691e69d256d0400d16a7bb63e3406fada7b5f1
2015-12-03 18:07:44 -08:00
Yohei Yukawa
b4ea6ddc03 Merge "Introduce EditorInfo#locales." 2015-12-04 01:21:02 +00:00
Yohei Yukawa
d550050171 Merge "Make LocaleList Parcelable." 2015-12-04 01:18:41 +00:00
Yohei Yukawa
8d6eeb01df Introduce EditorInfo#locales.
The primary goal of this CL is to enable application developers to
provide more context-based language (locale) information for IME
developers so that users can be benefited by more natural text input
experience.

As of API Level 23, there are several APIs that allow IMEs to retrieve
locale/country related information.

  - Locale#getDefault()
  - Configuration#locale
  - LocaleSpan#getLocale()
  - SubscriptionInfo#getCountryIso()

However, only LocaleSpan#getLocale() can be used to pass application
specific languge (locale) context from applications to IMEs.  Also
LocaleSpan is not designed to be used per input-context.  We want to
have something in EditorInfo and LocaleList would be the right thing.

Although default implementation of TextView#onCreateInputConnection()
starts filling EditorInfo#localeList with TextView#getTextLocales() by
this CL, application developers are encouraged to provide its own
LocaleList when they are confident that the user want to use a
certain (set) of language(s).

For instance, a chat application may be able to guess what language will
be used in the conversation before the user start typing.  At least it
should be able to remember the last used language for each conversation.

Another instance would be "From" and "To" EditText fields in a
translation app.  Those fields should have different LocaleList based on
the languages that the user want to translate from and to.

Bug: 22859862
Change-Id: I77db5b99a7cf745d800db75baf135bb60ad04820
2015-12-03 16:10:37 -08:00
Yohei Yukawa
789d8fdbd9 Make LocaleList Parcelable.
This is a preparation work to pass LocaleList from TextView to IMEs via
EditorInfo.

Marshalling and unmrshlling LocaleList via Parcel is actually not so
difficult.  We can reuse its internal data representation "localeTags"
as a canonical serialization format.

As for implementation, there are two choices.  One is making LocaleList
Parcelable and the other is having a utility method to do that.

This CL uses Parcelable approach so that not only Framework but also
application developers can reuse the code.

Bug: 22859862
Change-Id: Ib28363bd5ff74228d2abeaa95004ec8bed72bddd
2015-12-03 15:53:50 -08:00
Keun-young Park
b88dd9412e Merge "allow locking UI mode and block launching car dock for automotive" 2015-12-03 21:31:23 +00:00
keunyoung
a771049b2e allow locking UI mode and block launching car dock for automotive
- add config to lock UI mode change: When this is enabled,
  request to change car mode will be ignored. Apps can check
  the config using UiModeManager.isUiModeLocked()
- add config to lock day / night mode: When this is enabled,
  apps cannot change day / night mode without having
  MODIFY_DAY_NIGHT_MODE permission.
  Apps can check the config using UiModeManager.isNightModeLocked()
- add config to disable car dock intent launch for home key
  and mode change
- All new configs have default values which keeps the current behavior.
  Car products should override the configs to get desirable behavior.

bug: 22700993
Change-Id: Ic0e58f3428151e0b1c19a2e9a7d6ded32ff962a6
2015-12-03 13:05:35 -08:00
Jeff Sharkey
8b4fce4bac Merge "Flesh out user locked/unlocked lifecycle." 2015-12-03 21:05:17 +00:00
Jeff Sharkey
bedbaa9ea6 Flesh out user locked/unlocked lifecycle.
When a user is first started, we assume that they're "locked" meaning
that credential-encrypted data is unavailable.  Once credentials have
been supplied, we can transition the user to a fully running state.

To facilitate this lifecycle, UserState now has two separate
RUNNING_LOCKED and RUNNING states.  To ensure consistent events are
sent on all devices, we always step through RUNNING_LOCKED before
arriving at RUNNING.  This consistency means that apps processing
data based on the new ACTION_LOCKED_BOOT_COMPLETED broadcast and
system services using the new onUnlockUser() event will be less
bug-prone over time.

If the user storage is unlocked (which is the case on the majority
of legacy devices), we immediately transition from the RUNNING_LOCKED
into the RUNNING state.

Add logging for all state transitions.

When we "recover" a user in the process of being shut down, return
to the last known state.

Bug: 25943941
Change-Id: I5fec980f10b0d0fb2c272a662d193dc15136f9b9
2015-12-03 13:55:09 -07:00
Victor Chang
3d47ceb220 Add ENTERPRISE_CONTENT_FILTER_URI to Callable and Phone
BUG=25899500

Change-Id: Id87ac24d2bed5811398cba6a3d55fb6ce89d8855
2015-12-03 20:10:57 +00:00
Chris Wren
cf7021e827 Merge "Notification Assistant API" 2015-12-03 19:23:33 +00:00
Chris Wren
9fa689f8b6 Notification Assistant API
This API allows a single assistant on the device to help the
user manage their notification stream by taking actions on
individual notifications:

  - modifying their priority up or down when they are posted
  - possibly changing if and how the notification interrupts the user
  - adding annotations under notifications

Bug: 22455414
Change-Id: Idf47972bb71c83f1dc1c9ec68a6fa92ac4fc522f
2015-12-03 13:45:10 -05:00
Jason Monk
8f7f3184d5 Allow QS tiles to open dialogs
Add a TYPE_QS_DIALOG window type, that is in the same layer as
apps and dialogs and such.  It is guarded by having a token
that is granted by SysUI after a click has occured.  If the
app shows a dialog before listening finishes (QS closes) then
the token will stay granted until the tile is removed by the
user, otherwise the token will be removed immediately to avoid
later dialogs.

Also fix a couple tiny TileService issues:
 - Stop/Start listening reversed
 - Fix javadoc referencing wrong action

Change-Id: Iedcdd5fd9a2af2b33eb7f6f17bb0e6c997879876
2015-12-03 09:22:15 -05:00
Keun-young Park
aa8b1c35ad Merge "Revert "allow locking UI mode and block launching car dock for automotive"" 2015-12-03 02:11:20 +00:00
Keun-young Park
3b741e03b3 Revert "allow locking UI mode and block launching car dock for automotive"
This reverts commit 1746369a6bcd1a7219e94366b3774bfdfff08fc6.

Change-Id: I4989e99b8f648145d0dbfe18e557102939e7d1e3
2015-12-03 02:11:00 +00:00
Keun-young Park
ef3ca438c9 Merge "allow locking UI mode and block launching car dock for automotive" 2015-12-03 01:45:12 +00:00
Chong Zhang
1be3a1cfb9 Merge "Add permission to prevent third-parth apps from querying OOM scores" 2015-12-02 21:02:37 +00:00
Vladislav Kaznacheev
9bc00f1997 Merge "Add extras to ClipDescription" 2015-12-02 20:52:04 +00:00
Chong Zhang
8e4f4b3d94 Add permission to prevent third-parth apps from querying OOM scores
bug: 25853091
Change-Id: Ic1cdbf155e1e930405773fd078dfc57fda2d9afa
2015-12-02 12:20:30 -08:00
Sunny Goyal
ac7579a6e5 Merge "Adding context flag to open database with no localized collators" 2015-12-02 20:17:29 +00:00
Jeff Sharkey
f23b5d3d6d Merge "API to determine user locked/unlocked state." 2015-12-02 20:16:37 +00:00
Jeff Sharkey
0825ab284c API to determine user locked/unlocked state.
Bug: 25946804
Change-Id: I2b8c8c75fda161a446d79fac811fdd446aa3a4db
2015-12-02 13:14:51 -07:00
Sunny Goyal
a21e6b2fac Adding context flag to open database with no localized collators
Bug: 25956606
Change-Id: I209a8d18a7e83c1af54309fae8607f8b46772196
2015-12-02 11:11:37 -08:00
Vladislav Kaznacheev
ddb4bdecfc Add extras to ClipDescription
This is required to expand metadata capabilities of DragEvent.
Apps receiving ACTION_DRAG_* events have access to
ClipDescription, but not ClipData.

Adding extras to ClipDescription allows for a richer behavior of apps
responding to these events.

Bug: 25788641
Change-Id: I07e374f71d16f8441dc3a0b02c7d833e0139b74b
2015-12-02 11:09:39 -08:00
Philip P. Moltmann
b3078c235e Allow print service to specify progress of print and status
The status has always been there in error cases, it is now also visible
in non-error cases.

If the progress is not set, no progress bar is shown.

Bug: 24135025
Change-Id: Iea23f45d236365433c6f6739597833d236ed6d19
2015-12-01 15:42:49 -08:00
Jeff Sharkey
18201f89ee Merge "API to create SharedPreferences from File." 2015-12-01 01:03:39 +00:00
Jeff Sharkey
8fc29cf105 API to create SharedPreferences from File.
Needed to support storage of SharedPreferences on both credential-
encrypted and device-encrypted storage paths.

Bug: 22358539
Change-Id: I576b696951b2a9de817d5be63d31b06f7e166a19
2015-11-30 18:01:20 -07:00
Jeff Sharkey
96b2da271f Merge "Wire up lifecycle, send unlocked broadcast." 2015-12-01 00:13:00 +00:00
Jeff Sharkey
8924e8759f Wire up lifecycle, send unlocked broadcast.
When the correct lock pattern is presented, ask the system to also
unlock credential-encrypted storage, if enabled.  The token passed
along is empty for now, but can be wired up to gatekeeper in the
future.

During each system boot, ask vold to lock all users keys to give us
a known starting state.  This also has the effect of chmod'ing away
any CE data when in emulation mode.

Define and send a new foreground broadcast when the CE storage is
unlocked for the first time.  Add stronger last-ditch checking for
encryption-awareness before starting an app.

Bug: 22358539
Change-Id: Id1f1bece96a2b4e6f061214d565d51c7396ab521
2015-11-30 17:07:54 -07:00
Tom Taylor
3589230400 Add two new intents
One intent notifies the new and previous default sms app when the user
changes which app is the default sms app. The second intent is sent to the
default sms app when some other white-listed app, such as Android Auto or
the phone, modifies the Telephony db behind the default sms app's back.

Change-Id: Iee1e1c4a4c299846f382bd8247c295cf7aaa040e
2015-11-30 13:45:57 -08:00
Zhijun He
53373658a7 Camera2: fix build break
Change-Id: I1641c012eb34fee15b1f4ffa3206de7631014440
2015-11-27 12:58:34 -08:00
Zhijun He
69bd9144b6 Merge "Camera2: update dynamic black level type" 2015-11-27 20:40:10 +00:00