Commit Graph

7671 Commits

Author SHA1 Message Date
Kang Li
6df90fa53b Merge "Add a service to rank apps for ResolverActivity." into oc-dev 2017-04-04 17:42:32 +00:00
TreeHugger Robot
2ac9698271 Merge "Reorganize font enumeration API." into oc-dev 2017-04-04 16:49:56 +00:00
Jorim Jaggi
de95d544cd Merge "Schedule window animations at vsync-sf" into oc-dev 2017-04-04 09:26:03 +00:00
Jorim Jaggi
1edadac465 Merge "Handle case when snapshot dimensions don't match" into oc-dev 2017-04-04 09:14:38 +00:00
Kang Li
90370e0b24 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
(cherry picked from commit 35b9e30155)
2017-04-03 23:44:59 +00:00
Seigo Nonaka
ff55115121 Reorganize font enumeration API.
This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
  This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.

Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
2017-04-03 13:55:07 -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
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
TreeHugger Robot
cb9ceb3fd4 Merge "Process FuseAppLoop messages in Handler.Callback" into oc-dev 2017-04-03 06:55:04 +00:00
Daichi Hirono
ea6e6e17a0 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 05:03:03 +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
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
Makoto Onuki
99302b55c6 Revert "Push chooser targets to the shortcut manager."
This reverts commit 58fc95dc57.

Bug 36186790
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases

Also all unit tests, except for the known failrues.
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: I733ee7e12a419ee7ea17ca67c56afe7b039d189a
2017-03-31 15:16:43 -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
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
TreeHugger Robot
2042770ea5 Merge "BatteryStats: Clamp temperature to 0" into oc-dev 2017-03-30 18:22:44 +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
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
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
Michael Kwan
1d34605fcb Merge "Catch exception where SwipeDismissLayout cannot monitor screen off." 2017-03-28 00:20:07 +00: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