49855 Commits

Author SHA1 Message Date
Jorim Jaggi
1edadac465 Merge "Handle case when snapshot dimensions don't match" into oc-dev 2017-04-04 09:14:38 +00:00
Casey Burkhardt
3bf7c7634a Merge "Fix AccessibilityManager returning duplicate services" into oc-dev 2017-04-04 04:29:27 +00:00
TreeHugger Robot
a52fc49845 Merge "Themes: Apply themes to system_server safely" into oc-dev 2017-04-04 03:25:29 +00:00
Bryce Lee
9f467df804 Merge "Clean up activity/stack associations." into oc-dev 2017-04-04 03:01:50 +00:00
TreeHugger Robot
4d52ae9707 Merge "Audio focus: API for external audio focus policy" into oc-dev 2017-04-04 02:40:02 +00:00
Andrii Kulian
d6f0b0fc4f Merge "Update display contents when metrics change" into oc-dev 2017-04-04 01:38:25 +00:00
TreeHugger Robot
19627d678b Merge "Emit fingerprints during OTA upgrades." into oc-dev 2017-04-04 01:33:28 +00:00
Hugo Benichi
df9cf5450c Merge "Move back networking policy logic into NetworkPolicyManagerService" into oc-dev 2017-04-04 00:50:24 +00:00
TreeHugger Robot
5efad86b91 Merge "Fixed NPE when FillService replies with a null FillResponse." into oc-dev 2017-04-04 00:39:56 +00:00
TreeHugger Robot
afb6b504b2 Merge "Fixing issue with activity incorrectly auto-entering PiP." into oc-dev 2017-04-04 00:39:09 +00:00
TreeHugger Robot
82331f7f73 Merge "Not send switch intents if there is no real intent" into oc-dev 2017-04-03 23:44:45 +00:00
Bryce Lee
af691c0be7 Clean up activity/stack associations.
The stack currently holds a reference to resuming and pausing
activities. These are usually cleaned up when the activity ends or
the task is reparented. However, it is possible for an activity to
lose its reference to its task in other areas (such as
ActivityStarter), which can lead to the stack not being updated
correctly.

This changelist adds a method to the ActivityStack to disassociate
the stack from an ActivityRecord. In addition to places where this is
called when an activity ends, this method is invoked on the children
of a task when the task is reparented. The task member variable of
ActivityRecord is also now surrounded by a setter/getter, with the
setter always invoking the dissociation logic on a previous stack.

Test: bit FrameworksServicesTests:com.android.server.am.ActivityRecordTests
Change-Id: Iffeccdb6f011958896271673946acfed28856f53
Fixes: 36387417
2017-04-03 16:33:36 -07:00
TreeHugger Robot
5fd39fad26 Merge "Don't wtf() for reverse profile access; make it a warning." into oc-dev 2017-04-03 23:32:00 +00:00
Jeff Sharkey
0751546c16 Emit fingerprints during OTA upgrades.
Can be used to help confirm diagnosis of bugs like 34525014.

Test: builds, boots
Bug: 36795529
Change-Id: Ie2517061ef031716c493b2544b0fb95628f20737
2017-04-03 17:28:19 -06:00
TreeHugger Robot
78e8ac9c14 Merge "Framework support to improve bg check CTS tests." into oc-dev 2017-04-03 22:26:01 +00:00
TreeHugger Robot
6a7a967b71 Merge "Remove/fix broken test due to change to DUMP permission check." into oc-dev 2017-04-03 22:13:34 +00:00
Winson Chung
19c85406cc Fixing issue with activity incorrectly auto-entering PiP.
- When the PiP menu activity was brought forward, we were inadvertently
  setting the auto-enter supported flag for the PiP base activity as
  well, which would trigger auto-enter PiP once the activity is moved
  back to fullscreen and then subsequently finished.

Bug: 36352343
Bug: 36364010
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: Id1b800bf392d03b55562fb13374e33a5ff0ebda6
2017-04-03 15:07:59 -07:00
Felipe Leme
7c6e8e6c00 Fixed NPE when FillService replies with a null FillResponse.
This problem was not detected by CTS tests because the exception is
"harmless" (it's just ignored), but it can be verified at logcat:

W Binder  : Caught a RuntimeException from the binder stub implementation.
W Binder  : java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.IntentSender android.service.autofill.FillResponse.getAuthentication()' on a null object reference
W Binder  : 	at com.android.server.autofill.ViewState.maybeCallOnFillReady(ViewState.java:159)

Bug: 35707731
Test: CtsAutoFillServiceTestCases pass
Test: manual verification
Change-Id: I58330a7e91b2c186bf97897b7d39640010ca630b
2017-04-03 15:03:17 -07:00
Jean-Michel Trivi
126cf03f7c Audio focus: API for external audio focus policy
System API for an external audio focus policy. Extends
 the system focus listener with interception of
 focus requests and abandons. Adds method for the focus
 policy to dispatch focus grants and losses.

Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t 'com.google.android.gts.audio.AudioHostTest#testFocusPolicy'
Bug: 30258418
Change-Id: If408569a2dce07a774e0e2f1be9f1af8e426d2d3
2017-04-03 14:44:47 -07:00
Makoto Onuki
3cc7cd1c18 Don't wtf() for reverse profile access; make it a warning.
Bug:36003688
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Change-Id: I6d6a73e1d9281dc0b92186dd0666865b0f6b3f1c
2017-04-03 14:04:11 -07:00
TreeHugger Robot
dcc792a13f Merge "Persistent connection to DO/PO service." into oc-dev 2017-04-03 20:35:18 +00:00
Makoto Onuki
c4361e34ad Remove/fix broken test due to change to DUMP permission check.
Bug 36854321
Test: adb shell am instrument -e class 'com.android.server.pm.ShortcutManagerTest2' -w com.android.frameworks.servicestests

Change-Id: I80f2a326b70f8d0598246732510e3725a0c58871
2017-04-03 13:00:39 -07:00
Makoto Onuki
ef7dff2563 Merge "Revert "Push chooser targets to the shortcut manager."" into oc-dev 2017-04-03 19:45:18 +00:00
Andrii Kulian
cd09799339 Update display contents when metrics change
There are two separate overrides for display metrics in DisplayManager
and WindowManager:
- In DM - LogicalDisplay#mOverrideDisplayInfo, in most cases not null.
- In WM - DisplayContent#mBaseDisplayWidth/Height/Density, different
from #mInitialDisplayWidth/Height/Density values when some metrics are
forced.

When display was resized its windows weren't updated because of
two problems: old LogicaDisplay#mOverrideDisplayInfo was preventing
WM from detecting the change and override (base) display metrics were
never updated by resize.

When display size changes:
- Before this CL:
DM receives DISPLAY_CHANGED event, it updates internal values and
WM is notified about them with a message. In most cases there is an
override obtained from WM and WM doesn't get new values from
LogicalDisplay#getDisplayInfoLocked().

- With this CL:
WM will requests real updated values from DM without any overrides
and will decide whether to apply them or not: if there is no override
in WM - it will apply values from WM, otherwise it will keep the
override. Also it will always update initial display metrics if there
is a real change detected.

Bug: 35258051
Bug: 34164473
Bug: 36518752
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testDisplayResize
Test: #testForceDisplayMetrics
Change-Id: I2495c27797f11f9aaee4ea06648a8ccd29ac5b62
2017-04-03 19:45:14 +00:00
Jason Monk
be436bdefe Merge "Add test API for if the device supports QS" into oc-dev 2017-04-03 19:11:44 +00:00
Winson Chung
34ecbaa991 Merge "Ensuring multi-window callbacks contain new configuration and are in order" into oc-dev 2017-04-03 18:23:31 +00:00
Winson Chung
244e4854c3 Merge "Fixing regression in PiP TV." into oc-dev 2017-04-03 18:22:41 +00:00
Chad Brubaker
e35d50622c Merge "Rename READ_PHONE_NUMBER to READ_PHONE_NUMBERS" into oc-dev 2017-04-03 17:34:13 +00:00
Andrii Kulian
2c93764bee Merge "Fix some WM unit tests" into oc-dev 2017-04-03 17:34:01 +00: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
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
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
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
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
TreeHugger Robot
2f8f5ffc4b Merge "Handle disabled packages as removed." into oc-dev 2017-04-01 03:16:38 +00:00
TreeHugger Robot
b9dedd43cf Merge changes from topic 'fix_activity_changed_cb-oc-dev_style_things' into oc-dev
* changes:
  Switch ActivityRecord to use static imports.
  Fix configuration change state transitions.
2017-04-01 02:52:11 +00:00
Andrii Kulian
a95bfff746 Fix some WM unit tests
WindowFrameTests#testLayoutNonfullscreenTask and
sizes because test assumed that frame for window was always
bigger than screen size. Now we calculate all frames relative
to real display size.

TestWindowManagerPolicy used in WM unit tests reported incorrect
value from rotationHasCompatibleMetricsLw(), which lead to
DisplayContent#mAltOrientation set to "true" after any rotation
and resulted in shrinked display metrics.

DisplayContentTests#testDefaultDisplayOverrideConfigUpdate was
not restoring the config applied to default display because
it was trying update values in config from non-empty to empty,
which is considered a no-diff.

Test: com.android.server.wm.WindowFrameTests
Test: #testCalculatePolicyCrop
Test: #testLayoutNonfullscreenTask
Test: com.android.server.wm.AppWindowTokenTests
Test: #testLandscapeSeascapeRotationByApp
Test: com.android.server.wm.DisplayContentTests
Test: #testDefaultDisplayOverrideConfigUpdate
Change-Id: Ia0ed46307f67f6b47859209ebcf13253b59b8002
2017-03-31 19:00:57 -07:00