Commit Graph

7801 Commits

Author SHA1 Message Date
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
Keun-young Park
60ec4506f7 Merge "log last fs shutdown time / stat before reboot" 2017-03-21 03:50:46 +00:00
Keun-young Park
fbd19aad72 log last fs shutdown time / stat before reboot
- init will record shutdown time spent in file system part
  to kernel log, and it is avaiable as last_kmsg after reboot.
- Find it from last_kmsg and log it.

bug: 36004738
Test: reboot / cold boot and check logs
Change-Id: Ic5795b327eec482895ac79b39be2a246c6997999
2017-03-20 17:39:46 -07:00
Eugene Susla
a540460e7b Merge "Register PackageMonitor for CompanionDeviceManagerService" 2017-03-20 23:04:16 +00:00
Charles He
16dd8500b6 VPN profile: break up lockdown mode validation
Previously, there is one single method to test whether the current VPN
profile is a valid configuration for lockdown (always-on) VPN. In order
to provide a clearer feedback to the user regarding which part of the
profile is incompatible with the lockdown mode, we break the orginal
isValidLockdownProfile method into various parts, which can be called
individually to identify the exact reason for lockdown being disabled.

Test: manual
Bug: 29208008
Bug: 28072644
Change-Id: I1703742fe3d18d771c7f8d029cb89c2c28737c1b
2017-03-20 21:56:42 +00:00
Eugene Susla
6a7006a968 Register PackageMonitor for CompanionDeviceManagerService
1. On package removed -> remove all its associations
2. On package updated -> if had associations, update special access permission
in accordance with (potentially changed) permission entries in manifest

Bug: 30932767
Test: 1. Remove app, and ensure xml entries for it got removed.
2. adb install new version of app without special permissions in manifest, and
ensure whitelist removal method got called
Change-Id: I87261c05ddcf40a18332d160b44ee2f8284df5e4
2017-03-20 13:38:58 -07:00
Christine Franks
6418d0b890 Add color temperature preference for Night Display
Bug: 32463283
Test: adb shell settings put secure night_display_color_temperature
XXXX, where XXXX is {0, 2900, 4000, 7000}, and the temperatures
outside the valid range are capped at the min/max, respectively.
Change-Id: I322c0a907b30742fc312a9938fd0c47f679e580b
2017-03-20 09:07:17 -07:00
Jeff Sharkey
683bcd30ef Use allocatable space when measuring for install.
The system is often willing to clear cached data to make room for
incoming installs, so use StorageManager.getAllocatableBytes() when
making "does it fit?" style decisions.

Add new INSTALL_ALLOCATE_AGGRESSIVE flag, which will flow through
to use StorageManager.FLAG_ALLOCATE_AGGRESSIVE when making allocation
related requests.  (This can be used by installers to indicate
packages that are critical to system health or security.

Test: runtest -x frameworks/base/core/tests/coretests/src/android/content/pm/PackageHelperTests.java
Bug: 36131437
Change-Id: If8118762fd1ca1f497d2cdd1787bdb3c9759dcc0
2017-03-18 17:54:54 -06:00
Andrii Kulian
c1b59ed73e Merge "Separate global and override config sent to client" 2017-03-17 15:39:37 +00:00
Andrii Kulian
446079600e Separate global and override config sent to client
There is some flakiness in View#onConfigurationChanged callback -
if ViewRootImpl receives config update earlier than ActivityThread,
it may not detect the configuration change and skip inner updates.
Also now ViewRootImpl assumes that it receives the global config as
a param, but instead it gets merged config from WM. This means that
ViewRootImpl#sConfigCallbacks was sending incorrect values to the
recipients.

This CL switches to sending global and override configuration to the
client separately. Also in case if there is a corresponding activity,
it first updates it and waits for update callback to ViewRootImpl.
This way global config and override config for activity will always
be set first and resources will be updated before inner state of
ViewRootImpl is updated.

Bug: 35870157
Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: testOnMovedToDisplayCallback
Change-Id: Ic9e7541cf25ecfac6ec90e48f7efb0ece91f657e
2017-03-16 19:13:02 -07:00
Selim Cinek
35cb746e1d Merge changes I414b9a5f,I0a08b06b
* changes:
  Fixed a bug where the notifications could get stuck animating
  Better messaging style wrapping
2017-03-16 20:25:02 +00:00
tony.ys_liu
180f5e918c Merge "Set system server's class loader for wrap.system_server" am: 8d2d6bfa12 am: 959628a32e
am: d794855fba

Change-Id: Id7f48fe3c4b1855e8e9a450c70db00f057502ad4
2017-03-16 15:54:02 +00:00
tony.ys_liu
959628a32e Merge "Set system server's class loader for wrap.system_server"
am: 8d2d6bfa12

Change-Id: Iba4af152c9f29ad6e8c9bb1b0a1047e96d287c6b
2017-03-16 15:42:53 +00:00
Julia Reynolds
1d97e6a0c1 Remove resource id channel/group name fields
Apps can listen for the LOCALE_CHANGED broadcast to
change names if needed.

Fixes: 35336590
Test: runtest systemui-notification, cts, manual
Change-Id: I62d2778f61e99200692755a6f268828a374837e6
2017-03-16 14:20:28 +00:00
tony.ys_liu
34738174ba Set system server's class loader for wrap.system_server
Root Cause: systemServer's class path is not set
  after set wrap.system_server property, and restart system_server,
  it shows a java.lang.RuntimeException:
    Missing class when invoking static main com.android.server.SystemServer

Solution: Correctly pass and parse a passed classpath.

Bug: 34692265
Test: adb root && adb shell stop && adb shell setprop wrap.system_server logwrapper && adb shell start
Change-Id: Ia6707dc05fa627af6cc28360d26b894487a6eff1
2017-03-15 16:33:04 -07:00
Mady Mellor
da42f4aaa9 Merge "Enables drag to dismiss for PiP and adds a dark scrim when dismissing" 2017-03-15 21:59:04 +00:00
Evan Rosky
b22faf524e 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
2017-03-15 13:41:34 -07:00
Abodunrinwa Toki
047fe04766 FloatingToolbar: Change divider color.
Test: Visually inspected.
Bug: 36038316
Change-Id: I4bf3b2abdfe15ff02b3969d1824752640e733128
2017-03-15 19:14:26 +00:00
Mady Mellor
81d406104a Enables drag to dismiss for PiP and adds a dark scrim when dismissing
- Adds a scrim that fades in as the PiP is dragged past the bottom movement
  bounds.
- Tweaks the values for minimizing the PiP and dismissing the PiP
- Fixes an issue where the PiP could be minimized in the bottom corners
  of the screen

Test: Manual - drag PiP to bottom of screen to dismiss or swipe down on
PiP when it's at the bottom of the screen
Bug: 35358768
Bug: 35358628
Change-Id: Ib4ad5ed7094fef76ea979b46ea7e03d746625d00
2017-03-15 11:00:32 -07:00
Garfield Tan
9bd2f6c990 Update path in MediaStore when moving/renaming a file/folder.
Also fix a bug that doesn't trigger directory specific update for
removal.

Test: Manual tests.
Bug: 31001477
Change-Id: Ibae8a7aa5c72c82dc5e3cb4951fbc91ea6456964
(cherry picked from commit c574ec40640d83dfbbb0f022103c6dfa774bca40)
2017-03-15 17:14:44 +00:00
Nick Kralevich
35775783fc ZygoteInit: Remove CAP_SYS_RESOURCE
Please see commit 3082eb7c72 for an
explanation of this change.

This capability is not used by system_server.

Bug: 34951864
Test: code compiles, device boots, no selinux errors ever reported.
Change-Id: I4242b1abaa8679b9bfa0d31a1df565b46b7b3cc3
2017-03-14 18:30:03 +00:00
TreeHugger Robot
cf03c26f92 Merge "ZygoteInit: remove duplicate preloadOpenGL call" 2017-03-14 18:28:31 +00:00