Commit Graph

10227 Commits

Author SHA1 Message Date
Svet Ganov
da0acdf938 Auto-grant background execution and data access
Companion apps can declare they want background access and
background execution exceptions via dedicated permissions
in their manifest. If such a permission is requested we
auto-grant the corresponding exception after the user has
chosen a device from the companion UI. These permissions
are appop ones allowing us to use the app ops for gauging
whether the user has made a change after we auto-granted
the permission since we would like to revoke these special
privileges when the app disassociates itself from the
companion device if the user did not make an excplicit
choice otherwise.

While at this auto-grant fixed location permission to the
companion device discovery service.

Test: manual

Change-Id: I46ee4291e5e5a8f7613f0dd75eb61d6b9341f306
2017-02-15 20:32:41 -08:00
Rubin Xu
824b073fbe Merge "Add escrow token API in DevicePolicyManager." 2017-02-16 01:36:46 +00:00
Guang Zhu
626ffb4556 Merge "Revert "Per user setting for instant app"" 2017-02-15 21:47:34 +00:00
Guang Zhu
be9ffa15af Revert "Per user setting for instant app"
Bug: 35390781

This reverts commit 2f5811dcfd.

Change-Id: Ibb1c8dacbdc6908fc7fa2bc5dca664f2455162bf
2017-02-15 21:43:48 +00:00
Philip P. Moltmann
9a044dad00 Merge changes from topic 'revert-anr-revert'
* changes:
  Process queuedWork on main thread and add logging
  Revert accidential merge 492a058d58
2017-02-15 21:37:34 +00:00
Selim Cinek
b52448c8b5 Merge "Fixed a few coloring issues" 2017-02-15 20:08:58 +00:00
Rubin Xu
aab7a4146c Add escrow token API in DevicePolicyManager.
Take advantage of the new authentication flow in LockSettingsService
and allow PO or DO to provision escrow tokens on the device. The
escrow token grants them the ability to change device lockscreen
(if used by DO) or work profile challenge (if used by PO). The
new password reset mechanism is even usable before user unlocks,
and it preserves authentication-bound keys in keystore.

Test: runtest frameworks-services -c com.android.server.SyntheticPasswordTests
Test: runtest frameworks-services -c com.android.server.devicepolicy.DevicePolicyManagerTest
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testResetPasswordWithToken
Bug: 33126620
Change-Id: Iaa684c51946f726cbd909e9ac70ad3e9ca3de1ac
2017-02-15 19:54:31 +00:00
Philip P. Moltmann
a211bc1a03 Process queuedWork on main thread and add logging
- The queued work processing thread might be sleeping while the main
  thread is waiting for it to do work. Hence process the work in the main
  thread.
- Carefully add logging so that slowness can be tracked.
- Fix usage of the wrong lock (sWork instead of sLock).
- Increase the time of the delay between apply and write to make
  possible side-effects more visible

Test: SharedPrefencesTest, looked at logging
Bug: 30662828
Change-Id: Ie8a5d531e180dacec29c947ba0b59b170facf782
2017-02-15 11:27:27 -08:00
Todd Kennedy
bf92b812db Merge "Per user setting for instant app" 2017-02-15 19:19:26 +00:00
Felipe Leme
a45eb7eb12 Merge "Enable auto-fill when activity is marked as FLAG_SECURE." 2017-02-15 07:48:48 +00:00
Felipe Leme
71377a4ae2 Enable auto-fill when activity is marked as FLAG_SECURE.
BUG: 34077687
Test: CtsAutoFillServiceTestCases passes
Change-Id: I2d7a565a53a32792d6daeceba3f3a7beebdf052c
2017-02-14 18:19:08 -08:00
Selim Cinek
875ba9bd8e Fixed a few coloring issues
The color of the icon was happening in a
non-animated way. We're now animating the
color properly.
This also fixes an issue where the action
bar could be fully black.

Test: add colorized notification, observe animation
Fixes: 35308322
Change-Id: I4fbc1794fc027efb42eee3ee8f06fd9d8c513456
2017-02-14 17:28:15 -08:00
Philip P. Moltmann
82b902204f Revert accidential merge 492a058d58
Test: Clean revert
Change-Id: I61d339bb85936e1d50742be1e4c6dab781f3a4e7
2017-02-14 17:02:50 -08:00
Amith Yamasani
dd757883c2 Merge "Fix NPE in handleBindApplication" 2017-02-15 00:55:01 +00:00
Amith Yamasani
336d29d409 Fix NPE in handleBindApplication
Use getPackageManager(), as sPackageManager might not be initialized
yet.

Bug: 35359850
Test: manual
Change-Id: I16f5af613e9f6a6dc776bd2da74779e509899541
2017-02-14 15:14:09 -08:00
TreeHugger Robot
7ad2067f98 Merge "Add API to track package changes" 2017-02-14 23:10:59 +00:00
Todd Kennedy
2f5811dcfd Per user setting for instant app
The same application can run as either an instant app or an installed
app. Store this setting per-user instead of based upon the install
location.

Bug: 25119046
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Iff565bb1ac10d631499f0bd0f69b401cb073c10e
2017-02-14 13:42:01 -08:00
TreeHugger Robot
8b39573f15 Merge "Heads-up notifications of increased height behave better" 2017-02-14 21:07:22 +00:00
Todd Kennedy
9106c64bf3 Add API to track package changes
After any package install, removal or update, save the changed
package and update a global sequence number. At any point, apps
can query for the packages changed since a particular sequence
number.

If a package is changed multiple times, it is only included once
in the change list.

Bug: 33865505
Test: Create sample app to query for changes and see which packages are changed after performing certain operations
Change-Id: Ia4646035362b16a97110e05f3f909ce385b48428
2017-02-14 12:44:50 -08:00
TreeHugger Robot
79b9853f49 Merge "Disable TaskSnapshots to fix crashes for DP." 2017-02-14 18:55:25 +00:00
Robin Lee
3cb867326a Merge "Theme work lock activity with the task primaryColor" 2017-02-14 18:38:14 +00:00
Philip P. Moltmann
492a058d58 resolve merge conflicts of d043a840f7 to nyc-mr2-dev-plus-aosp
am: b02f8eb241

Change-Id: I1307ea308423c0fd34564d788ab64c023a5be2c5
2017-02-14 18:28:25 +00:00
Philip P. Moltmann
b02f8eb241 resolve merge conflicts of d043a840f7 to nyc-mr2-dev-plus-aosp
Test: Clean merge
Change-Id: Ib2420ff793fdf22fd80cfaed7848ff6b8be8d382
2017-02-14 09:51:16 -08:00
Robert Carr
280d1e55ef Disable TaskSnapshots to fix crashes for DP.
Renderthread can't crash in system server if you don't
have Renderthread in system server.

Bug: 34817544
Bug: 34840652
Test: Basically a revert
Change-Id: Ic7384b8b1f22459f4a299a84425af91515a92551
2017-02-14 09:12:18 -08:00
Philip P. Moltmann
d043a840f7 Merge "[DO NOT MERGE] Revert "[DO NOT MERGE] Delay SharedPreferences.apply() by 50 ms"" into nyc-mr2-dev 2017-02-14 16:03:32 +00:00
TreeHugger Robot
02761acc67 Merge "Declarative downloadable fonts" 2017-02-14 15:39:04 +00:00
Shreyas Basarge
bf6655b315 Merge "BackupManager#cancelBackups() API" 2017-02-14 13:53:33 +00:00
Shreyas Basarge
c3704427c9 BackupManager#cancelBackups() API
Introduces a cancelBackups() API for
BackupManager. When this function returns,
it is guaranteed that currently running
backup operations won't interact with
the active transport.

Bug: 34760860

Ref: https://docs.google.com/document/d/18MnfwkDfKNtXQBPRmL8vpVgfLgSWJsDja1Nm1QV5hOw/edit#heading=h.9p6yo0wx44k3

Test: GTS tests at ag/1893365

Change-Id: I67f78699bbe763ea71c85937fbc01a5b48694eed
2017-02-14 13:51:59 +00:00
Clara Bayarri
4b5a4d221f Declarative downloadable fonts
Implement support for downloadable font requests in xml. Given the
xml fonts feature in O, this adds support to not only declare
local font files as font resources, but also Downloadable fonts
from a fonts provider.

A provider returns a font family (of one or more files) given a
query, so the new attributes are added to the font-family tag.

Additionally, add support to pre-declare downloadable font resources
in the Android Manifest. These will then be fetched at app startup
time so they are available to use from the Typeface cache asap.

When retrieving downloadable fonts via resources, the cache is
checked to see if the font is already there and is used, otherwise
a request is sent to the provider and the default font is returned
as we need a result synchronously.

To do this, the developer declares an additional fonts xml resource
file with the list of fonts to preload and links it in the manifest
with a meta-data tag.

E.g.:

res/font/mydownloadedfont.xml

<font-family xmlns:android="http://schemas.android.com/apk/res/android"
        android:fontProviderAuthority="com.example.test.fontprovider"
        android:fontProviderQuery="myrequestedfont">
</font-family>

res/font/preloaded_fonts.xml

<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
    <font android:font="@font/mydownloadedfont" />
</font-family>

and in the AndroidManifest.xml

<meta-data android:name="preloaded_fonts"
    android:resource="@font/preloaded_fonts" />

Bug: 34660500, 34658116
Test: WIP, need to add more
Change-Id: I1d92555e115e241bf23b59e6f5c6cca6c7361de7
2017-02-14 13:32:41 +00:00
TreeHugger Robot
4dba3cdf89 Merge "Refactor auto-fill" 2017-02-14 09:37:53 +00:00
Svet Ganov
782043caf8 Refactor auto-fill
* Fix a layering issue where auto-fill manager which is in view
  depended on activity which is in app

* Moved auto-fill classes to view or service based on their
  purpose and removed dependecy on the classes in view to the
  classes in service

* Push state to local auto-fill manager whether auto-fill is
  enabled to avoid making IPC for every focus transition if
  the user did not enable the feature

* Remove unnecessary offload to messages when handling calls
  to auto-fill manager service as these are made over a oneway
  interface and in general they do almost no work and typically
  we do these on the binder thread

* Removed id from data set and fill response as the provider
  can embed everything it needs to id them in the auth pending
  intent

* Enforce the auth UI to be only an activity as this will work
  with multi-window, recents, and back and also does not require
  draw on top of other app special permission

* Authentication also no longer requires passing a remotable
  callback to the auth activity but the activity handles the
  request as if called for a result

* Handling stopping of a user to clean up in-memory state as
  well as handling when a user gets unlocked as a provider may
  be non-direct boot aware

* User the correct context when creating an auto-fill manager

* Move the receiver that listens for requests to hide system
  windows to the manager service as the UI is a singleton and
  no need every per-user state to register its own

* Removed extras from dataset as the only case a provider needs
  to associate state with a dataset is for auth and the provider
  can embed this data in the auth pending intent

Test: manual and CTS

Change-Id: I4bc54c13cf779d7f6fdb3ab894637f9fac73f603
2017-02-13 21:31:37 -08:00
Sudheer Shanka
27e6931583 Ensure network connectivity on app start.
Bug: 27803922
Test: cts-tradefed run singleCommand cts-dev --module CtsHostsideNetworkTests
Change-Id: Ifd7a52924cd6bbc809c9a3f92d52fe2df09b7fe2
2017-02-13 17:17:41 -08:00
Philip P. Moltmann
755d78dbd9 [DO NOT MERGE] Revert "[DO NOT MERGE] Delay SharedPreferences.apply() by 50 ms"
This reverts commit 2fc44947dd.

Bug: 30662828
Change-Id: Ia22343c19e155555dff3b0cb58f7b58df0ce6301
2017-02-13 23:44:31 +00:00
Robin Lee
3c82d3d5bf Theme work lock activity with the task primaryColor
This involves adding another system RPC, getTaskDescription(taskId)
gated on MANAGE_ACTIVITY_STACKS permission.

Bug: 31001762
Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/keyguard/WorkLockActivityTest.java
Change-Id: Ieb996f7fab5bc79737df570e35733551118118d3
2017-02-13 23:22:34 +00:00
Selim Cinek
87ed69bd6b Heads-up notifications of increased height behave better
In the shade, the heads-up version when their height is
increased now behave better and the notification shows more
then a single message as well.

Test: add heads-up for messaging style notification while shade is expanded
Bug: 34469375
Change-Id: Ia3475eec5b4474aae950ef0eb84afb28689245ae
2017-02-13 13:51:37 -08:00
Winson Chung
12cb6628db Merge "Create a new stack for the assistant activity." 2017-02-13 20:39:52 +00:00
Selim Cinek
2698d1d1e8 Merge changes Ie3736d80,I52444f4e
* changes:
  Improved collapsed messaging notifications
  Fixed a bug where the heads-up couldn't time out
2017-02-13 20:37:48 +00:00
TreeHugger Robot
860d17d154 Merge "PendingIntent: Use rethrowFromSystemServer" 2017-02-13 18:16:29 +00:00
Geoffrey Pitsch
7c4f39b856 Merge "Updated Inline Notification Controls" 2017-02-13 17:47:33 +00:00
TreeHugger Robot
04fa542db5 Merge "Set oom adj for processes displaying app-overlays to PERCEPTIBLE_APP_ADJ" 2017-02-13 16:19:41 +00:00
Adrian Roos
7540923bda PendingIntent: Use rethrowFromSystemServer
Fixes an issue where during a crash or shutdown of system_server apps
would start getting unexpected nulls as results of PendingIntent.get...(),
causing them to crash and getting flagged by AUPT.

Change-Id: Ieec289921f125da469f83813ca3f5920b5794a31
Fixes: 34932613
Test: adb shell stop; verify that there are no crashes in logcat.
2017-02-13 14:48:57 +01:00
Shreyas Basarge
69f42ecbb6 Merge "BackupAgent#getBackupQuota() API" 2017-02-13 13:46:00 +00:00
Wale Ogunwale
d993a573d7 Set oom adj for processes displaying app-overlays to PERCEPTIBLE_APP_ADJ
For processes with a window of type TYPE_APPLICATION_OVERLAY adjust their
oom importance to PERCEPTIBLE_APP_ADJ to reduce the chance of them getting
killed by the low-memory-killer since they are displaying something that
is perceptible to the user.

Also z-order TYPE_DREAM windows above alerts windows.

Bug: 33256752
Test: cts/.../run-test CtsAppTestCases android.app.cts.AlertWindowsTests
Change-Id: I4c05a9fee6fad61399bf4d10c8647467cc596ca6
2017-02-12 16:57:24 -08:00
Winson Chung
8347163dbb Create a new stack for the assistant activity.
- Add a new stack that is not resized with multiwindow, and
  appears above the fullscreen and docked stacks, but below
  the pinned stack
- Add a method on VoiceInteractionSession to allow the assistant
  to launch activities into this new fullscreen stack.
- Also prevent any activities in the assist stack from the
  fetching of the on screen assist data.

Bug: 30999386
Test: android.server.cts.ActivityManagerAssistantStackTests

Change-Id: I22ab7629b5f758cf1e66d7d1c26648af6bc887c9
2017-02-12 14:52:15 -08:00
Jeff Sharkey
72ec448307 Switch RecoverableSE over to using RemoteAction.
Now that RemoteAction supports PendingIntent, we should be using it
instead of rolling our own fields.  Continue offering legacy
constructor for some existing unit tests.

Create a notification channel for each remote app that throws at a
client app.  All apps targeting O must now use channels, which give
the user better control over notifications.

Mention in docs that strings should be localized.

Test: builds
Bug: 33749182, 35012253, 34676491
Change-Id: Ic57e32025bc6caf784d3746d9f97f6595b0edb69
2017-02-12 03:21:39 -07:00
Geoffrey Pitsch
df44b606f3 Updated Inline Notification Controls
Removed old xml resources, strings, dimens, etc
Different behavior when sent from the default channel.
Display how many notification categories are used by the app.
Group label when channel is associated with group.
Add package icon.
Fix tap-away-to-save behavior

Test: runtest systemui
Change-Id: Ib41a536a5c4e7c7747a2453eddc3b4b4b99ffa7a
2017-02-10 13:24:54 -05:00
Shreyas Basarge
b6e73c9670 BackupAgent#getBackupQuota() API
This cl adds a getBackupQuota() method
to the BackupAgent abstract class. This
can be used by the agent to determine
how much data it can back up.

Ref: https://docs.google.com/document/d/18MnfwkDfKNtXQBPRmL8vpVgfLgSWJsDja1Nm1QV5hOw/edit#heading=h.unncio2r7de2

Bug: 33750400

Test: GTS test at ag/1850525

Change-Id: I2eb5c0066c99732ec84cae9211f3a1edaad2baf1
2017-02-10 18:11:40 +00:00
Julia Reynolds
71b60b86e3 Merge "Let apps link to noti settings and vice versa." 2017-02-10 16:05:10 +00:00
Stefano Tommasini
afcea28827 Merge "Add instrumentation for BackupManager during restore." 2017-02-10 15:46:06 +00:00
Stefanot
f4e237c685 Add instrumentation for BackupManager during restore.
This CL adds more instumentation to
backup/restore operation in the BackupManager. For more details please
point to:
https://docs.google.com/document/d/1sUboR28LjkT1wRXOwVOV3tLo0qisiCvzxIGmzCVEjbI/edit#
This first Cl introduces 3 events that we sent to the monitor.
The base cl is ag/1835775

Test: TODO

BUG: 34873525
Change-Id: I127fe739a7522078eecce2ae689a4607203a98da
2017-02-10 13:52:02 +00:00