32043 Commits

Author SHA1 Message Date
Chong Zhang
73d6dab44f Merge "Show toast for non-resizeble docked task under the task itself" 2015-12-01 18:41:48 +00:00
Chong Zhang
c806d90e65 Show toast for non-resizeble docked task under the task itself
Move the show toast code to WM, so that we can schedule to show the
toast when the app becomes visible. Otherwise the toast always shows
up a long time before the app itself.

bug: 25433902
bug: 25873338

Change-Id: I879f8e0570829934fac806c2861bda9f65e08969
2015-12-01 10:23:43 -08:00
Insun Kang
30be970a8e MediaSession: Improve MediaSessionStack logic
There was an issue that media button events (play / pause) didn’t go
to the expected media session. If an app creates a media session during
all media sessions are paused, the next coming media play event is
consumed by the newly created media session. It makes sense in general,
but if the media session is created in a background process without any
visible UI, it causes unexpected results.

This patch resolves the issue by checking if a newly added session comes
from the most recent user-facing app.

Bug: 24990104
Change-Id: Ic9632bced37bffd28260afe3523d9a20ea4d3c21
2015-12-01 04:39:11 +00:00
Jorim Jaggi
c4d81e530f Merge "Don't animate when moving task to stack if not requested" 2015-12-01 01:17:19 +00: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
Filip Gruszczynski
9a3f84ced7 Merge "Remove dock divider surface when it's not visible." 2015-11-30 23:37:02 +00:00
Filip Gruszczynski
64cdc1458b Remove dock divider surface when it's not visible.
We achieve the removal by notifying System UI about the visibility of
the dock divider. This way System UI can change visibility of the root
view, which in turn will cause the WMS to destroy or create the surface
as necessary.

Bug: 25844096
Bug: 25683717

Change-Id: Idbc33368db697a059af49106dfadb80c3d7d06c1
2015-11-30 15:21:48 -08:00
Phil Weaver
14ed6cf3e7 Ignore feedbackType in AccessibilityEvent dispatch
Send AccessibilityEvents to all accessibility services
that request them. No longer refuse to send them to
services with the same feedback type.

Change-Id: I137905c24fc75c075ab938175ecb6ea5f39112cf
2015-11-30 14:36:34 -08:00
Chong Zhang
fc19f14ecc Merge "Show all windows with FLAG_SHOW_WHEN_LOCKED over lock screen if" 2015-11-30 19:03:47 +00:00
Filip Gruszczynski
1223c198e4 Merge "Remove unnecessary field from AppWindowToken." 2015-11-30 18:38:44 +00:00
Erik Wolsheimer
98fe08fec1 fix data race condition BUG: 25819358 am: 2242b4d2bd am: 1dbb0355dc am: 1d92c4538f
am: 48543000e0

* commit '48543000e0417213b227b1047a83eb7d8528ff35':
  fix data race condition BUG: 25819358
2015-11-30 17:43:39 +00:00
Erik Wolsheimer
48543000e0 fix data race condition BUG: 25819358 am: 2242b4d2bd am: 1dbb0355dc
am: 1d92c4538f

* commit '1d92c4538f8ed43a2e9c1e6d4694ddb3fb058741':
  fix data race condition BUG: 25819358
2015-11-30 17:35:20 +00:00
Erik Wolsheimer
1d92c4538f fix data race condition BUG: 25819358 am: 2242b4d2bd
am: 1dbb0355dc

* commit '1dbb0355dc89a9f878365ee793ec48f6cb0b1426':
  fix data race condition BUG: 25819358
2015-11-30 17:28:44 +00:00
Erik Wolsheimer
1dbb0355dc fix data race condition BUG: 25819358
am: 2242b4d2bd

* commit '2242b4d2bda7f83cf7813103ff95d9b4e244126f':
  fix data race condition BUG: 25819358
2015-11-30 17:22:56 +00:00
Alan Treadway
28860b7570 Fix for being able to setup Managed User from system user.
Also move feature flag check to ensure it is used in all cases.

Change-Id: If42787c5bc9ab824449c70f90fb827cf2da7507f
2015-11-30 16:48:26 +00:00
Lorenzo Colitti
55233b9f2e Merge "Fix one of the breakages of ConnectivityServiceTest in master." 2015-11-27 03:04:31 +00:00
Lorenzo Colitti
2c1a253f22 Fix one of the breakages of ConnectivityServiceTest in master.
Change-Id: I31c7a019383fa589beb1572486700e54edfb97e8
2015-11-27 11:46:18 +09:00
Erik Kline
764e7960cd Merge "Stop using startUsingNetworkFeature" 2015-11-26 08:57:18 +00:00
Yohei Yukawa
1f3257d766 Merge changes Iee47e374,Icc64942a
* changes:
  Use Context.getSystemService(Class<T>) for InputManager.
  Use Context.getSystemService(Class<T>) for InputMethodManager.
2015-11-26 08:16:33 +00:00
Yohei Yukawa
8ce2a538d9 Use Context.getSystemService(Class<T>) for InputManager.
This is a mechanical replacement of Context.getSystemService(String)
with Context.getSystemService(Class<T>) when retrieving InputManager.
Note those are bundled code.  Hence we don't need to make sure
Build.VERSION.SDK_INT >= 23.

Change-Id: Iee47e374e1349720e3100bab33ed139e1f47c169
2015-11-26 00:02:11 -08:00
Yohei Yukawa
777ef95ebf Use Context.getSystemService(Class<T>) for InputMethodManager.
This is a mechanical replacement of Context.getSystemService(String)
with Context.getSystemService(Class<T>) when retrieving
InputMethodManager.  Note those are bundled code.  Hence we don't need
to make sure Build.VERSION.SDK_INT >= 23.

Change-Id: Icc64942ad8f11e44bf84f8d4fe476b2fdd1257f3
2015-11-26 00:02:05 -08:00
Erik Kline
0c9cb2ba76 Stop using startUsingNetworkFeature
Also:
    - add a few @Overrides where appropriate.
    - some small refactoring/reformatting

Bug: 9580643
Bug: 22332501
Bug: 25824776
Change-Id: Id4f496ced4db15cd9da51c80c5d1dde06f476f54
2015-11-26 16:53:32 +09:00
Filip Gruszczynski
a590c99256 Remove unnecessary field from AppWindowToken.
Change-Id: I0bc488dc67d5128a1f47f58f62038d178d8ef0cd
2015-11-25 16:46:02 -08:00
Philip P. Moltmann
7fc7f48a89 Merge "Syncronosuly notify SelectPrinterActivity about changes to enabled print services" 2015-11-26 00:36:55 +00:00
Philip P. Moltmann
03755a1f12 Syncronosuly notify SelectPrinterActivity about changes to enabled print
services

If the SelectPrinterActivity is visible it shows different emptyState
depending on if there are print services available or not. Hence the
activity has to listen to changes to the list of enabled services.

This also fixes a small syncronsation problem if two observers are
registered for the enabled print services.

Bug: 25666802
Change-Id: I79af66f25f10e66347b48ce9bb99c1657b30a8dd
2015-11-25 16:28:34 -08:00
Filip Gruszczynski
83b41adbca Merge "Revert "Destroy docked divider surface when it's hidden."" 2015-11-25 23:20:25 +00:00
Filip Gruszczynski
19723a4a2b Revert "Destroy docked divider surface when it's hidden."
This reverts commit cb5f57bc580d7f73b93c8f504daa4dcd74cdce72.

Change-Id: I1f77e1ccd5382ed57b8e4165afd79db5223f51c1
2015-11-25 15:13:46 -08:00
Makoto Onuki
d85eec87c2 Merge "Don't call DPM from UserManager to avoid lock inversion" 2015-11-25 21:51:19 +00:00
Yohei Yukawa
0466206a6a Merge "Tell the reason why IMM called startInput()." 2015-11-25 20:36:13 +00:00
Winson
387aac6ad7 Fixing task view heights in paging tasks
- Now, all task views will be bounded by the stack rect, and the 
  thumbnail bitmaps will be scaled accordingly to fit either by width
  (when stacked) or to the view rect (when freeform)
- Fixing issue where the history button was not offset in freeform
- Tweaking thumbnail sizes of fullscreen screenshots
- Still requires changes to fix clipping to the correct aspect ratio in
  freeform.

Change-Id: I678b87c2f06947d32f3bb7c60a35f28eb36b5a68
2015-11-25 19:45:51 +00:00
Makoto Onuki
e7927da1b6 Don't call DPM from UserManager to avoid lock inversion
- Also make sure DPMS.mOwners is always guarded with DPMS.this.
(and remove synchronization from Owners.)

Bug 25796840

Change-Id: I83f7b78e7b437d9c2a2b1d6e714346cd15f95330
2015-11-25 11:17:08 -08:00
Filip Gruszczynski
687789bebf Merge "Only create surface when showing window if it destroys it when hiding." 2015-11-25 19:09:21 +00:00
Filip Gruszczynski
3782797a2a Merge "Don't preserve the window on client side when pinning activity." 2015-11-25 19:09:06 +00:00
Yohei Yukawa
35d3f37bd5 Tell the reason why IMM called startInput().
As a preparation to fix Bug 25373872, this CL introduces an additional
int parameter into the following two methods
  - IInputMethodManager.startInput()
  - IInputMethodManager.windowGainedFocus()
so that IMMS can know why IMM needs to start input.  Currently the
"startInputReason" parameter is used only for debug message only when
the OS is rebuilt with flipping IMMS#DEBUG to true.  Basically this
should have no impact in production builds except for a tiny overhead
of having one int parameter in some internal IPC calls.

Note that since 7663d80f6b6fd6ca7a736c3802013a09c0abdeb9 [1] basically
IMMS#windowGainedFocus() has been a superset of IMMS#startInput().
Hence we should pass to "startInputReason" parameter to
IMMS#windowGainedFocus() as well as IMMS#startInput().

  [1]: Icb58bef75ef4bf9979f3e2ba88cea20db2e2c3fb

Bug: 25373872
Change-Id: Ia1fe120af7d71495c5f3a4fc0ec6390efb8240ca
2015-11-25 11:07:19 -08:00
Filip Gruszczynski
55149303d1 Only create surface when showing window if it destroys it when hiding.
The visibility of a window might be toggled to true even when it doesn't
have a surface, which is a case for windows under the lock screen. We
can't blindly create surfaces in that case, but only do it for the
windows that destroy their surfaces when they are hidden.

Bug: 25879215
Change-Id: I6cf2c6810ce02fba0d2207a56de9924c0270dfeb
2015-11-25 10:51:25 -08:00
Lorenzo Colitti
c415f72b66 Merge changes I456984a2,Id4d1031b
* changes:
  Switch the DHCP client to the new AlarmManager callback interface
  Refactor alarm setting code in preparation for switch to callback
2015-11-25 04:37:59 +00:00
Jorim Jaggi
55387528d6 Don't animate when moving task to stack if not requested
resumeTopActivitiesLocked played an activity transition because
the top activity of the stack changed. We don't want this in
case animate=false in moveToStackLocked, so add it to the
mNoAnimActivities array so it suppresses the animation.

Change-Id: Ife15ca529da916b6bc97e2b3bd1e3c3e3009373b
2015-11-24 18:21:10 -08:00
Jorim Jaggi
ba54881231 Merge "Allow stacks to be placed outside of display" 2015-11-25 01:49:50 +00:00
Chong Zhang
b15758ab7a Support scrolling for non-resizeable tasks in side-by-side mode
Display toast when a non-resizeable task is put into side-by-side mode.

Scroll the task upon a two-finger scroll gesture.

bug: 25433902

Change-Id: I69967056a564cfe7773afb80aa7e7ea7167a791a
2015-11-24 17:38:33 -08:00
Jorim Jaggi
2fbe033f9d Allow stacks to be placed outside of display
When dismissing the docked stack, we animate the divider to position
-12dp, so the full-screen stack is exactly full-screen when the dismiss
animation is done. Previously, this was prevented by window manager.
Allow it to fix the animation.

Change-Id: Iee4505023dc3f6907d56851965b156235f9f97f2
2015-11-24 17:37:03 -08:00
Filip Gruszczynski
786e12d92f Merge "Destroy docked divider surface when it's hidden." 2015-11-25 01:10:59 +00:00
Filip Gruszczynski
cb5f57bc58 Destroy docked divider surface when it's hidden.
Also includes bunch of small refactorings:
* destroying surfaces is now fully contained within
WindowManagerServices and mDestroySurface can be privatized;
* WMS.isDockedStackResizingLocked can be removed;
* mScreenCaptureDisabled changes from being SparseArray<Boolean> to
SparseBooleanArray, which not only avoids boxing but also makes code
simpler (no need to check for null)

Bug: 25844096
Change-Id: I0e5462760ffbc947ce6dc52ef429fa270ffc6786
2015-11-24 16:48:26 -08:00
Makoto Onuki
3ab6f2e219 DA receiver should be protected with BIND_DEVICE_ADMIN.
- DPM.setActiveAdmin() will not accept DAs without BIND_DEVICE_ADMIN
when it's targeting NYC or above.

- DAs without BIND_DEVICE_ADMIN targeting MNC or below will still be
accepted. (with a logcat warning)

- DAs that are already set on a device without BIND_DEVICE_ADMIN
will still be accepted regardless of the target API level, even when
it's upgraded to a version targeting NYC.

Bug 24168653

Change-Id: I1914c2ec99135d9dd8cbac3f6914f9e43bafacc8
2015-11-24 16:14:21 -08:00
Makoto Onuki
a31ebbc439 Add DO API to get wifi mac address
Bug 25496044

Change-Id: Ib1f0ce4ca10951edcfaa0aa79ae5c2d142a74599
2015-11-24 15:38:16 -08:00
Jorim Jaggi
b0cab35c18 Merge changes Ieb3c8c73,If494fddf,Ia9415fa6
* changes:
  Add ability to supply initial bounds when docking task
  Make sure to clear pending spec
  Clear spec future when clearing transition
2015-11-24 23:11:34 +00:00
Jorim Jaggi
9ea2f7ba31 Add ability to supply initial bounds when docking task
Add an optional parameter in moveTaskToDockedStack to supply an
initial rect to be used when creating the dockeds tack. Pass in
the adjusted rect when dragging up from the navbar so it doesn't
flicker anymore.

Change-Id: Ieb3c8c73b9e2a769a2ec6270bd76a713201a2aed
2015-11-24 15:08:49 -08:00
Makoto Onuki
05d0d44034 Merge "DPM.isDeviceOwnerApp() and getDeviceOwner() now check calling user" 2015-11-24 23:03:46 +00:00
Makoto Onuki
c8a5a555f1 DPM.isDeviceOwnerApp() and getDeviceOwner() now check calling user
- Previously on MNC, they would return the same result regardless who
the calling user is.

- Now they properly take DO user-id into account.  Meaning, they'll
always return false and null respectively, if the calling user doesn't
run device owner.

- Note isDeviceOwnerApp() is a public API and getDeviceOwner() is
a system API.  Meaning we're changing the behavior or non-private
APIs.

- Also cleaned up hidden APIs, and gave them explicit suffixes
to avoid confusion.  Bundled code should prefer them for clarity.

Now we have:

* APIs that work cross-users: They all require MANAGE_USERS.
boolean isDeviceOwnerAppOnAnyUser(String packageName)
ComponentName getDeviceOwnerComponentOnAnyUser()

int getDeviceOwnerUserId()
boolean isDeviceOwnedByDeviceOwner()

String getDeviceOwnerNameOnAnyUser()

* APIs that work within user.  No permissions are required.

boolean isDeviceOwnerAppOnCallingUser(String packageName)
ComponentName getDeviceOwnerComponentOnCallingUser()

Bug 24676413

Change-Id: I751a907c7aaf7b019335d67065d183236effaa80
2015-11-24 14:54:48 -08:00
Filip Gruszczynski
a21136c347 Don't preserve the window on client side when pinning activity.
We were both enabling window replacement in WMS and window preserving on
the client side. This doesn't work together, because window replacement
depends on the fact that the client won't preserve the window (it needs
to receive remove and add window operations).

Bug: 25854235
Change-Id: I0625df6fbe4c29bf14f364d764de3bf63dc90961
2015-11-24 14:43:31 -08:00