Commit Graph

7822 Commits

Author SHA1 Message Date
TreeHugger Robot
a06240021a Merge "Process FuseAppLoop messages in Handler.Callback" 2017-04-03 06:49: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
020de02854 Consistent dump() permission checking.
am: fe9a53bc45

Change-Id: I300f8bc07e1266b9e78f56d085cd458862176a85
2017-04-03 06:19:02 +00: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
Daichi Hirono
5c2688a861 Process FuseAppLoop messages in Handler.Callback
Previously FuseAppLoop instantiates Runnable for each command, which
causes lots of instantiation and GC.

Test: CTS
Bug: 35229514
Change-Id: Ifea098e5ade044b1a954c0b714c5b3270a95cd1a
2017-04-03 13:18:40 +09:00
TreeHugger Robot
e516544c70 Merge "Collect background stats: scheduled jobs" 2017-03-31 23:59:08 +00:00
Winson Chung
c0e2621910 Merge "Ensure we show the PiP menu in response to KEYCODE_WINDOW." into oc-dev am: 2af994ec03
am: da7ef8060d

Change-Id: I715e2e79b729d28b856a8eda42b099db56cb0184
2017-03-31 23:27:58 +00:00
Winson Chung
da7ef8060d Merge "Ensure we show the PiP menu in response to KEYCODE_WINDOW." into oc-dev
am: 2af994ec03

Change-Id: I6abd868698fb9f7b16e62938e608f75fb2d610f4
2017-03-31 23:14:57 +00:00
TreeHugger Robot
2af994ec03 Merge "Ensure we show the PiP menu in response to KEYCODE_WINDOW." into oc-dev 2017-03-31 23:07:23 +00:00
Bookatz
d253f537a0 Collect background stats: scheduled jobs
Added background times and counts for an app's scheduled job usage.
Changes DualTimer to be a subclass of Timer so that background timers
can be easily accessed from the main timer (which is convenient for
jobs, whose ArrayMap of Timers is directly accessed outside of
BatteryStatsImpl).

Bug: 35669746
Test: runtest -x
frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java

Change-Id: Ic1d85db34346ebda94ed39f134fc0794a5877815
2017-03-31 12:43:34 -07:00
Winson Chung
ac52f2892d Ensure we show the PiP menu in response to KEYCODE_WINDOW.
Bug: 36687605
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testWindowButtonEntersPip
Change-Id: I0bb35fd666eb6a438e4676267f6726b44bffb3db
2017-03-31 10:42:53 -07:00
Amith Yamasani
f7d76614bb Merge "Bump up batterystats version to clear stale data" into oc-dev am: fb2f7e27ed
am: 33e20c433c

Change-Id: I2b0b70a17745ae77625a650965f95c4bd9a184a3
2017-03-30 23:06:24 +00:00
Amith Yamasani
33e20c433c Merge "Bump up batterystats version to clear stale data" into oc-dev
am: fb2f7e27ed

Change-Id: Icbc761881850e2ea39d2a4b62f9f0ff64bfedd5f
2017-03-30 23:01:50 +00:00
Amith Yamasani
b23e6358af Bump up batterystats version to clear stale data
Change-Id: I96016f30f38e17fcdfdb4a52eba69471945a21e2
Fixes: 36783752
Test: manually verified the file was deleted on flash
2017-03-30 14:01:59 -07:00
Adam Lesinski
81cbaadf64 Merge "BatteryStats: Clamp temperature to 0" into oc-dev am: 2042770ea5
am: c6e955569c

Change-Id: I9a879b887e1d717d597045bf1b504d8b7a211eee
2017-03-30 18:32:23 +00:00
Adam Lesinski
c6e955569c Merge "BatteryStats: Clamp temperature to 0" into oc-dev
am: 2042770ea5

Change-Id: I4e4d74a37afc3cdc56c14989ff66eadd774c39b7
2017-03-30 18:28:19 +00:00
TreeHugger Robot
2042770ea5 Merge "BatteryStats: Clamp temperature to 0" into oc-dev 2017-03-30 18:22:44 +00:00
Evan Rosky
2c449964f8 Merge "Allow ToolbarActionBar to pass-through unhandled keyShortcuts" into oc-dev
am: f114667f2d

Change-Id: I75deead3b2767d19f25378c4f34ca31c87027cae
2017-03-30 17:00:27 +00:00
Adam Lesinski
29ddfe55fb BatteryStats: Clamp temperature to 0
Temperature is encoded without the sign-bit, meaning
negative temperatures cause an underflow and show up
in the history as large values. We do not expect to
deal with negative temperatures for debugging/diagnostics
so just clamp the temperature to 0.

Bug: 33270828
Test: adb shell dumpsys battery set temp -10 && adb shell dumpsys batterystats --history
Change-Id: I8a92f770e4a90333eade1bb38f21d2d87bb00430
2017-03-29 19:34:08 -07:00
Evan Rosky
c46203785c Allow ToolbarActionBar to pass-through unhandled keyShortcuts
It was consuming all keyShortcuts which broke system hotkeys
like shift+tab.

In order to prevent the decor/phonewindow from creating menus,
this creates a dummy view in onCreatePanelView.

This also includes a change to Activity to not send KEYCODE_TAB
keystrokes to the defaulthandler. This was preventing keyboard
navigation from working on any activity that had a default
search fallback.

Bug: 32482282
Bug: 18021345
Test: Added a CTS test (ToolbarTest#testKeyShortcuts) for toolbar
      keyShortcuts. Verified Tab-navigation works in Play Store.
Change-Id: I5c732a2b21219157818bed49576debd20d5a8178
(cherry picked from commit b22faf524e)
2017-03-29 23:41:47 +00:00
Kang Li
35b9e30155 Add a service to rank apps for ResolverActivity.
bug: 30982298
Test: manual - shared images in Camera, texts in Messenger, and webpages
in Chrome.

Change-Id: If335c269ca54145839ad8fd4b3f9b93a74b550f8
2017-03-29 15:08:41 -07:00
Mukesh Agrawal
b4b7c1aa69 Merge "Merge changes I5c16c650,I3151fb6b am: 55efea25f3 am: ad2684ca3d am: 6b29b1c256" into oc-dev-plus-aosp
am: f463559a9a

Change-Id: If043f8624a7e6e0b66ab18ecbddd539736032002
2017-03-29 18:55:28 +00:00
Mukesh Agrawal
d194a1877a Merge changes I5c16c650,I3151fb6b am: 55efea25f3 am: ad2684ca3d
am: 6b29b1c256

Change-Id: I08019c46a433b5ea64a561d374df445d50400d45
2017-03-29 18:41:16 +00:00
Mukesh Agrawal
ad2684ca3d Merge changes I5c16c650,I3151fb6b
am: 55efea25f3

Change-Id: Ifaaae29780d905ffe9f82645d6d17dad478ba6a9
2017-03-29 18:30:00 +00:00
mukesh agrawal
47e1c7a005 StateMachine: make toString() terser
The current implementation of the toString()
method calls dump(). This causes two problems:

1. toString() may return a large string. This
   is at odds with the advice in the documentation
   for Object.toString(), which says that the
   returned String should be concise, and easy
   to read.
2. The dump() method is overriden by many of the
   StateMachine subclasses. Some of those subclasses
   have dump() implementations that are expensive,
   and/or have dependencies on other objects.

To resolve these problems, we simpify
StateMachine.toString().

Along the way: remove a stale comment about
implementing dump() using toString().

Note: only ran the StateMachine tests, since some
other tests are already failing.

Bug: 36661851
Test: tests/utiltests/runtests.sh \
      -e class com.android.internal.util.StateMachineTest
Change-Id: I5c16c650f01178c4d018b6a65e4aa95fb905aff6
2017-03-28 18:21:36 -07:00
Daichi Hirono
812c95d37d Allow apps to process ProxyFDCallback asynchrnously.
Previously callback methods of ProxyFileDescriptorCallback were invoked
on a background thread prepared in the framework. So all methods were
invoked and processed synchronously. This was problem because if it took
time to fetch bytes of one file, operations for other files were also
blocked.

The CL changes ProxyFileDescriptorCallback methods to be invoked on
Handler passed by apps. Now application can prepare a Handler per file
so that one file does not block others.

Bug: 35229514
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest#testOpenProxyFileDescriptor_async
Change-Id: Ibadc4aad4c0373a3da586459a8f775e40288c895
(cherry picked from commit 4f156065c8)
2017-03-29 00:14:16 +00:00
Evan Rosky
3473647f7d Merge "Allow ToolbarActionBar to pass-through unhandled keyShortcuts" 2017-03-28 19:38:45 +00:00
Torne (Richard Coles)
758f80ea43 Merge "Support loading a stub WebView using a donor package." into oc-dev am: 7ec7ef2ba3
am: 07cb93dc26

Change-Id: Ieadf02a034f991c3f7c6f745067eaa316a8dcbcf
2017-03-28 17:29:23 +00:00
Torne (Richard Coles)
0452670374 Support loading a stub WebView using a donor package.
Support loading a WebView package which specifies the name of a "donor"
that provides missing files. This allows a preinstalled stub WebView to
function by loading its code and assets from the preinstalled Monochrome
implementation, as long as the versions are close enough that the
manifest contents are compatible, which should be fine since
preinstalled versions will match.

To do this, we replace the stub's code paths in AppplicationInfo with
the donor's, so that all Java and native code and resources are loaded
from the donor APK at runtime instead of from the (mostly empty) stub.

To get the ClassLoader with the modified path cached as if it was the
regular path, we introduce a new "cacheKey" parameter in
ApplicationLoaders.

Bug: 21643067
Test: build "new" stub WebView upstream in chromium and test loading
Change-Id: I08cc9122b1c9def3e1206974f3e0e8973cca3419
2017-03-28 16:21:10 +00:00
TreeHugger Robot
4de48d03f3 Merge "Allow apps to process ProxyFDCallback asynchrnously." 2017-03-28 09:41:53 +00:00
Michael Kwan
1d34605fcb Merge "Catch exception where SwipeDismissLayout cannot monitor screen off." 2017-03-28 00:20:07 +00:00
Daichi Hirono
4f156065c8 Allow apps to process ProxyFDCallback asynchrnously.
Previously callback methods of ProxyFileDescriptorCallback were invoked
on a background thread prepared in the framework. So all methods were
invoked and processed synchronously. This was problem because if it took
time to fetch bytes of one file, operations for other files were also
blocked.

The CL changes ProxyFileDescriptorCallback methods to be invoked on
Handler passed by apps. Now application can prepare a Handler per file
so that one file does not block others.

Bug: 35229514
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest#testOpenProxyFileDescriptor_async
Change-Id: Ibadc4aad4c0373a3da586459a8f775e40288c895
2017-03-27 16:18:20 +09:00
Casey Burkhardt
5e8b980c5d Target selection for Accessibility button
Allows for selecting a single accessibility service or feature
to be triggered by the accessibility button in the navigation bar

Bug: 34720082
Test: Manual
Change-Id: I320febede0398b1eff38a87d4db31fd7dfc53062
2017-03-24 19:17:12 -07:00
TreeHugger Robot
cb34b96796 Merge "Collect background stats: bluetooth, wifi, sensors" 2017-03-24 23:04:07 +00:00
Michael Kwan
d3f4b5864d Catch exception where SwipeDismissLayout cannot monitor screen off.
Monitoring screen off uses a BroadcastReceiver. However, there are
occasionally uses where SwipeDismissLayout is used in a context where
it cannot use a BroadcastReceiver, notably when used inside of one,
therefore we need to catch and handle the case where it is not applicable.

Bug: 36034260
Change-Id: I253875623a28532dbc8a2dc96fc9468221b0b781
2017-03-24 14:28:46 -07:00
TreeHugger Robot
55807c973b Merge "Anchor a cascading submenu to its parent menu item" 2017-03-23 23:25:41 +00:00
TreeHugger Robot
37973fb0fc Merge "BatteryStats: force healthd update on screen on/off" 2017-03-23 20:13:33 +00:00
Charles He
d055c09841 Merge "VPN profile: break up lockdown mode validation" 2017-03-23 08:49:51 +00:00
Adam Lesinski
e1f480df60 BatteryStats: force healthd update on screen on/off
By collecting healthd data on screen on/off, more fine grained
analysis is possible.

Test: manual
Bug: 32645990
Change-Id: If348c0e9f52524bb5c5537652e13d0376cd77576
2017-03-22 16:56:33 -07:00
Evan Rosky
9d9430e7f7 Merge "Hooked-up options menu closing" 2017-03-22 22:13:03 +00:00
Geoffrey Pitsch
3560f847fb AccountManagerService send pkg uid when creating notification channel
AccountManager needs to pass the app's uid explicitly in order for the
channel lookup to not fail. Requires separate API that only system can
call.

Bug: 36511867
Test: Install Clankium and reboot device, observe Notification
Change-Id: I6ddd87d755b4b2129565dd275e799b0349a80936
2017-03-22 16:49:05 -04:00
Bookatz
867c0d72af Collect background stats: bluetooth, wifi, sensors
Added background times and counts for an app's bluetooth scans, wifi
scans, and sensor usage. Note that the original times for these three
are pooled (i.e. represent the blame apportioned to an app for using
these, rather than the actual time an app used these). Since background
times are not pooled, and are therefore incomparable to the original
times, an extra time, to represent the actual time, had to also be added
in the form of 'total duration' to which background times can be
compared.

Note that this total duration is now a feature of all DurationTimers and
can be used, e.g., to track actual wakelock time (not just
apportioned wakelock times). The total duration is the time used since
reset, and does not give other 'which' times (such as 'since
unplugged').

Bug: 35679958
Bug: 35677312
Bug: 35673525
Test: runtest -x
frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java

Change-Id: I4b6943f76517cf5cc9420684857a5592cc7495be
2017-03-22 10:18:43 -07:00
Kirill Grouchnikov
73b8418617 Merge "Add support for tinting icon menus" 2017-03-22 17:07:38 +00:00
Kirill Grouchnikov
6eea0d2a4c Add support for tinting icon menus
Test: CTS tests in separate CL (same topic)
Bug: 31545315
Change-Id: I8877c77dab9b7b229b4246012b9380beadeb4790
2017-03-22 11:05:49 -04:00
Jason Monk
361915c727 Move global actions to sysui and add plugin interface
- Move default global actions ui to sysui
 - Add fallback legacy interface in case sysui breaks
 - Switch to fallback if sysui dies or isn't responding

Test: Long-press power
Change-Id: I943522611de5dbbee61e66c67cf3a56379091e97
2017-03-22 09:41:34 -04:00
Evan Rosky
41823d19b6 Hooked-up options menu closing
Options menus weren't closing properly from menu-key (with
CascadingMenuPopup) or from Activity.closeOptionsMenu

Bug: 36398283
Test: Added CTS tests: app.ToolbarActionBarTest and
      app.ActionBarTest#{testOptionsMenuKey, testOpenOptionsMenu}

Change-Id: I89f8ed249b505f369a85b899ca7c1b36c863f0c0
2017-03-21 14:42:35 -07:00
Garfield Tan
9361541998 Add special URI to MediaStore for directories.
Bug: 36048049
Bug: 31001477
Change-Id: I69032481271b7f53c22403c3526560e6830bd9e8
(cherry picked from commit 1ca2837111c8383f9c8daf1420356998f4fb218f)
2017-03-21 20:05:04 +00:00
Andreas Gampe
1185eebefb resolve merge conflicts of 9034b2717c to master
Change-Id: Ifcc9fdbf8581e81a61f7a279c2b7d3177e972596
2017-03-21 12:17:16 -07:00
Andreas Gampe
1d9c3ba10d Merge "Zygote: Preserve capabilities in WrapperInit"
am: 1ae7af10ff

Change-Id: Ia1ffb03d6e03b098cc634ef2deb3785c6bb87202
2017-03-21 18:54:22 +00:00
Andreas Gampe
220aba254b Zygote: Preserve capabilities in WrapperInit
Preserve the capabilities a zygote fork has across the sh exec in
WrapperInit. Use ambient capabilities.

Test: m
Test: adb shell setprop wrap.com.android.bluetooth logwrapper && adb shell kill `pid com.android.bluetooth`
Merged-In: I3526d6a31aaadf082365c9ce31da0950e17677eb
Change-Id: I3526d6a31aaadf082365c9ce31da0950e17677eb
2017-03-21 08:39:26 -07:00