50202 Commits

Author SHA1 Message Date
Andrii Kulian
2c93764bee Merge "Fix some WM unit tests" into oc-dev 2017-04-03 17:34:01 +00:00
Jeff Sharkey
f00900d7d4 Merge "Lower-level user enumeration; fix disabled bug." into oc-dev
am: 713b7c6b53

Change-Id: Ic2edcfc0d30bc5429753c313d31703802e630851
2017-04-03 17:29:45 +00:00
Jeff Sharkey
f9f7d71cc5 Merge "We really want f_frsize and f_bavail." into oc-dev
am: fd463121c6

Change-Id: I55aebb3b452f4d41af7e5f54d0dff27e9bc6cca6
2017-04-03 17:27:48 +00:00
Narayan Kamath
492e9e851c Properly guard access to CloseGuard in finalizers.
CloseGuard instances are allocated in constructors and usually
assigned to final fields. This implies they're non-null in finalizers
except in the case where the constructor throws. We add a null check
to make sure we can continue cleaning up other state in the finalizer
(if applicable).

Also, this change decouples closeguard warnings in constructors
from other state based logic. This because the logic there is usually
duplicated with the call to close().

NOTE: This change is not a "complete" fix. Many of these finalizers
are broken in the case where <init> throws. The only objective of
this change is to make such errors more obvious.

Note that some of these classes don't have CTS tests.

Test: make, CtsMediaTestCases.
Bug: 35609098

Change-Id: I24d9e0215f80e44914dba8ab99b6312fd6ed1fc0
2017-04-03 18:12:04 +01:00
TreeHugger Robot
a906fb7b43 Merge "Fix deleting Misc channel for o-aps" into oc-dev 2017-04-03 16:53:54 +00:00
TreeHugger Robot
644648ebfd Merge "Expose instant app to exposed providers" into oc-dev 2017-04-03 16:43:08 +00:00
Winson Chung
d62acec309 Fixing regression in PiP TV.
- Don't clobber the state if we are deferring resizing due to finishing
  activities.
- Fix issue with PiP tasks being visible after the stack is removed, due
  to it being put below a non-fullscreen task in the fullscreen stack.
  Instead just move it to the back of the stack.

Bug: 36592307
Test: android.server.cts.ActivityManagerPinnedStackTests

Change-Id: Ia18fe155b8a045a8ffea84612fd08af3ef3982d8
2017-04-03 09:30:42 -07:00
Philip P. Moltmann
ebc8ee266c Not send switch intents if there is no real intent
When resolving activtities for the USB device/accessory connection UI a
special intent that allows to switch between profiles get added. This
also gets added if there is no activity in the secondary profile that
can be started.

Fixes: 36544815
Test: Added work profile. Add USB handling app only to personal profile
      and plugged in USB device -> no crash anymore

Change-Id: I311ddd53b3ff0c8406e62bac57972d4b790ebddc
2017-04-03 09:06:09 -07:00
TreeHugger Robot
35110948b7 Merge "Implement service filtering" into oc-dev 2017-04-03 14:45:57 +00:00
Bryce Lee
7efe56b779 Merge "Add app bounds to configuration." into oc-dev 2017-04-03 14:30:49 +00:00
Geoffrey Pitsch
326eb2ee80 Fix deleting Misc channel for o-aps
Change-Id: If5ebebcd1b983e12dee860801db578dfe882bd9c
Fixes: 36816111
Test: runtest systemui-notification
2017-04-03 10:19:11 -04:00
Chris Wren
ef3a28cb92 Merge "standardize network policy notification IDs" into oc-dev 2017-04-03 13:42:44 +00:00
Jorim Jaggi
aea6b74e17 Handle case when snapshot dimensions don't match
If the snapshot starting window has different dimensions than the
snapshots we have taken, we do the following:

- Create a child Surface that has exactly the dimensions of the
snapshot.
- We fill the parent surface with the app background color, as well
as all screen background decorations (status bar background,
navigation bar background).
- We also clip of the status bar/navigation bar background in some
cases, as it looks ugly if it's not behind the system bars.
- Furthermore, we inherit all layout flags on the window and all
layout relevant SystemUI flags on the window such that it's very
likely that the size will match, and the system bars are drawn
correctly.
- In order to make the transition from the snapshot to the real
window a bit more predictable/less messy, we enforce a minimum
duration the snapshot is visible, which is slightly more than our
app transitions.

Test: TaskSnapshotSurfaceTest
Test: Open app, go home, go landscape, open app again
Test: Go to multi-window, open app from recents with a snapshot
taken in fullscreen.

Fixes: 36703868
Change-Id: Ia2d4add6971a18ab7aa2942d2b644d6e87a402af
2017-04-03 15:36:29 +02:00
Jorim Jaggi
d6d6de6da4 Schedule window animations at vsync-sf
Test: Run window animation, make sure it's smooth
Test: Take systrace, make sure it runs at vsync-tick
Test: Move divider, make sure it's still smooth

Change-Id: I1600618e074be811134fe4ccb1dfbd5034820c71
Fixes: 36583867
2017-04-03 15:27:16 +02:00
Jorim Jaggi
91232840aa Revert "Temporarily bg-whitelist the default container package-cleaning service"
Causes bootloop.

This reverts commit f16e7423c79c4ccccf43265a5b1966eb8e7f7be7.
2017-04-03 14:40:39 +02:00
Hugo Benichi
3d8cf2254e Merge "ConnectivityService: simplify WakeLock management" am: c98db5caa2 am: 6db00a22b0 am: 56ca1705d6
am: e92a4ba79b

Change-Id: Id8ae92f0eec4284ff5ba59a4a8c2227e9a77765a
2017-04-03 09:24:14 +00:00
Hugo Benichi
e92a4ba79b Merge "ConnectivityService: simplify WakeLock management" am: c98db5caa2 am: 6db00a22b0
am: 56ca1705d6

Change-Id: Iacc2e977c1eec2ebc9deb9395e1f77a62b57f070
2017-04-03 09:17:18 +00:00
Hugo Benichi
56ca1705d6 Merge "ConnectivityService: simplify WakeLock management" am: c98db5caa2
am: 6db00a22b0

Change-Id: I468e31800d5cfe1dd385d773fcc393b615cfa343
2017-04-03 09:10:44 +00:00
Hugo Benichi
6db00a22b0 Merge "ConnectivityService: simplify WakeLock management"
am: c98db5caa2

Change-Id: I1e0ae930cd7a329febf21ff3fc83ad2d0a3be69b
2017-04-03 09:03:13 +00:00
Hugo Benichi
c98db5caa2 Merge "ConnectivityService: simplify WakeLock management" 2017-04-03 08:56:24 +00:00
TreeHugger Robot
713b7c6b53 Merge "Lower-level user enumeration; fix disabled bug." into oc-dev 2017-04-03 08:36:09 +00:00
TreeHugger Robot
fd463121c6 Merge "We really want f_frsize and f_bavail." into oc-dev 2017-04-03 07:37:49 +00:00
Jeff Sharkey
60bca4e4bf Enforce PACKAGE_USAGE_STATS for usage data. am: 6df866a851
am: 979f227fb9

Change-Id: Ia3aaf773b4defb4b1399544ff7475cd4142f16aa
2017-04-03 06:27:05 +00:00
Jeff Sharkey
558b0dd418 Consistent dump() permission checking. am: fe9a53bc45
am: 020de02854

Change-Id: Iffbf78a7b48cea41ed4b0763f2452738e084225c
2017-04-03 06:26:04 +00:00
Jeff Sharkey
979f227fb9 Enforce PACKAGE_USAGE_STATS for usage data.
am: 6df866a851

Change-Id: I52d982ee864903ca93e889aa03f6315438dc6c4b
2017-04-03 06:19:57 +00:00
Jeff Sharkey
020de02854 Consistent dump() permission checking.
am: fe9a53bc45

Change-Id: I300f8bc07e1266b9e78f56d085cd458862176a85
2017-04-03 06:19:02 +00:00
Daichi Hirono
b8aeb6f12e Stop restoring tasks added before recent is loaded
Previously we can have duplicated tasks sharing the same taskId in
RecentTasks due to race condition.

1. A task is created before RecentTasks#loadUserRecentsLocked
   (e.g. through adb)
2. RecentTasks#notifyTaskPersisterLocked eventually writes the task file
   to storage (e.g. XX_task.xml)
3. RecentTasks#loadUserRecentsLocked tries to recover XX_task.xml while
   the task has already been added to RecentTasks.

To fix the issue, the CL stops restoring tasks added before recent is
loaded.

Bug: 36796576
Test: Build and boot Android, check the recent is correctly loaded
Change-Id: Ib57977f2a0a63f7bf7db4d3fd70bdcc359e76f7d
2017-04-03 14:43:45 +09:00
Jeff Sharkey
8231146d4e Lower-level user enumeration; fix disabled bug.
UserManager may not have been started yet, so discover users by
looking at filesystem.

Fix disabled bug where default should be "false."

Test: builds, boots
Bug: 36794413
Change-Id: If91fd27b955175072228a93aab4b8ac3b27df0bf
2017-04-02 23:42:29 -06:00
Jeff Sharkey
dafb17e7eb We really want f_frsize and f_bavail.
It's confusing, but f_bsize is not the value you're looking for; the
real block size is f_frsize.  Fix all those bugs.

Also, the vast majority of clients are interested in the usable
disk space, not including reserved space.

Test: builds, boots
Bug: 36840579
Change-Id: Ib1470389afd49c14cab62282ec1e978ebb2c4791
2017-04-02 23:33:38 -06:00
Jeff Sharkey
6df866a851 Enforce PACKAGE_USAGE_STATS for usage data.
Some system services are offering package usage data through both
public/system APIs and through dump() calls.  In principle, usage
data hould always be protected with PACKAGE_USAGE_STATS, so start
enforcing that.  (Otherwise if a user blocked PACKAGE_USAGE_STATS
access to an app, that app could still obtain the data via dump()
if they held the DUMP permission.)

Bottom line, let's respect the user's wishes.

Protecting the entire output like this is pretty blunt, but future
CLs can add more nuance to the output if desired.

Test: cts-tradefed run commandAndExit cts-dev -m CtsSecurityTestCases -t android.security.cts.ServicePermissionsTest
Bug: 32806790
Change-Id: I46173562713bea7d89e12a4313c78eb52ea8d77d
2017-04-02 22:29:07 -06:00
Jeff Sharkey
fe9a53bc45 Consistent dump() permission checking.
This change introduces new methods on DumpUtils that can check if the
caller has DUMP and/or PACKAGE_USAGE_STATS access.  It then moves all
existing dump() methods to use these checks so that we emit
consistent error messages.

Test: cts-tradefed run commandAndExit cts-dev -m CtsSecurityTestCases -t android.security.cts.ServicePermissionsTest
Bug: 32806790
Change-Id: Iaff6b9506818ee082b1e169c89ebe1001b3bfeca
2017-04-02 22:29:07 -06:00
Hugo Benichi
be5f0f197a Merge "ConnectivityService: log wakelock activity in dumps" am: db104b2367 am: 146914c0d5 am: bf1b181c63
am: 7346613f27

Change-Id: Id95860ab5d874f24f9fa510a44038ce05bed12f0
2017-04-03 00:07:16 +00:00
Hugo Benichi
7346613f27 Merge "ConnectivityService: log wakelock activity in dumps" am: db104b2367 am: 146914c0d5
am: bf1b181c63

Change-Id: Id4c980a2a1ef7f51b6a06c7c8636160437e99b84
2017-04-03 00:00:19 +00:00
Hugo Benichi
4c31b34d16 ConnectivityService: simplify WakeLock management
This patch simplifies wakelock management by acknowledging that only one
acquisition at most is in flight at any time. This allows to remove the
serial number associated with wakelock acquisition and to avoid double
release when regaining a default network.

Example of $ adb shell dumpsys connectivity logs:
  NetTransition WakeLock activity (most recent first):
    03-31 00:15:13.816 - RELEASE (EVENT_CLEAR_NET_TRANSITION_WAKELOCK)
    03-31 00:14:59.216 - ACQUIRE for NetworkAgentInfo [WIFI () - 101]
    03-31 00:09:05.799 - RELEASE (EVENT_EXPIRE_NET_TRANSITION_WAKELOCK)
    03-31 00:08:05.738 - ACQUIRE for NetworkAgentInfo [WIFI () - 100]

Test: watched wakelock section $ adb shell dumpsys connectivity while
      turning on and off Wifi (with no other network).
Bug: 36703718
Change-Id: I899b0816c0e41b3991d9540e9b9a604914ff673a
2017-04-03 08:54:54 +09:00
Hugo Benichi
bf1b181c63 Merge "ConnectivityService: log wakelock activity in dumps" am: db104b2367
am: 146914c0d5

Change-Id: I4d0430a6a5b3a1f97cdc4cf9590e5b0a798ae04f
2017-04-02 23:53:46 +00:00
Hugo Benichi
146914c0d5 Merge "ConnectivityService: log wakelock activity in dumps"
am: db104b2367

Change-Id: If08e0088ab25f1494aaf3a339a38e7a8e343d910
2017-04-02 23:47:15 +00:00
Hugo Benichi
db104b2367 Merge "ConnectivityService: log wakelock activity in dumps" 2017-04-02 23:40:27 +00:00
nharold
8fc401ac80 Merge changes from topic 'ipsec-transport-impl' am: 464dc5c07e am: f983d89083 am: 8108bef16d
am: fcfc121549

Change-Id: I4fdc0e7f211f637b00ec9ecd438a7a528aec001f
2017-04-02 00:44:13 +00:00
nharold
fcfc121549 Merge changes from topic 'ipsec-transport-impl' am: 464dc5c07e am: f983d89083
am: 8108bef16d

Change-Id: Ie820478fc01f42b5143a63a3422380ce7ec74847
2017-04-02 00:35:08 +00:00
nharold
8108bef16d Merge changes from topic 'ipsec-transport-impl' am: 464dc5c07e
am: f983d89083

Change-Id: Ifbee28deb7bee43532b923193cade15dad4ee5b9
2017-04-02 00:27:38 +00:00
nharold
f983d89083 Merge changes from topic 'ipsec-transport-impl'
am: 464dc5c07e

Change-Id: I6caf23f5fef995f1ad735ea64b99660a5180799f
2017-04-02 00:19:44 +00:00
nharold
464dc5c07e Merge changes from topic 'ipsec-transport-impl'
* changes:
  Add Initial IPsec APIs to IpSecService
  IpSecManager and IpSecTransform API Cleanup
2017-04-02 00:10:35 +00:00
Chris Wren
e970a91765 Merge "move network notification IDs to central registry" into oc-dev am: fb54aee325
am: af2a16bfb0

Change-Id: I3400b06758615aa82e2a87cd4140b91aa9ec853b
2017-04-01 16:28:53 +00:00
Chris Wren
af2a16bfb0 Merge "move network notification IDs to central registry" into oc-dev
am: fb54aee325

Change-Id: I0abcea4b9fe43e5c08885413e0f9a419b87b7206
2017-04-01 16:23:25 +00:00
Chris Wren
fb54aee325 Merge "move network notification IDs to central registry" into oc-dev 2017-04-01 16:15:34 +00:00
Bryce Lee
7566d76c61 Add app bounds to configuration.
The system previously overrode the display size for a specific scope
(task/activity/etc.) by setting the associated Configuration's
screenWidthDp/screenHeightDp. This leads to two issues. First, the
conversion of screen size from pixels to display independent pixels
and then upconverting later on leads to rounding errors. Secondly,
the screenWidthDp and screenHeightDp values account for insets, such
as the status bar. These however are not reflected in the display
size when returned from Display#getMetrics/getSize.

This changelist addresses the issue by adding a Rect value to
Configuration which stores the app display bounds. This is always set
at the display level and overridden as appropriate. As the proper
app insets are accounted for at the root configuration, all overrides
(outside of specific exceptions) are the result of the intersection
between the requested bound and the parent bound.

Change-Id: I2c4fcd0bee92af12aabbca258de05b4ec061d0e1
Fixes: 34338931
Bug: 36812336
Bug: 36676979
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
2017-03-31 21:34:30 -07:00
Makoto Onuki
224f95a32d Merge "Handle disabled packages as removed." into oc-dev am: 2f8f5ffc4b
am: 202c0418b1

Change-Id: I9c0ba823fa4007ab75d7ff2d5b860e716b2f36a0
2017-04-01 03:28:08 +00:00
Makoto Onuki
202c0418b1 Merge "Handle disabled packages as removed." into oc-dev
am: 2f8f5ffc4b

Change-Id: I75f0e5fd02261d522acb79acc50fc56ef7319eb3
2017-04-01 03:22:38 +00:00
TreeHugger Robot
2f8f5ffc4b Merge "Handle disabled packages as removed." into oc-dev 2017-04-01 03:16:38 +00:00
Ruben Brunk
553ae6e7b1 Merge changes from topic 'fix_activity_changed_cb-oc-dev_style_things' into oc-dev am: b9dedd43cf
am: 594afb40af

Change-Id: Ia10677c71af6fb8e76f34fecedac902351b3cbc5
2017-04-01 03:07:40 +00:00