Commit Graph

5854 Commits

Author SHA1 Message Date
Yohei Yukawa
2c8d528188 Merge "Make sure to call back reportFinish() on the desired Handler." into nyc-dev 2016-03-23 21:48:51 +00:00
Abodunrinwa Toki
7c89170099 Merge "FloatingToolbar: Make it more obvious that there are more items in the overflow." into nyc-dev 2016-03-23 19:03:51 +00:00
Abodunrinwa Toki
f0f4d73b5b FloatingToolbar: Make it more obvious that there are more items in the overflow.
1. Make the overflow show part of the items hidden behind the scroll view
2. Increase the time the scrollbar is on screen so users are less likely to miss it

Bug: 27427333
Change-Id: Ia0bff5fa29cba3103263bc7d063176b0ba7ff7b9
2016-03-23 19:02:32 +00:00
Adrian Roos
9b95f615c4 Merge "Ensure notification color contrast" into nyc-dev 2016-03-23 18:14:54 +00:00
Adrian Roos
4ff3b120ff Ensure notification color contrast
Ensure we have at least 3:1 contrast for the
action buttons. Also ensures that the inline
reply box background has 4.5:1 contrast to white.

Further modifies the color of the inline reply
background to satisfy a 4.5:1 contrast ratio for
the entered text.

Bug: 26831312
Change-Id: If42b1c99d1adee547d0a583c1a69c48ef7287c23
2016-03-23 10:49:40 -07:00
Chris Banes
ccf8e661c7 Allow AlertDialog to be used in a DialogFragment
AlertController calls requestWindowFeature() too
later for DialogFragment. Fixed by moving it to the
constructor.

BUG: 27809055
Change-Id: Icef01316b4e857b41ccc29cc56bbcecd7f629342
2016-03-23 16:20:00 +00:00
Yohei Yukawa
c1a72b6b74 Merge "Remove redundant IMM#mServedInputConnection." into nyc-dev 2016-03-23 05:41:08 +00:00
Yohei Yukawa
16e2c7b59a Make sure to call back reportFinish() on the desired Handler.
Before exposing #reportFinish() as a public API, we have to fix an
existing bug that my previous CL [1] for Bug 26945674 forgot to take care.

Currently BaseInputConnection#reportFinish() is always called by using
the root view's Handler.  We should move the logic to call
BaseInputConnection#reportFinishInputConnection() from ViewRootImpl to
IInputConnectionWrapper to make sure that the method in question can
always be called on the desired Handler.

To make things simple, instead of explicitly calling #reportFinish()
from IMM, this CL let ControlledInputConnectionWrapper#diactivate()
internally call #reportFinish() as needed.  This makes it easier to make
sure that #reportFinish() is called after all the queued method calls
are handled.

  [1]: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
       612cce92ad

Bug: 25332806
Change-Id: Ibe94f115e607a198d12ecd3d4e4f91a7d9469c98
2016-03-22 21:27:48 -07:00
Yohei Yukawa
afb6558c8f Remove redundant IMM#mServedInputConnection.
Following two fields have basically the same lifetime.
 - InputMethodManager#mServedInputConnection
 - InputMethodManager#mServedInputConnectionWrapper
Hence we do not need to maintain both of them.

This is a preparation CL for Bug 25332806 and does not change any
user-visible behavior.

Bug: 25332806
Change-Id: I1181e067aa5bedbdf0c7ec1bcec479257aea511c
2016-03-22 20:53:08 -07:00
Wale Ogunwale
b2303ddd05 Merge "Don't finish resolver activity onStop if it is for home intent" into nyc-dev 2016-03-21 22:53:10 +00:00
Wale Ogunwale
9014e66db0 Don't finish resolver activity onStop if it is for home intent
Helps avoid a continuous launch cycle if a resolver activity resolving
the home intent is the only activity in the system and the lock screen
is up which will put the activity in the stopped state. The activity
then finished itself onStop, but is then relaunched by the activity
manager since there are no other activities in the system and the
home activity should be present.

Bug: 27674536
Change-Id: Iaca67a00c4a37f70aafd18aedcbd8dba2f561203
2016-03-19 15:57:07 -07:00
Dianne Hackborn
bf949ce8a0 Merge "Fix issue #27653326: Sync doesn't work in doze maintenance" into nyc-dev 2016-03-19 00:53:03 +00:00
Yohei Yukawa
1064d35307 Merge "Tell IMS about missing InputConnection methods." into nyc-dev 2016-03-19 00:36:22 +00:00
Dianne Hackborn
2fefbcf0d1 Fix issue #27653326: Sync doesn't work in doze maintenance
Add a (configurable) delay between when we start a maintenance
window until the minimum time we will end it.

Also switch to using the alarm manager callback API.  (Yay!)

Also fix a little printing problem in the alarm manager dump
so we put the package name and not some class hash in the
summary string of an alarm entry.

Change-Id: I4281e5c80bc8b26ebc1fb6f603ec33ec0e379daa
2016-03-18 16:52:30 -07:00
Adam Powell
4c284d513c Don't bind ChooserTargetServices as user CURRENT
Bug 26151189

Change-Id: I8ea76de499f7a7b9edbf1de3117d34d91bfa36ae
2016-03-18 16:04:27 -07:00
Jeff Sharkey
910e7726b3 Merge "Changes of root storage space unmounting time on Zygote Process" into nyc-dev 2016-03-18 17:44:55 +00:00
Adam Powell
13ea8f48ab New string for resolving ACTION_SENDTO intents
"Share" didn't make much sense here since SENDTO is used for sending
content to a specific recipient, e.g. emailing a person from their
Contacts page in the dialer.

Bug 23626568

Change-Id: I8ac4f2aee5c41aa6c2d546b39283c6f22127cefe
2016-03-18 09:39:41 -07:00
doheon1.lee
885b742bb6 Changes of root storage space unmounting time on Zygote Process
Zygote process forks every child process for launch the SystemServer and other
applications. When child process is forked, unmount storage inherited
from Zygote process is executed before it gains its own root storage
space.
If Zygote have no storage spaces, unmount operations not needed to
get relevant permission storage space.
Thus unmount is executed only once shortly before the SystemServer is forked.
And the child processes do not unmount its inherited root storage space.

Change-Id: I311ca7ea2c93085f42579f8cf8bdc7ef1d570a04
2016-03-18 10:31:31 -06:00
Abodunrinwa Toki
2e303d20c6 Merge "FloatingToolbar: Hide panels when they're invisible." into nyc-dev 2016-03-18 15:29:29 +00:00
Phil Weaver
6fdd3afdcc Merge "Treat accessibility actions as user activity" into nyc-dev 2016-03-17 22:19:17 +00:00
Abodunrinwa Toki
0cf648917f FloatingToolbar: Hide panels when they're invisible.
This patch sets the visibility of a panel to INVISIBLE when it's
alpha is 0. This will ensure that a user cannot interact with a
view that cannot be seen. Not doing this resulted in a bug where
the user will tap on an area of the toolbar and activate an
unintended action.

It also removes the redundant mResetOverflowButtonDrawable. It's
actions are already performed in setPanelsStatesAtRestingPosition.

Bug: 27693433
Change-Id: Iafcde23622c7d1604924c520f6748fdbb8b135e7
2016-03-17 18:55:47 +00:00
Phil Weaver
da80d676c7 Treat accessibility actions as user activity
Resurrecting ag/665912.

Bug: 19531976
Change-Id: Ibdddd507215e61b9f4313c36eab8845e9940a7ac
2016-03-17 10:09:39 -07:00
Yohei Yukawa
e771d58733 Remove an unused constructor of InputMethodSettings.
The last caller of the deprecated constructor of InputMethodSettings was
just removed [1].  Since it is not a public API, we can now safely
remove it.

  [1]: I09cba4066b95c4a9e89a3e4f83d75b97882502dc
       143a6869476a4be5962d4bba3b222d078f46b9a0

Bug: 26279466
Change-Id: I9035c417d6a8166c0ef4e4c7a00c151ffdd5fb49
2016-03-17 06:22:23 +00:00
Yohei Yukawa
fb8aa06883 Merge changes I068f8821,Ibcf12746,I169ad495 into nyc-dev
* changes:
  Add more @NonNull/@Nullable to TextServicesSettings.
  Remove an unnecessary int to String conversion.
  Add more @NonNull/@Nullable to InputMethodSettings.
2016-03-17 02:03:00 +00:00
Yohei Yukawa
7b574cb8a1 Add more @NonNull/@Nullable to InputMethodSettings.
This follows up to a previous CL [1] for Bug 26279466.

It turns out that we have not clearly defined how nonexistent key should
be handled in InputMethodSettings#getEnabledInputMethodsStr(), e.g. it
returns "" for when mCopyOnWrite is true but returns null when
mCopyOnWrite is false.

Also, since InputMethodSettings now can revert changes made during
mCopyOnWrite is true, the caller may also start receiving null in the
following scenario.
  1. call mSettings.switchCurrentUser(userId, true).
  2. call mSettings.putEnabledInputMethodsStr(str) where str is non-null.
  3. call mSettings.switchCurrentUser(userId, false).
  4. call mSettings.getEnabledInputMethodsStr().
If the caller of getEnabledInputMethodsStr() has assumed that it would
never return null, then it would start crashing due to NPE.

With this CL, getEnabledInputMethodsStr() is marked to be @NonNull we
should no longer see such kind of NPE.

  [1]: I9c6f9bb3d51174198e5f73588637f87ea0d90e11
       68645a638a

Bug: 27687531
Change-Id: I169ad4957e68b65c64251b0849056195b8ca4911
2016-03-16 17:22:22 -07:00
Sunny Goyal
2a6d9aa1cd Adding a default implementation for the new Window.Callback method
Bug: 27702972
Change-Id: I6b8c1766ecf871801006d4dc47796a819e49bb57
2016-03-16 17:13:26 -07:00
Roshan Pius
85eb7a97ef Merge "Fix a bug in ControllerActivityCounter" into nyc-dev 2016-03-16 15:05:14 +00:00
Sudheer Shanka
7a9c34bd7a Show admin support dialog if app is suspended.
Bug: 26922950
Change-Id: I21f048873244df52d14910cc01a658af476d9149
2016-03-15 10:40:04 -07:00
Yohei Yukawa
19a80a1e80 Tell IMS about missing InputConnection methods.
Summary:
  This CL introduces a unified mechanism to deal with the situation
  where the application directly implements InputConnection but some of
  methods are not implemented.  Note that there should be zero overhead
  when the application extends BaseInputConnection or
  InputConnectionWrapper.

Background:
  When ever we add a new method to InputConnection, there has been a
  risk that existing applications that directly implement
  InputConnection can get java.lang.AbstractMethodError exception at
  runtime, because older SDKs do not require the application developer
  to implement the methods that are newly added in later SDKs.  Because
  of this we strongly discouraged developers to directly implement
  InputConnection interface, and encouraged them to subclass
  BaseInputConnection or InputConnectionWrapper instead.  That said, as
  requested in Bug 26945674, there is a certain demand to be able to
  implement InputConnection without depending on BaseInputConnection.
  The goal of this CL is to provide a reliable and sustainable solution
  to above missing method scenario in InputConnection.

  One of the reasons why dealing with missing InputConnection methods is
  so difficult is that what InputMethodService receives to communicate
  with the target application is actually a proxy class
    com.android.internal.view.InputConnectionWrapper
  that runs in the IME process and immediately returns true for most of
  methods in InputConnection such as #commitText() and
  #finishComposingText().  Because of this asynchronous nature, it is
  too late to change the actual return value that the IME receives when
  the application receives those one-way asynchronous IPC calls.

Solution:
  To handle those cases, this CL checks the availability of
  InputConnection methods that did not exist in the initial release
  before the target application calls startInput(), and let the
  application to send its availability bits to IMMS so that
  InputConnectionWrapper running in the IME process can be initialized
  with such availability bits.  Note that we do know that
  BaseInputConnection and its subclasses support all the InputConnection
  methods, hence for most of applications we can just assume that all
  the methods are available without reflection.

  With such availability bits, InputConnectionWrapper is now able to
  gracefully return failure code to the IME because the availability of
  those methods is immutable, except for a tricky case where the
  application relies on a proxy object that dynamically changes the
  dispatch target.

  Here is the list of APIs that we start checking the availability in
  this CL.
    [API Level 9+]
     - InputConnection#getSelectedText(int)
     - InputConnection#setComposingRegion(int, int)
    [API Level 11+]
     - InputConnection#commitCorrection(CorrectionInfo)
    [API Level 21+]
     - InputConnection#requestCursorUpdates(int)}
    [API Level 24+]
     - InputConnection#deleteSurroundingTextInCodePoints(int, int)
     - InputConnection#getHandler()

Ideas alternatively considered: Default methods in InputConnection
  We once considered having default methods in InputConnection but
  abandoned this idea because it does not directly solve the problem
  about how to tell the that the API does not take effect.
  Also having default methods would make it difficult for application
  developers to be aware of newly added methods in InputConnection.

Bug: 27407234
Bug: 27642734
Bug: 27650039
Change-Id: I3c58fadd924fad72cb984f0c23d3099fd0295c64
2016-03-15 06:43:39 +00:00
Roshan Pius
816433093c Fix a bug in ControllerActivityCounter
We were returning the RxtimeMillis counter instead of idleTimeMillis
counter in |getIdleTimeCounter|.

BUG: 27268322
Change-Id: If08a64095b375e078aef2a935b144c4285ead08b
2016-03-14 16:45:55 -07:00
Chris Tate
fcbe17e1e0 Merge "Once restored, the wallpaper needs to actually draw" into nyc-dev 2016-03-12 01:55:19 +00:00
Christopher Tate
41297ff82c Once restored, the wallpaper needs to actually draw
We now wait until both the wallpaper imagery and the metadata have
been restored [if present], and then explicitly regenerate the crop
from the source based on that.

Bug 27423845

Change-Id: I986efd13b6b73d25b5ab1215af516ccea3a5c609
2016-03-11 17:51:33 -08:00
Ruben Brunk
89db9dbedb Merge "Allow per-package exemptions for restricted AppOps" into nyc-dev 2016-03-11 22:48:38 +00:00
Ruben Brunk
29931bc684 Allow per-package exemptions for restricted AppOps
- When setting blanket user restrictions, per-package
  exemptions may be granted.
- Exempt the current active VrListenerService from the
  blanket restriction on drawing overlays while in VR mode.

Bug: 26775563
Change-Id: I14b17a126502c7905a970ad42d25d6dd600b86b1
2016-03-11 14:05:44 -08:00
Yohei Yukawa
fc1713dfad Merge "Use LocaleUtils#filterByLanguage for non-keyboard subtypes." into nyc-dev 2016-03-11 19:56:03 +00:00
Yohei Yukawa
238faad984 Use LocaleUtils#filterByLanguage for non-keyboard subtypes.
With this CL, we expand the target of Bug 27129703 and Bug 27348943 to
non-keyboard subtypes.

Suppose there is a handwriting IME (mode == "handwriting") that supports
the following 5 subtypes.
  - en-US
  - en-GB
  - fr
  - sr-Cyrl
  - sr-Latn

Also suppose the system languages are configured as follows.
  1. sr-Latn-RS
  2. ja-JP
  3. fr-FR
  4. en-GB
  5. en-US

In this case we want to enable [sr-Latn, fr, en-GB] by default when
"use system language" is checked in the subtype enabler.

See previous commits [1][2] about how we addressed those issues for
keyboard subtypes.

  [1]: Iaf179d60c12b9a98b4f097e2449471c4184e049b
       e985c240e3
  [2]: I8fc774154f5175abff2f16e8f12a4847bf5f5b7c
       072a95a309

Bug: 27560993
Change-Id: I416b5671602c550805ed6267dd210968aa1de83c
2016-03-11 10:39:51 -08:00
Alan Viverette
f6d87ec193 Add consistent @NonNull annotations for drawable callbacks
Bug: 27599515
Change-Id: I33fdc5392302403bfff9cc74a8226173ec962af6
2016-03-11 10:09:14 -05:00
Yohei Yukawa
80861ff1c0 Make sure to compare subtype language with system language.
This CL addresses a regression introduced by a recent CL [1] that
non-keyboard subtypes are no longer implicitly enabled based on the
system language (a.k.a. "use system language" in the subtype enabler)
due to a type mismatch in comparison.

Here is the original logic:
 if (language.equals(systemLanguage) && systemLocale.startsWith(locale))

And here is the logic replaced by [1]:
 if (locale != null && locale.equals(systemLanguage)) {

The new logic is simply broken, because locale is a Locale object while
systemLanguage is a String object.  It never matches.

With this CL we will compare the system language with the locale
language again, with several test cases that should have been included
in [1], as a temporary solution until we start relying on
LocaleUtils#filterByLanguage() for non-keyboard subtypes.

  [1]: Iaf179d60c12b9a98b4f097e2449471c4184e049b
       e985c240e3

Bug: 27560993
Change-Id: If2d1710174853180465832e6ecbbb91235b76210
2016-03-11 01:08:52 -08:00
Adam Lesinski
58f1018c56 Merge "Cache per-Activity Resources objects" into nyc-dev 2016-03-10 20:50:40 +00:00
Adam Lesinski
082614c6a5 Cache per-Activity Resources objects
Each Activity has a Resources object whose underlying state changes
when a configuration change occurs, both global and for that activity only (multi-window).
Views and other clients of the Resources object can safely cache it knowing that
they always have a reference to the most up-to-date resources.

This applies to Resources.Theme objects as well.

Bug:26854894
Change-Id: Ifd3da5a1086e17f747dfc265a447fe92a3a5c692
2016-03-10 11:30:18 -08:00
Muyuan Li
2f14bb31ae Merge "Added shortcut key to dock windows" into nyc-dev 2016-03-10 17:33:44 +00:00
Joe Onorato
713fec85b8 Add an API for apps to get their System Health / Battery Stats data.
Change-Id: Ib27e1be469b826f6d83d73ce6024102bbdb1d47a
2016-03-09 15:47:24 -08:00
Muyuan Li
a212999f24 Added shortcut key to dock windows
Meta + [ / ] will dock top window to left / right or cycle
between 1/3 1/2 2/3 of screen if it's already in docking mode

Change-Id: I546418235a9b9699d406b04f52914c85bd950532
(cherry picked from commit 63635675b56564a17e3897a221d73a19cfbc77f7)
2016-03-09 18:35:50 +00:00
Paul Lawrence
20be5d6247 Add API to IMountService to get encryption state
Bug: 18002358
Change-Id: If7d9c9a5ed38ac37849fcf638ec10c76d2f419a1
2016-03-08 15:03:54 -08:00
Selim Cinek
f7f4537f4f Merge changes I6e5dc836,Ia0c663f0,I97eb6e79,I8a4a0213,I87798da9, ... into nyc-dev
* changes:
  Removed the group expand button
  Removed the bundle number from the header
  Fixed a crash with notification children
  Fixed a bug where the media header wasn't indented
  Fixed fading and dozemode for custom notifications
  Fixed a group bug with a single expanded child
  Fixed a bug where the top child notification wasn't expandable
  Fixed a bug where heads up where not expandable by touch
  Fixed a bug where the wallpaper was shining through the background
2016-03-07 23:43:58 +00:00
Mihai Niță
e47b0d4fc2 Merge "Back region to lang selection: preserve search & position" into nyc-dev 2016-03-07 23:18:31 +00:00
Selim Cinek
50c6e498b1 Fixed a bug where the media header wasn't indented
We need to remeasure in case we change the params.

Bug: 27494315
Change-Id: I8a4a0213db75f866a87a5c117f98d80fe80641c9
2016-03-07 15:11:52 -08:00
Seigo Nonaka
072a95a309 Introduce script matching for enabling default IME subtypes.
This is 2nd attempt of I5bb1bd8cdb9096d516d60beb9936e55bf2b757ae

The motivation of this CL is enhance the default IME subtype enabling
algorithm.  The new approach is done by score based algorithm.  The
design of the matching score is determined as follows:
- The matching score for the each two locale is up to 3 and determined
  as follows:
  - Score of 3 : matches all language, script and country.
  - Score of 2 : matches the language and script.
  - Score of 1 : matches the language regardless of country.
  - Score of 0 : doesn't match the language regardless of script and
                 country.
- All locales are fully expanded before matching by addLikelySubtags in
  ICU.

Bug: 27129703
Bug: 27348943
Change-Id: I8fc774154f5175abff2f16e8f12a4847bf5f5b7c
2016-03-07 11:50:30 -08:00
Yohei Yukawa
77dd59fc2a Revert "Introduce script matching for enabling default IME subtypes."
This reverts commit 9e7a1c9824.

Seems that that CL causes ArrayIndexOutOfBoundsException when
initializing InputMethodManagerService, which results in an infinite
boot animation.

Bug: 27129703
Bug: 27348943
Change-Id: I474a87876670ac018c675ac7b4608e90fbb2434b
2016-03-05 21:46:20 -08:00
Seigo Nonaka
d22b31bef7 Merge "Introduce script matching for enabling default IME subtypes." into nyc-dev 2016-03-06 03:02:26 +00:00