233383 Commits

Author SHA1 Message Date
Yohei Yukawa
ed4952ad0f Reset IMMS when the device is unlocked.
With File-Based Encryption (FBE), now we have yet another runteime event
to reset IMMS state in order to keep the list of available IMEs updated
and make sure one IME is enabled.  Here is the full list of such runtime
events.

   1. Boot phase reaches SystemService.PHASE_ACTIVITY_MANAGER_READY.
   2. One or more packages that contain InputMethodService are updated.
   3. The current user is switched.
   4. The device locale is changed.
   5. The device is unlocked by the current user.

Now we are adding the rule 5 in this CL.

We also apply Copy-On-Write (COW) settings mode, which was added in a
recent commit [1], until the deivice is unlocked.  This allows us to
temporarily update the settings when the device is locked, without
messing up actual SecureSettings.

  [1] I9c6f9bb3d51174198e5f73588637f87ea0d90e11

Here are some examples of what users would see in FBE-enabled devices.
Suppose we have following 5 IMEs installed.

 - IME A: Encryption Aware, pre-installed, ASCII-capable
 - IME B: Encryption Unaware, pre-installed, ASCII-capable
 - IME C: Encryption Unaware, not pre-installed, ASCII-capable
 - IME D: Encryption Aware, not pre-installed, ASCII-capable

 Case 1)
  Before boot:
    Enabled:   IME A
    Selected:  IME A
  Device Locked:
    Available: IME A, IME D
    Enabled:   IME A
    Selected:  IME A
  Device Unolcked:
    Available: IME A, IME B, IME C, IME D
    Enabled:   IME A
    Selected:  IME A

 Case 2)
  Before boot:
    Enabled:   IME A, IME B
    Selected:  IME B
  Device Locked:
    Available: IME A, IME D
    Enabled:   IME A
    Selected:  IME A
  Device Unolcked:
    Available: IME A, IME B, IME C, IME D
    Enabled:   IME A, IME B
    Selected:  IME B

 Case 3)
  Before boot:
    Enabled:   IME B, IME C
    Selected:  IME B
  Device Locked:
    Available: IME A, IME D
    Enabled:   IME A
    Selected:  IME A
  Device Unolcked:
    Available: IME A, IME B, IME C, IME D
    Enabled:   IME B, IME C
    Selected:  IME B

  Note: in this case, IMMS can rely on an existing rule to support
  the situation where enabled/selected IMEs were already uninstalled.

 Case 4)
  Before boot:
    Enabled:   IME B, IME C, IME D
    Selected:  IME B
  Device Locked:
    Available: IME A, IME D
    Enabled:   IME D
    Selected:  IME D
  Device Unolcked:
    Available: IME A, IME B, IME C, IME D
    Enabled:   IME B, IME C, IME D
    Selected:  IME B

Following things should be taken care of subsequent CLs.

 - Add CTS to ensure that at least one encryption-aware IME is
   pre-installed if the device supports FBE.
 - Consider an accidental case where there is no encryption-aware IME.
   This includes the case where all the encryption-aware system IMEs are
   overwritten by encryption-unaware IMEs that have higher versions.

Bug: 26279466
Change-Id: Ifa2225070bf8223f8964cf063c86889e312c5e9a
2016-02-18 15:29:12 -08:00
Chong Zhang
7eb06ffbe1 Merge "Make sure mExiting is cleared when app is set to visible" into nyc-dev 2016-02-18 23:24:48 +00:00
Allen Hair
f20ac2c1b8 Limit modal windows to only hide windows in the same task.
Bug: 26560078
Change-Id: Ic3bd8d06ed0d8d44a8e7f0faaba31a762a9bfef3
2016-02-18 15:24:23 -08:00
Keisuke Kuroyanagi
f491051143 Merge "Optimize: Use measureText instead of doLayout." into nyc-dev 2016-02-18 23:19:44 +00:00
Adam Powell
255b008afe Fix NPE for Fragment#setUserVisibleHint(true)
Fix a bug where calling setUserVisibleHint(true) before adding a
Fragment to a FragmentManager could cause a crash.

Bug 27250018

Change-Id: Id192ae31bab95f15d32de9f105e707bdb8691641
2016-02-18 15:17:29 -08:00
Yohei Yukawa
5eb148bab6 Merge "Stop granting default Contacts permission to IMEs." into nyc-dev 2016-02-18 23:16:06 +00:00
Adam Powell
cff479e2ee Merge "Restore auto-launch behavior for ACTION_CHOOSER with a single choice" into nyc-dev 2016-02-18 23:13:39 +00:00
Aurimas Liutikas
52588ffed0 Merge "Suppressed unused parameter warnings in frameworks/base/tests/Camera2Tests" into nyc-dev 2016-02-18 23:09:47 +00:00
Steve McKay
7295bcbe42 Merge "UX cleanups." into nyc-dev 2016-02-18 23:08:27 +00:00
Christopher Tate
be132e6ea4 Keyguard wallpaper
Clients can now set a lock-only wallpaper that Keyguard can
observe and choose to draw as appropriate.

Bug 25454162

Change-Id: I3fc30e02919e814b55dfded2a1a36ad9d2e55299
2016-02-18 15:01:02 -08:00
Ben Kwa
b4cbd54ea9 Merge "Implement backspace support." into nyc-dev 2016-02-18 22:57:18 +00:00
Amith Yamasani
51911c7953 Merge "DO NOT MERGE Check apps idle states on time changes" into mnc-dr-dev am: 7a313a63ca am: 6aff10d066 -s ours
am: ba32b162a3  -s ours

* commit 'ba32b162a345f38b7df658b742e76daabb670645':
  DO NOT MERGE Check apps idle states on time changes
2016-02-18 22:36:03 +00:00
Tim Murray
b3cbbde740 Fix TOP_APP description in dumpsys activity.
bug 27187310

Change-Id: I65ae24ba04ab3d13ca2fc9ba4088e57d8935b924
2016-02-18 14:30:41 -08:00
Ben Kwa
359bbebb6d Implement backspace support.
Pressing backspace pops the user up a directory level if they aren't at
the root directory of the current root.

BUG=27123794

Change-Id: I8f0a88a1194bf8f082d0b057a288a0c3da3068f6
2016-02-18 14:30:12 -08:00
Chong Zhang
4113ffac61 Make sure mExiting is cleared when app is set to visible
Reset mExiting even if we are not going to do enter animation.

Also make sure has surface state is set correctly if restoring.

bug: 27235356

Change-Id: Ie6e78baefc8242015ed9c37ab221c39860682ab2
2016-02-18 14:27:08 -08:00
Andreas Gampe
a2cc0c2ca2 Merge "Frameworks/base: Use Log.printlns in RuntimeInit" into nyc-dev 2016-02-18 22:26:13 +00:00
Amith Yamasani
ba32b162a3 Merge "DO NOT MERGE Check apps idle states on time changes" into mnc-dr-dev am: 7a313a63ca
am: 6aff10d066  -s ours

* commit '6aff10d0662bc4c7e64a2e6d22f3606ef4dd1046':
  DO NOT MERGE Check apps idle states on time changes
2016-02-18 22:21:32 +00:00
Steve McKay
e2af078488 UX cleanups.
Visually separate directory background from sidebar.
Lower shadows so the "real" effect isn't so prominent.

Hitchhikders:
Consolidate bool values in config.xml files (were in dimens.xml).
Add missing supportsRecents & supportsSearch methods
    to RootInfo.
Rename RecentLoader to RecentsLoader so it doesn't defy
    searching for "Recents" string.
Move Downloads below the divider.

Change-Id: I06c76e26ec6df6541860a1448865c67ed953ed43
2016-02-18 22:21:03 +00:00
Ben Wagner
c1fa6d0deb Use UTF32 directly in HarfBuzz<->Skia interface.
This fixes a TODO to use kUTF32_TextEncoding directly. This avoids
encoding UTF32 codepoints from HarfBuzz into UTF16 to pass to Skia,
which will then re-decode to UTF32. This also removes a use of
SkUtils.h which Skia desires to move to private use.

Change-Id: I087f4216c25f7874e496920cd33e2f109530c397
2016-02-18 17:20:17 -05:00
Wale Ogunwale
ea3aa1bc56 Merge "Protect against surfaceController and hasSurface getting out of sync." into nyc-dev 2016-02-18 22:13:06 +00:00
Adam Lesinski
f2d95f71ad DO NOT MERGE ANYWHERE: UsageStats: Use new settings key idle_duration2 for app idle am: 1559fed4c4 -s ours am: 5c9378f310 -s ours
am: d828c95a93  -s ours

* commit 'd828c95a930c6789f6251bc8a120bf2293a3a22e':
  DO NOT MERGE ANYWHERE: UsageStats: Use new settings key idle_duration2 for app idle
2016-02-18 22:12:23 +00:00
Adam Lesinski
cc869a9fac DO NOT MERGE ANYWHERE: UsageStats: Fix issue where initializing data for first time would cause crash am: 2bd90c6abc -s ours am: bca4317a3b -s ours
am: f2fd47bfa5  -s ours

* commit 'f2fd47bfa5533bb9e57b37760edde71776048c88':
  DO NOT MERGE ANYWHERE: UsageStats: Fix issue where initializing data for first time would cause crash
2016-02-18 22:09:57 +00:00
Adam Lesinski
cfd49456ec Merge branch 'nyc-dev' of /usr/local/google/game/mirror/googleplex-android_googlesource_com/platform/frameworks/base into nyc-dev 2016-02-18 22:08:28 +00:00
Adam Lesinski
fe4db337b3 DO NOT MERGE ANYWHERE: UsageStatsService: Fix app idle issue at rollover time am: 9c7b543325 -s ours am: 7e03454985 -s ours
am: 78a2522c7f  -s ours

* commit '78a2522c7f02570f36a3683a9ba5cfa813abc26e':
  DO NOT MERGE ANYWHERE: UsageStatsService: Fix app idle issue at rollover time
2016-02-18 22:07:23 +00:00
Jeff Sharkey
550b38d85b Merge "Push mapping of package name to appId to kernel." into nyc-dev 2016-02-18 22:07:06 +00:00
Aurimas Liutikas
4642ae0614 Suppressed unused parameter warnings in frameworks/base/tests/Camera2Tests
Bug: 27149500
Change-Id: I3e522d58db88d2933ae82f6f448a8671316b0b35
2016-02-18 14:06:58 -08:00
Adam Lesinski
d828c95a93 DO NOT MERGE ANYWHERE: UsageStats: Use new settings key idle_duration2 for app idle am: 1559fed4c4 -s ours
am: 5c9378f310  -s ours

* commit '5c9378f310acd4ab375ed8a5d703a86522ab814c':
  DO NOT MERGE ANYWHERE: UsageStats: Use new settings key idle_duration2 for app idle
2016-02-18 22:03:35 +00:00
Andreas Gampe
d888beb9bf Frameworks/base: Use Log.printlns in RuntimeInit
Make printlns in Log public-@hide so it can be used.

Print uncaught exceptions that will terminate the process in
RuntimeInit using printlns, so that long exception traces are not
being truncated.

Bug: 27245306
Change-Id: Ib24635f0ebdd80bd125e367302cab6a78e6a210a
2016-02-18 14:01:41 -08:00
Jeff Sharkey
2271ba3627 Push mapping of package name to appId to kernel.
The new sdcardfs kernel driver needs to know this mapping for
deriving UID permissions, so push the data through /config when
supported by the kernel.  This also has the nice benefit of letting
us push only the deltas of what actually changes, instead of
re-parsing the entire "packages.list" file.

The mappings for newly installed apps are pushed before the app is
allowed to run, removing some latent race conditions.  Also cleans
up stale mappings when packages are uninstalled, and whenever the
system server reboots.

Bug: 19160983
Change-Id: Iace92efb69616c96b34c0d9d911e4b54e5fd8a67
2016-02-18 15:01:15 -07:00
Adam Lesinski
f2fd47bfa5 DO NOT MERGE ANYWHERE: UsageStats: Fix issue where initializing data for first time would cause crash am: 2bd90c6abc -s ours
am: bca4317a3b  -s ours

* commit 'bca4317a3bbbdfdda083283d73a26e9c078c84f2':
  DO NOT MERGE ANYWHERE: UsageStats: Fix issue where initializing data for first time would cause crash
2016-02-18 22:00:55 +00:00
Adam Lesinski
78a2522c7f DO NOT MERGE ANYWHERE: UsageStatsService: Fix app idle issue at rollover time am: 9c7b543325 -s ours
am: 7e03454985  -s ours

* commit '7e0345498528611f538d8a5f259acc3440c1a649':
  DO NOT MERGE ANYWHERE: UsageStatsService: Fix app idle issue at rollover time
2016-02-18 21:59:39 +00:00
Wale Ogunwale
722ff89fd1 Protect against surfaceController and hasSurface getting out of sync.
WindowStateAnimator.mSurfaceController is set to null whenever a
surface is destroyed and WindowState.mHasSurface is set to false
shortly after that. However, it is possible for them to get out
of sync in a couple of places due to exceptions or duplicate destroy.
Consolidated the call to set WindowState.mHasSurface inside a finally
block in WindowStateAnimator.destroySurface
Also, cleaned up the code a little to that it is more obvious what is
going on.

Bug: 27235356
Change-Id: I7e6d0c1fb015531c393ac86dcaebebd134fad612
2016-02-18 13:57:45 -08:00
Andre Eisenbach
82a94d98e7 Read Bluetooth interop database entries from settings (1/2)
Interop database entries are stored in the system settings entry
"BluetoothInteropDatabase". The format is a list of entries separated by
";". An entry consists of a BDA fragment, followed by a comma and an
integer representing a feature from interop.h.

Example:
To disable LE secure connections for devices starting with BDA 11:22:33,
use "11:22:33,0".

Bug: 26548845
Change-Id: I6a9fd34f6af4d3bdfcaa0e051eafebdfbf2a4949
(cherry picked from commit 3bc623be8dd8b83d0a22c5cc5b5a8955001f6fc7)
2016-02-18 21:51:44 +00:00
Yohei Yukawa
726c45970e Stop granting default Contacts permission to IMEs.
This partially reverts the previous commit [1], which allowed special
components to be granted some pre-configured default permissions.

With this CL, we no longer grant Contacts permissions to pre-installed
IMEs.  Rationals are:

  1. Even without this CL, not the all pre-installed IMEs are granted
     Contacts permission by default, because it was done during the boot
     time where InputMethodManagerService is not yet completely
     initialized.  The current behavior is confusing not only for users
     but also for developers.
  2. In almost all the cases, IMEs are supposed to be able to work
     without Contacts permission.  Hence it is not too late to ask users
     to grant the permission to the IME after the initial setup is
     completed.
  3. It is difficult to add new features such as File-Based Encryption
     (FBE) with keeping the current implementation, because currently we
     dynamically call mSettings.setCurrentUserId(userId) just to
     enumerate what IMEs will be enabled for a given user.  Adding
     another condition (whether the user has already unlocked the device
     or not) would make things more complicated.

Note that LatinIME has already support the case where Contacts
permission is not granted by default.  It does not ask users for
anything until Setup-Wizard is completed, and requests Contacts
permission only when the user taps a message in the suggestion strip
that suggests users to use contacts name for typing suggestions.

 [1] If8b8cadbd1980ffe7a6fc15bbb5f54a425f6e8f9
     adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd

Bug: 24756974
Bug: 26743676
Change-Id: Ief2a40b5971b3eb97d765f934d20ce7f2ef25665
2016-02-18 13:46:12 -08:00
Chris Tate
40d8823dd3 Merge "Add android:backupInForeground" into nyc-dev 2016-02-18 21:43:28 +00:00
Chong Zhang
82268228a7 Merge "Use background drawable from the client" into nyc-dev 2016-02-18 21:32:45 +00:00
Chong Zhang
d3fd96c208 Use background drawable from the client
And set the drawable's callback to null during drag-resizing, since
we use multi-threaded renderer, will do not want to schedule draws
to the ViewRootImpl's thread.

bug: 26729953
Change-Id: I6e5f94a5a6ba15edc2d391dd11d8fee3c657d337
(cherry picked from commit 1cc95075e89a0f91cb59ff37a1a027199040c7b4)
2016-02-18 21:20:11 +00:00
Chong Zhang
b9b0fec964 Fix flicker when tapping quickly on dock divider
- Only add preserved surface to removal list when the new surface is shown

- When surface mode change again before the previous preserved surface is
  removed, don't do nothing, instead, destroy the current surface which is
  of wrong size.

  bug: 26545679

Change-Id: Ifd548a0fa9ccdcbc9609ca38bb701cc7256cc6e1
(cherry picked from commit ec63381f7596d89719fd3528b181ed1820a4cb84)
2016-02-18 21:18:31 +00:00
Wei Wang
71210b1022 Add Java API for secure RTT protocol.
Change-Id: I1c012f9e92e8b2af332524363f8f0c9921bf4bb5
2016-02-18 13:07:43 -08:00
Etan Cohen
aa36f07194 NAN: Support multiple instantiation per UID - introduce a client ID. [DO NOT MERGE]
Add the concept of a client ID which is used to identify a specific
(one of several) clients in all API calls.

Bug: 26962024
Change-Id: I43f13d51bee8b57c6d0ba1174168288b8d6c21c5
2016-02-18 20:57:44 +00:00
Christopher Tate
43fbc5f898 Add android:backupInForeground
An app can now declare that it really needs to be backed up
whenever possible even if it is currently engaged in foreground-
equivalent work.  Only applies to full-data backup clients: key/value
backups are not intrusive on normal lifecycle so they can already
happen in such circumstances.

Bug 26790411

Change-Id: Ia0ebcc7a53da888ae9ae4d63cd4bcab6e3a2e866
2016-02-18 20:47:36 +00:00
Adam Powell
f5afdb09a6 Restore auto-launch behavior for ACTION_CHOOSER with a single choice
For the initial release of Marshmallow auto-launching was suppressed
for ChooserActivity if there was only a single choice in order to let
the user confirm what would be launched. In practice, many apps use
ACTION_CHOOSER when they should probably use implicit intents, but
still others have use cases where setting a default doesn't make sense
and the user should still be able to make a choice when one is
available.

As the user confirmation didn't buy much in terms of developer API
expectations (ACTION_CHOOSER being a forced choice) and it adds
speedbumps to existing apps in the ecosystem, revert this change.

Bug 27243827

Change-Id: Id8fd5385d5b1f459e80b0096efe7e2944264739a
2016-02-18 12:43:47 -08:00
Makoto Onuki
24f62ea634 Merge "Fix bugs in user restriction migration" into nyc-dev 2016-02-18 20:26:41 +00:00
Amith Yamasani
6aff10d066 Merge "DO NOT MERGE Check apps idle states on time changes" into mnc-dr-dev
am: 7a313a63ca

* commit '7a313a63cac7ae79699a6ea928af92429edd479b':
  DO NOT MERGE Check apps idle states on time changes
2016-02-18 20:16:55 +00:00
Makoto Onuki
6094928806 Fix bugs in user restriction migration
Originally I didn't know user-0 could have PO, so I excluded this case
from migration.  Now we handle it properly.

Also make sure only restrictions that can actually be set by each
owner moves to the owner restriction.  (Because of this, we no longer
have to have DISALLOW_WALLPAPER in the exception list, because
owners can't set DISALLOW_WALLPAPER.)

Bug 27225996

Change-Id: I6ad79d90e6c4400abbb1e4feba6ba59e3b650815
2016-02-18 12:09:30 -08:00
Amith Yamasani
7a313a63ca Merge "DO NOT MERGE Check apps idle states on time changes" into mnc-dr-dev 2016-02-18 20:09:24 +00:00
Ben Kwa
a4acc90b0a Implement type-to-focus in the DirectoryFragment.
Add a helper to the FocusManager, to handle alphanumeric keystrokes.
- Build a search index mapping document titles to adapter positions, and
  keep it up-to-date.
- Intercept alphanumeric keystrokes and build up a search string from
  them.
- Use the search string and index to set focus in the directory listing.
- Highlight code is written, but not activated in the UI for now, to
  minimize surface area for potential breakages.  Revisit enabling
  highlights for O.

BUG=24988911

Change-Id: I148ff5583c655338d12bc06d6484a9ed7aa528ad
2016-02-18 12:04:35 -08:00
Steve McKay
0d198d3afc Merge "Fix CTS failure." into nyc-dev 2016-02-18 20:00:10 +00:00
Steve McKay
b8397607ee Fix CTS failure.
Loosen the reigns on setPickTarget to accommodate no sub command mode.

Change-Id: Ia11c4194970c93fe86e98dfd0d23ed4fa1cea765
2016-02-18 11:59:26 -08:00
Antonio Cansado
12d7ea815b Merge "Implementation of data usage callbacks." into nyc-dev 2016-02-18 19:43:42 +00:00