Commit Graph

5758 Commits

Author SHA1 Message Date
Svet Ganov
9cea80cddd No overlay when permissions shown - framework
bug:26973205

Change-Id: I88395e47649191bb7db6dd8723c49e741ef4f1e4
2016-02-20 17:41:47 +00:00
Selim Cinek
24ffe236b1 Merge "Media notifications now properly respect font size changes" into nyc-dev 2016-02-19 23:04:15 +00:00
Jorim Jaggi
42625d1bc7 New behavior for docked stack when going home
- We keep the docked stack visible when home task is visible even
though it's not resizable.
- We introduce the a new concept called "minimizing" the docked stack,
which happens when going home. In this state, the docked stack is
clipped of almost completely.
- To achieve that, we introduce TaskStackBoundsAdjustController,
which adjusts the bounds of the docked stack when minimized. Also,
migrate the IME handling to this new class.
- We also need to inform SysUI that it is now minimized so it can
remove the drag affordance on the divider, and also make it a bit
smaller.
- When we detect an app transition, we check whether the home stack
gets visible/invisible. We then start an animation which runs in
sync with the normal app transition. For that we introduce
DockedStackDividerController.animate(), which performs the animation.

Bug: 27137961
Change-Id: I8623bc73cc6872bf28c5b1b8d5795974576811b2
2016-02-19 12:11:11 -08:00
Selim Cinek
d2feb63aaf Media notifications now properly respect font size changes
Bug: 24866646
Change-Id: I6e38aea518bee1b933fdc8efd460e95eaaaed3b0
2016-02-19 11:54:41 -08:00
Lorenzo Colitti
a2a9ab947f Add a MessageUtils class to convert int constants to strings.
am: d2457a3ee3

* commit 'd2457a3ee39ea55ed8e302bd93feede793cb5055':
  Add a MessageUtils class to convert int constants to strings.
2016-02-19 05:01:56 +00:00
Yohei Yukawa
116d872d9c Merge "Introduce InputConnection#getHandler()." into nyc-dev 2016-02-19 02:36:50 +00:00
Lorenzo Colitti
d2457a3ee3 Add a MessageUtils class to convert int constants to strings.
This class uses reflection to find accessible static integer
members in a specified list of classes and returns a SparseArray
mapping the integers to their names. This will allow us to
replace various 400-line switch statements with a simple
array access.

Change-Id: I3607e6389a423cde0bd83270c00b3c863ae1bb29
2016-02-19 10:26:55 +09: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
Andreas Gampe
a2cc0c2ca2 Merge "Frameworks/base: Use Log.printlns in RuntimeInit" into nyc-dev 2016-02-18 22:26:13 +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
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 1cc95075e8)
2016-02-18 21:20:11 +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
Erik Kline
bc163f07ee Add Protocol.BASE_ETHERNET
am: ca4c61aa9f

* commit 'ca4c61aa9f7396a167202ea83f4d02f7f62ba482':
  Add Protocol.BASE_ETHERNET
2016-02-18 18:19:06 +00:00
Erik Kline
ca4c61aa9f Add Protocol.BASE_ETHERNET
Change-Id: I4e51370c0b53d9902eea8aae409f9f7cffaf28ad
2016-02-18 18:15:52 +09:00
Yohei Yukawa
c2393ac3bf Fix bugs in logic to find a default selectd IME.
With this CL, InputMethodManagerService#resetDefaultImeLocked()
picks up the default selected IME with the same logic to find the
default enabled IMEs [1].  It should make sense because the default
selected IME should be one of the default enabled IMEs.  The previous
code is problematic because it does not check whether the IME is enabled
or not.  There was a chance that unusable IME could be picked up.

This CL also fixes the same problem to Bug 17347871 that only language
part of the locale is taken into account.

  [1] See the following series of CLs.
    - part 1: I831502db502f4073c9c2f50ce7705a4e45e2e1e3
              ed20f8d750ef0b6347448265a14ef2a2c7e1af5c
    - part 2: Ife93d909fb8a24471c425c903e2b7048826e17a3
              745e7bca8a622ffdf0d0a8e8e2485eab98182ede
    - part 3: I6571d464a46453934f0a8f5e79018a67a9a3c845
              d0dbd81fe2cd34c9a83e2f5217374d3e1a79f950
    - part 4: I871ccda787eb0f1099ba3574356c1da4b33681f3
              b21220efae

Bug: 27197621
Change-Id: Ia0f52c1fb9f5a68230284a1ec4829a2337b60bdd
2016-02-18 00:30:45 -08:00
Arunesh Mishra
3fff7f5634 SoundTriggerHelper changes for GenericSoundModels.
- Refactoring SoundTriggerHelper to handle generic sound models.
     - Ability to store multiple models, callback and state information.
     - Separate out initialization to be done per voice model, per any model
     and per generic model.
 - Minor change to the API exposed -- removing the Handler from the
   createSoundTriggerDetector call.
 - Added callback processing for onRecognitionEvent().
 - Added logic for stopAll().
 - Changes to the SoundTriggerTestApp to start/stop recognition.
     - Multiple models (3).
     - Ability to start/stop/load/unload individual models.

Bug: 22860713
Bug: 27222043
Change-Id: Ie5d811babb956bead653fb560a43f1e549ed11bd
2016-02-17 14:24:03 -08:00
Yohei Yukawa
93dfc03ba6 Merge "Add Copy-On-Write mode to InputMethodSettings." into nyc-dev 2016-02-17 17:11:54 +00:00
Yohei Yukawa
68645a638a Add Copy-On-Write mode to InputMethodSettings.
This is a preparation for File-Based Encryption (FBE) support in IMMS.

In order to support File-Based Encryption (FBE), IMMS needs to reset
its internal state exactly when the device is unlocked by user first
time. This is important because IMMS would recognize only
encryption-aware input method services until the the device is unlocked
by the current user.

Even if we reset the internal state when the device is unlocked by the
current user, there are still two tricky points.

 1. Except for the initial boot, IMMS uses Secure Settings to determine
    what IMEs are enabled and what IME is currently selected.  These
    persistent state may not be suitable for the situation where the
    device is not unlocked yet, because some of IMEs referenced there
    may or may not be encryption-aware.  Depending on the situations,
    we may need to enable at least one encryption-aware IME to ensure
    that the user is able to type password to unlock the device, even if
    such an IME is not Settings.Secure.ENABLED_INPUT_METHODS.  We have
    to be careful when doing this because we don't want non
    pre-installed IMEs to be enabled until the user approves it.
 2. IMMS tends to save its internal state into Secure Settings.
    However, because of the point 1, we may need to automatically enable
    a certain IME to make sure the user is able to type even when the
    device is not unlocked yet.  We don't want such a temporary state
    to be persistent in Secure Settings.

The basic idea of this CL is to implement Copy-On-Write (COW) mode in
InputMethodSettings so that we can later discard any changes made before
the device is unlocked.  As the initial step, we start using this COW
mode until the the ActivityManager becomes ready.  With this change we
can revert a previous commit [1] for Bug 6685037, where forward-locked
encrypted apks need to be taken care of an early boot phase.

  [1] Ifb311f85154beadd4787ec73669bedfdf1f5172d
      4c0e7152e7

Bug: 26279466
Change-Id: I9c6f9bb3d51174198e5f73588637f87ea0d90e11
2016-02-17 07:54:20 -08:00
Makoto Onuki
dafec11e69 Merge "Don't allow deactivating DAs when the user is not unlocked" into nyc-dev 2016-02-16 20:47:10 +00:00
Alan Viverette
60d9695bb8 Force uniform width for MATCH_PARENT in AlertDialogLayout
The initial layout passes run using whatever was specified by the
parent, which ensures that TOO_SMALL will get set correctly when
needed. The final layout pass runs as EXACTLY to ensure that
MATCH_PARENT widths are correctly set.

Bug: 27030200
Change-Id: Ia7af3f75746e725761e78e7c4eefb0b31f499113
2016-02-16 18:07:32 +00:00
Jeff Sharkey
a3331309a9 Merge "Disable StrictMode when starting activity." into nyc-dev 2016-02-16 16:47:48 +00:00
Tao Bao
1256ab6734 Merge "BootReceiver: Stop using SharedPreferences." into nyc-dev 2016-02-16 16:46:54 +00:00
Jeff Sharkey
2b9eb89aed Disable StrictMode when starting activity.
Since intents can come in from older apps, don't let them crash us
by including file:// Uris.  This narrows the relaxation to only apply
when starting the requested intent.

Bug: 27070755
Change-Id: Ifcf9068424e072f52758c8feeab5fbf23d678a2e
2016-02-16 09:21:53 -07:00
Yohei Yukawa
ce3f338040 Merge changes I0f79243e,Ia27e19f9,Iec6b89f0,I276c7eb0 into nyc-dev
* changes:
  Have unified setter/getter for Secure Settings.
  Remove redundant arguments.
  Use Context#getSystemService(Class<T>) in IMMS.
  Use Java7 diamond operator in InputMethodUtils.
2016-02-16 16:11:50 +00:00
Tao Bao
8b231a96a1 BootReceiver: Stop using SharedPreferences.
BootReceiver was using SharedPreferences to record the timestamp that a
log file was lastly added to the dropbox. It no longer works after the
cleanup of the ContextImpl, because Context storage APIs are designed
for app data storage (as opposed to the system server). This CL switches
to writing its own xml file instead (/data/system/log-files.xml).

Bug: 26966507
Change-Id: Ife6b7544a7636b37dd239f059d1ca8c9c28f81a3
2016-02-15 14:31:56 -08:00
Yohei Yukawa
8752367042 Have unified setter/getter for Secure Settings.
In order to make InputMethodManagerService encryption-aware, we are
going to introduce a new state where any read/write access to Secure
Settings from IMMS is virtualized so that we can temporarily enable
only encryption-aware IMEs until the user unlocks the device then revert
any changes made before the device enters into an unlocked state.

To do that, it would be convenient if InputMethodUtils has unified
getter/setter methods to access (Secure) settings.  In subsequent CLs we
will rely on those getter/setter methods to switch between the on-memory
data store and the actual Secure Settings.  Note that because of
multi-user support such a switch can occur multiple times.

This is still a preparation code.  Behavior change is not intended yet
in this CL.

Bug: 26279466
Change-Id: I0f79243e5cc1556764da37fa38078e075a27d42b
2016-02-12 19:37:08 -08:00
Makoto Onuki
1a5ee776ee Don't allow deactivating DAs when the user is not unlocked
Bug 27149570

Change-Id: I772d9cbd6edc822c8f7b1988905b702e05e674cd
2016-02-12 16:04:42 -08:00
Adam Powell
5e6d6f5824 Merge "ChooserActivity direct share jank fixes" into nyc-dev 2016-02-12 21:14:39 +00:00
Jorim Jaggi
9f6798a936 Fix layout for full-screen floating windows
When the app doesn't set IN_SCREEN and INSET_DECOR but the window is
still full-screen, we force SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN but then
we still need to communicate the content insets to the DecorView.

In DecorView, we consume these insets in this mode and set it as
layout params so this behavior is completely transparent for the
app.

Bug: 26464646
Change-Id: Ib7332b845767a5bbc0266c380bf6240e322db943
2016-02-12 19:31:07 +00:00
Ritesh Reddy
ae0bcddc86 Stashing SyncSettings for accounts added aft SUW
Stashing SyncSettings for accounts not added by SUW Restore time
and restoring these settings whenever the account is added.

Bug: 26181613
Change-Id: Ia83e3fd43385a05424a8991115aa21ac90f4cd49
2016-02-12 15:49:01 +00:00
Clara Bayarri
29b13190cd Merge "Add support for current failed lock attempts and max attempts" into nyc-dev 2016-02-12 13:54:10 +00:00
Clara Bayarri
51e41ad887 Add support for current failed lock attempts and max attempts
This is needed from Settings to show a message informing the user
of the number of attempts before their work profile gets wiped
when using ConfirmDeviceCredentials.

Bug: 26677759
Change-Id: I4b16f7dc2f415d0ce0215a3b7a646f98fabece33
2016-02-12 13:50:43 +00:00
Jorim Jaggi
e26334ba1a Merge "Handle light status bar for split-screen" into nyc-dev 2016-02-12 03:12:18 +00:00
Yohei Yukawa
612cce92ad Introduce InputConnection#getHandler().
Currently there is an internal hidden class named
ControlledInputConnectionWrapper which works as a proxy in the
application process to receive incoming binder calls from input method
and dispatch those method calls again on an appropriate thread.
Although this is a kind of implementation details, basically you can see
the same design everywhere in the Android.

Currently ControlledInputConnectionWrapper is initialized with
view.getHandler(), where the view here is the View which was used to
call View#onCreateInputConnection().  This is actually a reasonable
behavior because we have generally assumed that there the only
reasonable way to implement InputConnection is to extend
BaseInputConnection, which is designed to be able to work only on the
UI-thread associated with the target view.

However, on Android N and onward, we are going to ensure that
BaseInputConnection can be re-implemented on top of public APIs [1].
Although most of applications should not try to do that, for certain
applications such as web browsers and WebView it may make sense to let
custom InputConnection implementation run with a custom Handler so that
the application can respond to the IME without blocking the UI thread.

To do that, this CL introduces a new method
InputConnection#getHandler(), which changes nothing as long as it
returns null, but if it returns non-null Handler, InputMethodManager
will use it to initialize ControlledInputConnectionWrapper.

Note that InputConnection#getHandler() is not for IME developers.
It just returns null when called in the IME process.

 [1] See Bug 24688781 for details.

Bug: 26945674
Change-Id: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
2016-02-11 17:47:33 -08:00
Winson Chung
34f5c494df Merge changes If90955f4,I9fa48c06,Ib4681a43 into nyc-dev
* changes:
  Adding view debug annotations to simplifying debugging state.
  Disallow launching third party apps in safe mode.
  Drawing thumbnail background color for empty space in view.
2016-02-12 00:29:43 +00:00
Adam Powell
565943fda5 ChooserActivity direct share jank fixes
Don't show the ChooserTargetService targets until we have all
responses in, or we hit our timeout. This helps prevent targets from
jumping around under the user's finger. We still give bonuses to
services that respond faster.

Bug 26790940

Change-Id: I8a19e19e08eeb502ccc4b4feaa1710ca3315e9f6
2016-02-11 16:18:29 -08:00
Jorim Jaggi
8690558241 Handle light status bar for split-screen
In split-screen the light status bar flag for one side of the
status bar can be different from the other side.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR is now reported for both
the fullscreen stack and docked stack, but not anymore in the
"default" SysUI visibility field when reporting a visibility
change to SystemUI. The change also reports the docked stack
and the fullscreen stack bounds, so SystemUI can guard tinting
the icons on whether the icon is one of the areas.

When calculating the light status bar flag in PWM, we keep track
of the top fullscreen opaque window state for the docked and
fullscreen stack separately.

Bug: 24365214
Change-Id: Id2240a86d75bf96e0138ec7652a4793859f56e3c
2016-02-11 12:18:40 -08:00
Winson Chung
1af8eda6ea Drawing thumbnail background color for empty space in view.
Change-Id: I2e8dfbe9c11a61876956658eff0674adb26d855d

Signed-off-by: Winson <winsonc@google.com>
2016-02-11 11:48:33 -08:00
Andreas Gampe
e610e288cd Merge "Frameworks/base: Fix LineBreakBufferedWriter" into nyc-dev 2016-02-11 16:26:19 +00:00
Yohei Yukawa
622b44d00f Use Java7 diamond operator in InputMethodUtils.
This CL changes nothing except for deleting redundant type parameters by
using diamond operator.

No behavior change is intended.

Bug: 26279466
Change-Id: I276c7eb0136d373464ba6e997685d440beaca674
2016-02-11 08:26:13 -08:00
Mihai Nita
c67b64fda4 Flag all the locales of the default region as suggested
This was done by the SetupWizard to suggest the default locale
before the SIM was detected.
It is also handy for devices without SIM (tablets).

Bug: 26784450
Bug: 26882058
Bug: 26939651
Change-Id: Ia1d3b2ef4756121cf6ca13d5d7280215df060a8f
2016-02-11 00:34:45 +00:00
Andreas Gampe
f72cc9437b Frameworks/base: Fix LineBreakBufferedWriter
In case of writing single character, check against the buffer length,
not the maximum buffer size.

Bug: 27099774
Change-Id: I83d49ea74cc3d25342ec540b654d3dc68e4e802e
2016-02-10 15:18:24 -08:00
Jeff Sharkey
8212ae0aee Consistent naming for internal storage APIs.
Also completely remove a few confusingly named deprecated APIs.

Change-Id: Ia7e4ea3190a97f0a7dfa9bebf2118da0866ec38f
2016-02-10 15:03:33 -07:00
Jorim Jaggi
65bff3e4e9 Fix Keyboard overlap with navigation bar
FLAG_FULLSCREEN is really the wrong flag for determining whether
to subtract the window insets in the decore view and layout
it with a reduced size - FLAG_LAYOUT_IN_SCREEN suits these needs
much better.

Bug: 26014496
Bug: 26984057
Change-Id: I5c7a0fb7468d3981b91b23aa4c8b1e4841202131
2016-02-10 00:42:18 +00:00
Jorim Jaggi
81ba11eccb Put dismiss end target at navigation bar
This makes the animation when exiting docked mode a bit nicer
when you fling the divider towards to the navigation bar. However,
since the divider ends at the navigation bar, we need to immediately
dismiss it instead of fading out when the divider is fully occluded
by the navigation bar.

Change-Id: Ic5432fd118cb71be36485667b2c537caf5065ce5
2016-02-08 16:54:55 -08:00
Jorim Jaggi
0a13bfdefc Fix disappearing translucent status bar background
When relaunching an activity while preserving the window, the content
view was put on top of the status bar background, making it disappear
in case of translucent status bar backgrounds.

Change-Id: I1edff29c10616bf5386e982d7336327135f0f7a0
2016-02-08 21:18:37 +00:00
Ritesh Reddy
c170204541 Merge "UsageStatsBackup Bug Fix" 2016-02-06 19:42:14 +00:00
Tamas Berghammer
25222f55f2 Merge "Add flag to "am start" to enable native debugging" 2016-02-06 13:18:58 +00:00
Adam Lesinski
2068bb8bb0 Merge "Track BLE scans in BatteryStats" 2016-02-06 00:52:38 +00:00
Jeff Sharkey
37355a9f5d Tweaks to file:// Uri StrictMode checks.
Whitelist two more legacy intent actions, and don't enforce the
StrictMode checks when resolving intents that might be coming from
legacy apps.  Newer apps would have already been yelled at directly
before getting to the resolver.

Bug: 26976516, 26977622
Change-Id: Ibf72a361ed68c52cfaac16c32ab40e79005a42e7
2016-02-05 16:19:13 -07:00