Commit Graph

5833 Commits

Author SHA1 Message Date
Phil Weaver
6fdd3afdcc Merge "Treat accessibility actions as user activity" into nyc-dev 2016-03-17 22:19:17 +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
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
Seigo Nonaka
9e7a1c9824 Introduce script matching for enabling default IME subtypes.
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
Change-Id: I5bb1bd8cdb9096d516d60beb9936e55bf2b757ae
2016-03-05 18:52:59 -08:00
Jeff Sharkey
3e1958936e Skip publishContentProviders() when we have zero.
If the list of providers for the application being bound is empty,
don't bother trying to register them.

Bug: 27510621
Change-Id: I921fb70a4c97433fa123fa88e170745ee013ee35
2016-03-05 19:49:02 -07:00
Mihai Nita
c743e0fd97 Back region to lang selection: preserve search & position
Saving the scroll position and the search string when the region
selection list is displayed, and restoring them when we get back.

Bug: 26939696
Bug: 26943248

Change-Id: Ia01348923be7d8b9f9d0a3d3377c3bf8ce3132f7
2016-03-04 17:11:59 -08:00
Selim Cinek
cd84059ff4 Merge "Fixed that the bigtext nofitication had slightly different padding" into nyc-dev 2016-03-03 22:32:56 +00:00
Mihai Niță
ee172e7bcb Merge "Show locale in region list even if suggested in language list" into nyc-dev 2016-03-03 21:39:57 +00:00
Selim Cinek
98199ae4c9 Fixed that the bigtext nofitication had slightly different padding
The reason was that we're using a different textview there which uses
a SimpleLayout. This is now changed to also use the same one.

Bug: 27436418
Change-Id: I7e6dd503e09cf69ba8ed5bb6dd07fc79ee519cd3
2016-03-03 13:27:09 -08:00
Mihai Nita
f1f39cf193 Show locale in region list even if suggested in language list
Even if English US is suggested, when choosing English I should
still see US in the country list.
Because now the same LocaleInfo object (from cache) can be present
in both lists (language & region), it means that the label should
depend on the context.
We also need to explicitely disable suggestions in the region list.

Bug: 26590073
Bug: 26939203
Change-Id: Ib1cbad9d26a8b183bf462505335bef04193e82f4
2016-03-03 11:41:09 -08:00
Calin Juravle
0c9ef61944 Merge "Better handling of various types of compilation in DexOptimizer" into nyc-dev 2016-03-03 10:54:02 +00:00
Yohei Yukawa
42275bc8b3 Fix a regression in InputMethodUtils.
It turns out that my previous CL [1] unexpectedly changed the behavior
of InputMethodUtils#getImplicitlyApplicableSubtypesLocked() in terms of
when "EnabledWhenDefaultIsNotAsciiCapable" extra value is taken into
account.

Suppose if an IME X has the following three subtypes:
 A. locale: en_US
    mode: handwriting
    extraValue:
 B. locale: hi
    mode: keyboard
    extraValue:
 C. locale: en_US
    mode: keyboard
    extraValue: AsciiCapable
 D. locale: zz
    mode: keyboard
    extraValue: AsciiCapable, EnabledWhenDefaultIsNotAsciiCapable

Given the above subtypes, here are results of what subtypes are enabled
by InputMethodUtils#getImplicitlyApplicableSubtypesLocked() I) before
the CL [1] and II) after the CL [1].

  - system language: hi:
      I:  B, D
     II:  B, D
  - system language: hi-IN:
      I:  B, D
     II:  B, D
  - system language: en-US
      I:  A, C
     II:  A, C
  - system language: en-GB
      I:  A, C
     II:  A, C
  - system language: ja-JP
      I:  B
     II:  D

What my previous CL actually broke is the the last one, and it's broken
because we accidentally started using
"EnabledWhenDefaultIsNotAsciiCapable" even when there is no subtype that
matches to the requested language.  Previously that attribute was used
if and only if 1) there is a subtype that matches the requested language
and 2) that subtype is not marked to be AsciiCapable.

If there there is no subtype that matches to the requested language,
what we had relied on is actually the result of
InputMethodUtils#findLastResortApplicableSubtypeLocked() called with
  canIgnoreLocaleAsLastResort = true,
which means that we had just picked up the first keyboard subtype as the
last fallback candidate regardless of it's locale.  This is why the
subtype B should be picked up in the last case where system language is
ja-JP.

This CL fixes the above unexpected behavior change regarding
"EnabledWhenDefaultIsNotAsciiCapable" so that the previous behavior can
be preserved.

  [1] Iaf179d60c12b9a98b4f097e2449471c4184e049b
      e985c240e3

Bug: 27129703
Bug: 27425459
Change-Id: Icd86cad955bf827a1eb41255f57fdf4ec315b93b
2016-03-03 09:05:11 +00:00
Calin Juravle
693f997cc8 Better handling of various types of compilation in DexOptimizer
From the runtime perspective extract-only/profile-guide-compiled/fully-
compiled oat files are up-to-date and don't need dex2oat. However,
wihout knowing the exact "class" of the aot file we are not able to do a
full compilation of something previously only-extracted, or limit
profile-guide compilation to only previously profile-guide or extract-
only oat files.

GetDexOptNeeded now accepts a mask of desired types of compilation
that the runtime takes into account when advising what's needed.

This CL adds the necessary handling in DexOptimizer.

Also:
- removes the contraint to use extract-only oat files only when
profiles are enabled.
- removes mDexOptPerformed which interfere with the different types of
compilation and only saved a call to GetDexOptNeeded.

Bug: 27189430
Change-Id: Iced2bdcc3aa7866ff888a3bace43f4b71fffb353
2016-03-02 18:27:10 +00:00
Nimrod Gileadi
c14893bf5a Merge "Close InputStream in BatteryStatsHelper" into nyc-dev 2016-03-02 09:17:21 +00:00
Lorenzo Colitti
e7636e4750 Make it easier to test code that uses WakeupMessage.
Code that uses WakeupMessage uses the AlarmManager. Testing such
code is slow because AlarmManager.MIN_FUTURITY ensures that
alarms must wait at least 5 seconds before firing.

This change makes WakeupMessage's fields protected so that test
code can subclass from it and override schedule() and cancel()
with implementations that do not use AlarmManager, for example
by making schedule() call sendEmptyMessageDelayed and making
cancel() call removeMessages.

Change-Id: I51096b182d9eb87cc7bd46c3c91906f18356b354
2016-03-02 14:15:04 +09:00
Lorenzo Colitti
b7ffb76437 Merge changes Ic366b532,I0179b45b into nyc-dev
* changes:
  Move PinningNetworkCallback out to a new NetworkPinner class.
  Use MessageUtils in ConnectivityManager.
2016-03-02 04:18:03 +00:00
Lorenzo Colitti
531a344300 Move PinningNetworkCallback out to a new NetworkPinner class.
Also add tests.

Bug: 19159232
Change-Id: Ic366b53259ee5944a8e864876425a6558c0a7216
2016-03-02 12:50:35 +09:00
Nimrod Gileadi
e9be5da686 Close InputStream in BatteryStatsHelper
Bug: 17760659
Bug: 27376093
Change-Id: I5e6471f73b3258067fb670a4b66ddc51be62b6ec
(cherry picked from commit e618b53081d9a173305b7c72cab4c2ed6ca2dcec)
2016-03-01 19:43:52 +00:00
Andreas Gampe
4f655de3de Merge "Frameworks/base: Refactor TextView initialization" into nyc-dev 2016-03-01 18:38:09 +00:00
Jeff Sharkey
de2dabbad6 Skip boot prompt for both native and emulated FBE.
Bug: 27412530
Change-Id: I53d39392ccab54cb79cf6cc1e51923ad7b5a3b0c
2016-02-29 17:12:34 -07:00
Andreas Gampe
ddc1397eba Frameworks/base: Refactor TextView initialization
To allow static initialization of a number of View classes based
on TextView, refactor the initialization of the font cache to be
explicit from the zygote.

Bug: 27265238
Change-Id: I1b71086d3f49d8b3e72eea2bf8359351d25fc0fd
2016-02-29 11:13:01 -08:00
Jeff Sharkey
f8880561e6 When system server goes down, crash apps more.
Similar to first patch, but now using new "rethrowFromSystemServer()"
method which internally translates DeadObjectException into
DeadSystemException.  New logic over in Log.printlns() now
suppresses the DeadSystemException stack traces, since they're
misleading and just added pressure to the precious log buffer space.

Add some extra RuntimeInit checks to suppress logging-about-logging
when the system server is dead.

Bug: 27364859
Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123
2016-02-27 17:17:01 -07:00
Adam Lesinski
09c09fd345 Merge "BatteryStats: Fix issue where network traffic accounting might be lost" into nyc-dev 2016-02-27 00:15:11 +00:00
Muyuan Li
94ce94e960 Allows components to register shortcut key.
The registered shortcut will be called from PhoneWindowManager,
before dispatching

Change-Id: If26128939b45a639c8895719a7a23ca433f39fd9
(cherry picked from commit 4da863c5a8872dcabb179a978a2b2157d9081679)
2016-02-26 22:30:34 +00:00