28576 Commits

Author SHA1 Message Date
Alan Viverette
51efddbd3b Remove unnecessary casts on calls to findViewById
Just frameworks/ this time. More paths to come.

Bug: 24137209
Test: make -j32
Change-Id: Iff27abd26fa43296ac2fff8f534fc6742d2ae80c
2017-04-14 11:15:50 -04:00
Bryce Lee
61bce9ab13 Merge "Remove window container from empty task when destroying." into oc-dev 2017-04-13 20:10:56 +00:00
Adam Lesinski
af85d84050 Merge "BatteryStats: Remove reading of cpu power" into oc-dev 2017-04-13 20:09:51 +00:00
TreeHugger Robot
29c70437b3 Merge "Add new facility to find out when a PendingIntent is canceled." into oc-dev 2017-04-13 20:01:32 +00:00
TreeHugger Robot
c4ca1b5677 Merge "Ensure removeForegroundService checks both lists under lock" into oc-dev 2017-04-13 19:50:00 +00:00
TreeHugger Robot
3891674204 Merge "Filter instant app content providers" into oc-dev 2017-04-13 19:43:31 +00:00
Chris Tate
117ac766a9 Merge "Introduce PACKAGE_FIRST_ADDED broadcast" into oc-dev 2017-04-13 19:24:13 +00:00
Dianne Hackborn
f66adfd1cd Add new facility to find out when a PendingIntent is canceled.
This is just an internal API in the platform, not (yet?) available
in the SDK.  But it will be useful for system services that want to
clean up state if a pending intent that has been registered with them
is canceled (either explicitly by the app, through the app being
uninstalled, etc).

Also improve the activity manager's dump of pending intents to
organize them by package, making it much easier to read (now that
we have so many active pending intents these days).

Test: ran and booted.  no CTS, since no API.

Change-Id: Iad029cfedcd77e87357eca7da1b6ae94451dd981
2017-04-13 11:04:30 -07:00
Geoffrey Pitsch
87237d70a5 Ensure removeForegroundService checks both lists under lock
Prior CL didn't lock properly and would still fail if a
notification was both enqueued and posted at the same time.

Test: runtest systemui-notification
Change-Id: I1bdd779ecb872f1a02ffc38b6007239eb522b521
Fixes: 36550043
2017-04-13 13:44:09 -04:00
TreeHugger Robot
f726b4aa9a Merge "Always call unbind." into oc-dev 2017-04-13 17:28:52 +00:00
Bryce Lee
840c566d13 Remove window container from empty task when destroying.
Previously, the window container was being removed whenever we were
removing the task in a destroy mode. However, this caused issues
where an activity may still be present in the task record, leading to
a subequent change to limit this to tasks with overlays. This led to
the situation where the window container would not be destroyed when
it was supposed to, such as moving an activity to recents, but
otherwise destroying.

This changelist addresses the issue by always removing the window
container from tasks when removed from their parent stack in a
destroy mode and empty. In the recents flow, this will fire and
cleanup when the activity is destroyed.

Change-Id: I87548d6ff8e4d77b6294504d7cc78370cd5d31fa
Fixes: 37301159
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackTests
2017-04-13 10:16:59 -07:00
Julia Reynolds
d178ec489f Merge "Allow notification channels to be silent." into oc-dev 2017-04-13 17:07:46 +00:00
TreeHugger Robot
3d6225b4e2 Merge "Companion device mgr doesn't always exist" into oc-dev 2017-04-13 16:50:50 +00:00
Winson Chung
68cf1b8848 Merge "Fix issue with non-focusable PiP activities being resumed." into oc-dev 2017-04-13 16:01:51 +00:00
TreeHugger Robot
7270534ac4 Merge changes I33ac2b52,I5ab8bb11 into oc-dev
* changes:
  Captive portal: fix probe urls at network creation
  NetworkMonitor: improve captive portal validation logs
2017-04-13 15:26:05 +00:00
Julia Reynolds
727a728836 Companion device mgr doesn't always exist
E.g. on tvs.

Test: runtest systemui-notification
Change-Id: I1f1fd3cc5d361d3854eef5e5726816b50f5d7eb6
Fixes: 37276184
2017-04-13 15:05:45 +00:00
Julia Reynolds
184b86da38 Allow notification channels to be silent.
This better accomodates those apps that play their own sounds.
Since most apps don't play their own sounds, update the documentation
on notificationchannel to add guidance about when they should add a
sound.

Fixes: 37237013
Test: runtest systemui-notification
Change-Id: If00b15b1b44da66d24dacb2895e9a6c0a06d1890
2017-04-13 11:03:57 -04:00
Julia Reynolds
889280c4c3 Only foreground notis should be sorted higher
Having the ongoing flag is not enough.

Test: runtest systemui-notification
Change-Id: I8a6c15af819f2bb4ad3937ae45d33361663fbe13
2017-04-13 11:03:57 -04:00
TreeHugger Robot
809f4cf121 Merge "Debugging issue #37272284: ActivityManager: SELinux tag not defined" into oc-dev 2017-04-13 14:32:41 +00:00
TreeHugger Robot
9d5ac93cc3 Merge "Stack APPLICATION_MEDIA_OVERLAY windows with relative layering." into oc-dev 2017-04-13 07:12:55 +00:00
TreeHugger Robot
818c408e5d Merge "Minor text fixes." into oc-dev 2017-04-13 07:00:57 +00:00
TreeHugger Robot
4ad2ebcc90 Merge "OMS: Fix bug where overlay settings wouldn't persist" into oc-dev 2017-04-13 06:42:52 +00:00
Winson Chung
3f103eb430 Fix issue with non-focusable PiP activities being resumed.
- When the change to finish activities was made in ag/2067154, it exposed
  an issue in pinned stacks where we would resume the next top activity
  once the top activity finished pausing. Normally, the pinned stack is
  not focusable, but since it has an alwaysFocusable menu activity it
  becomes the focused stack and falls into this case.

  Instead of finding the next top activity, we need to find the next top
  focusable activity to resume, and fall through to focusing the top
  activity in the next focusable stack if there is none.

Bug: 37199067
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testNoResumeAfterTaskOverlayFinishes
Change-Id: Ib79826ff38bb3beb38a40183ddc6819e5040bb27
2017-04-12 22:31:12 -07:00
Robert Carr
af422a8c5b Stack APPLICATION_MEDIA_OVERLAY windows with relative layering.
See accompanying frameworks/native commit
 "SurfaceFlinger: Add parent-less relative layering" for a full explanation.

Test: Manual of bug repro steps. Plus tests for new SurfaceControl functionality included in frameworks/native.
Bug: 36693738
Change-Id: Ic54598117c1f44a206d33f03d0cc463fbef43fcc
2017-04-12 21:40:30 -07:00
TreeHugger Robot
1423ea3a45 Merge "Report app data fixup and prepare timings" into oc-dev 2017-04-13 04:08:21 +00:00
Jocelyn Dang
78b3b2308c Merge "Add set-mode command to turn battery saver mode on and off." into oc-dev 2017-04-13 02:50:52 +00:00
Hugo Benichi
b2f960d1bc Captive portal: fix probe urls at network creation
This patch changes how url configuration values for captive portal
detection are read: instead of re-reading the settings at every probe
detection, the settings are read once when the NetworkMonitor associated
to a network is created.

If the settings are updated, the new values are picked up by new
networks, but not by existing networks. Since captive portal detection
is most important when joining WiFi networks, the newest available
settings values will still be used.

This change prepares introducing further changes for rotating probe
urls. Especially it helps making the detection strategy stateful with
respect to the lifecycle of a single NetworkMonitor.

Test: built, flashed, tested manually with various portal networks
Bug: 36532213
Merged-In: I71cc8bb8b996462f27f50798d67bceee5ffb898d

(cherry picked from commit b03272c9b5d1b5c71ae591f0e38b1d139d11f19f)

Change-Id: I33ac2b52fea6099969c3fec9b60ba0131f9d672d
2017-04-13 11:32:50 +09:00
Hugo Benichi
19e3cbdb35 NetworkMonitor: improve captive portal validation logs
This patch adds probe type and url to all validation logs about web
probes sent for captive portal detection.

Test: built, flashed, looked at $ adb shell dumpsys connectivity
Bug: 36830206, 36532213
Merged-In: Iee2caaf6664f3d097f9d1888ccc5fece0a95994c

(cherry picked from commit d9ac87ed65aa12b93e0b70f5e8560562c850fde0)

Change-Id: I5ab8bb117d2bbad123136dfbbf78cbe84a7f688e
2017-04-13 11:32:45 +09:00
Sudheer Shanka
67e802dd5e Merge "Update NPMS internal state when app idle parole state is changed." into oc-dev 2017-04-13 01:53:32 +00:00
TreeHugger Robot
efbcb0d2cc Merge "Fix regression when removing task." into oc-dev 2017-04-13 01:29:31 +00:00
TreeHugger Robot
c62f0d7495 Merge "Work on issue #36427964: SecurityException: Unable to find app..." into oc-dev 2017-04-13 01:27:53 +00:00
TreeHugger Robot
b74567dd3b Merge "Dump controller for AppWindowToken" into oc-dev 2017-04-13 00:43:42 +00:00
Wale Ogunwale
343cf6e920 Merge "Revert "Ensure visible activities when device is unlocked."" into oc-dev 2017-04-13 00:39:16 +00:00
Wale Ogunwale
919a05d4a3 Revert "Ensure visible activities when device is unlocked."
Causes issues with window life-cycle...

Bug: 37119770
Bug: 37244415
Bug: 37281544
This reverts commit 7004a8801d0a60013681a86043bab74b4d42d680.

Change-Id: I0039db6e44488cd82ef745aa979bc8549fd8aeed
2017-04-13 00:36:34 +00:00
Jeremy Joslin
1e2595d792 Always call unbind.
Per a recent discussion unbind should always be called, even if
bind() returns false.

Restructured the NetworkScoreService code to allow for easier and
more robust testing of the inner ServiceConnection class.

Bug: 36999204
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Change-Id: I08870b7109cb7f51cdab8b632b7d1d0898c3c015
2017-04-12 16:47:00 -07:00
Dianne Hackborn
d5a8b43f8e Debugging issue #37272284: ActivityManager: SELinux tag not defined
Add a little more info to the exception message.

Test: manual
Change-Id: I7ccbd5720d0e6c22a6caa9bfcb24cf40effde804
2017-04-12 16:14:42 -07:00
Christopher Tate
ee3b42af3f Introduce PACKAGE_FIRST_ADDED broadcast
When an app first appears on a device, this new broadcast is issued
including to manifest receivers.  The more general PACKAGE_ADDED
broadcast continues to be issued for both first install and updates,
but is not delivered to manifest receivers of apps that target O+.

Bug 37219124
Test: manual

Change-Id: I59b0a0b0dce96a909076b41280771f63e59584be
2017-04-12 16:14:17 -07:00
Todd Kennedy
c06c030671 Filter instant app content providers
Only expose the correct content providers depending upon which
component defines/exposes them.

Change-Id: I283c787165e33d9515068487f83de6d28616b427
Fixes: 35871462
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
2017-04-12 16:03:22 -07:00
Rob Carr
7040f573f3 Merge "Fix auto-pip visibility issues." into oc-dev 2017-04-12 22:46:26 +00:00
Jocelyn Dang
f2c38c130f Add set-mode command to turn battery saver mode on and off.
Affected test will be modified in ag/2101279

Test: adb shell cmd battery unplug && adb shell cmd power set-mode 0
Bug: 31944272
Change-Id: Ia88e7e164aa9b8b4d0ab51f607a64b35e2159273
2017-04-12 15:39:03 -07:00
Dianne Hackborn
81bfe1f62e Merge "Allow appops command to modify uid ops." into oc-dev 2017-04-12 21:37:52 +00:00
Sudheer Shanka
3af0294c36 Update NPMS internal state when app idle parole state is changed.
Fixes: 37250313
Test: 1. cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests
      2. runtest -c com.android.server.NetworkPolicyManagerServiceTest frameworks-services
Change-Id: I5fcac397116a07fe9015b7dabf5bca57b0b23176
2017-04-12 14:35:16 -07:00
Dianne Hackborn
ad6ab44e15 Merge "Add API to get a uid's current importance." into oc-dev 2017-04-12 21:11:46 +00:00
Dianne Hackborn
f74210c3a3 Merge "Fix issue #37220301: Allow broadcasts with permissions to not be restricted" into oc-dev 2017-04-12 21:10:03 +00:00
Adam Lesinski
d11c5510b1 OMS: Fix bug where overlay settings wouldn't persist
The dead user check was using a List.removeAll() call to find
the subset of users that have been removed and need deleting
from the overlay settings. The target class, UserInfo, does not
implement equals(), therefore no UserInfos would be removed from
the set and all user IDs would be candidates for deleting.

This change avoids the UserInfo class entirely and manipulates userIds.

Bug: 36099320
Test: Pick a theme and reboot.
Test: Theme should still be applied on next boot.
Change-Id: I1ee57839515460bf578664dfe1bd67df7d10d041
2017-04-12 13:49:13 -07:00
Wale Ogunwale
9c64cb6a72 Dump controller for AppWindowToken
To help with debugging.

Bug: 36097078
Test: N/A
Change-Id: I72108b918d839b67efe8b8eed65a33775bd94dbc
2017-04-12 13:39:59 -07:00
TreeHugger Robot
e7b806e9d2 Merge "Allow instant app resolution for any user" into oc-dev 2017-04-12 19:45:55 +00:00
TreeHugger Robot
684b5381e9 Merge "Rename WEB_ACTION_ENABLED to INSTANT_APPS_ENABLED" into oc-dev 2017-04-12 19:39:16 +00:00
TreeHugger Robot
e7ce1d40e1 Merge "Add documentation for 'am start-foreground-service'" into oc-dev 2017-04-12 19:37:26 +00:00
Adam Lesinski
d4abd1eeb0 BatteryStats: Remove reading of cpu power
The cpu power reported by the uid_cputime kernel is inaccurate
and has only ever been recorded for dumping to batterystats.
The values have never been used in power blame calculations.

This change removes these power values which just cause noisy
data.

Bug: 36002715
Change-Id: I61bea9992aabb84d099689360fd9377b44b36e2f
Test: run `adb shell dumpsys batterystats`
Test: should not show `p=` for `Total cpu time:` line
2017-04-12 12:25:21 -07:00