Commit Graph

12559 Commits

Author SHA1 Message Date
Tyler Gunn
79bc1ec8a9 Add handover permission, fill in some missing API gaps.
Adding the ACCEPT_HANDOVER runtime permission which an app must have in
order to accept handovers (this is per design).

Adding missing onHandoverComplete method in the android.telecom.Connection
API (per design).

Finishing plumbing for android.telecom.Call#onHandoverComplete API.

Fix issue where the new handover API methods would never get called; the
legacy handover extra was being used in this case when it should not have
been.

Bug: 65415068
Test: Verified using new CTS tests
Change-Id: If1558f6a23911862c02ac5b18fb62d86911ed7e2
2018-01-24 16:11:27 -08:00
TreeHugger Robot
e9d3cc5ad8 Merge "ActivityManager: add API for wifi bug report" 2018-01-24 23:36:19 +00:00
Antoan Angelov
2a5a43d61c Merge changes from topic "dpc-migration-atomic"
* changes:
  Notify DO after PO ownership transfer when they belong to affiliated users.
  Tests for owner transfer atomicity.
  Make owner transfer an atomic operation.
2018-01-24 20:11:54 +00:00
Vladislav Kuzkokov
f4e01170b8 Merge "Fix Printing policy in profile owner." 2018-01-24 20:11:31 +00:00
arangelov
b46faf35c8 Notify DO after PO ownership transfer when they belong to affiliated users.
Test: Locally modified TransferDPC to print the callback after manually setting DO, PO and then transfering PO owner.
Bug: 72218214
Change-Id: I6c9af00bcfa703c81d9d5b35fe534c928991ff93
2018-01-24 19:20:37 +00:00
arangelov
91201bdbca Make owner transfer an atomic operation.
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.TransferOwnershipMetadataManagerTest
Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/OwnerTransferParamsManagerTest.java
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testRevertDeviceOwnership_noMetadataFile
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testRevertDeviceOwnership_adminAndDeviceMigrated
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testRevertDeviceOwnership_deviceNotMigrated
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testRevertDeviceOwnership_adminAndDeviceNotMigrated
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testRevertProfileOwnership_noMetadataFile
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testRevertProfileOwnership_adminAndProfileMigrated
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testRevertProfileOwnership_profileNotMigrated
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest#testRevertProfileOwnership_adminAndProfileNotMigrated
Bug: 69543005

(cherry picked from commit 5a6d391dedcdec13fcc4cf1770e7bf9fc1be8643)

Change-Id: Ic2d729d48fdb47b0ebd60030b45615b0cec174a2
2018-01-24 19:20:36 +00:00
mukesh agrawal
d9e1df58be ActivityManager: add API for wifi bug report
Under certain (limited) conditions, we would like to
automatically trigger a bug report to help diagnose
Wifi problems.

The regular bugreport can't be used for this purpose,
as it takes a long time to generate. To support
lightweight auto-bug generation, add a Wifi-specific
bugreport.

Bug: 69934148
Test: manual

Manual test
-----------
- boot walleye
- enable wifi
- connect to googleguest
$ adb root
$ adb shell pkill -f 'wifi@'
- notice "Bug report #1 captured" notification
$ adb pull '/data/user_de/0/com.android.shell/files/bugreports
$ unzip bugreports/*.zip
$ grep "was the duration of 'DUMPSTATE'" bugreport*.txt
->  ------ 1.548s was the duration of 'DUMPSTATE' ------

Change-Id: If657eb8f61b16cefe717c977663438c28f515bd7
2018-01-24 10:03:35 -08:00
Dianne Hackborn
994b5ad737 Fix issue #72116995: Add permission guarding Service#startForeground
Now requires permission if targeting P.

Note that this is a separate permission from the existing one
that is required for instant apps to use foreground services.  The
reason for this is that their semantics are different (the instant
apps permission is associated with an app op for control over what
the app is allowed, while the regular app permission is just a
normal permission that is always granted and only there for
auditing of apps), and there are probably going to be cases where
a developer will want to use a foreground service in the full
version of their app but not as an instant app.

Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: If5a79e7ed5ab9e0edc77410315eb4d2df8ac850b
2018-01-24 17:58:24 +00:00
TreeHugger Robot
fa0bfce3ef Merge "Add requireViewById" 2018-01-24 17:48:52 +00:00
Geoffrey Pitsch
d997d191ed Merge "Security model for moving sharesheet to systemui" 2018-01-24 17:33:59 +00:00
Jason Parks
5511634f52 Merge "Allow unaffiliated Profile Owners to use lock task" 2018-01-24 17:07:17 +00:00
TreeHugger Robot
d12ad36399 Merge "Add broadcast when notification block state changes" 2018-01-24 15:03:22 +00:00
Vladislav Kuzkokov
fef75eee1d Fix Printing policy in profile owner.
Sometimes app inside profile can't get package info for its owner.
Instead of relying on calling user id, we make PrintManagerService switch to
system id and pass user that called print() explicitly.

Bug: 72309652
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPrintingPolicy
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testPrintingPolicy
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedProfileOwnerTest#testPrintingPolicy
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ib97018f56693549fbca506dba6efaadb6dd010b3
2018-01-24 15:24:08 +01:00
Oscar Key
9712788a06 Merge "Let the transport ask for non-incremental backup." 2018-01-24 13:51:26 +00:00
Adrian Roos
0d2d90d221 Merge "FRP: Explicitly throw UnsupportedOperation when FRP is not supported" 2018-01-24 11:56:32 +00:00
TreeHugger Robot
449e7d62a5 Merge "Implement activity --proto --processes" 2018-01-24 07:21:35 +00:00
TreeHugger Robot
192e0870b3 Merge "Add APIs to manipulate Override APN." 2018-01-24 06:54:17 +00:00
TreeHugger Robot
c1ac0355ce Merge "Fixing bugs in Notification proto dumping." 2018-01-24 06:24:29 +00:00
yuemingw
e3d9c099e5 Add APIs to manipulate Override APN.
Add APIs to add, update, query and remove Override APN. Add APIs to enable
Override APNs or query if Override APNs are currently enabled.

Bug: 68208301
Test: cts test in b/68208416

Change-Id: I65ebbb948d2ac4e31a73e1e761e32dc8ba1502c3
2018-01-24 06:13:57 +00:00
TreeHugger Robot
21d7f24efa Merge changes Idd092c44,I85f7686e
* changes:
  Indication area alignment in AOD
  Fix alignment of ambient notificaiton
2018-01-24 05:15:44 +00:00
TreeHugger Robot
c7904e1d05 Merge "Keep history of standby bucket changes." 2018-01-24 04:33:46 +00:00
TreeHugger Robot
064f16638b Merge "Add API to expose signing certificate proof-of-rotation." 2018-01-24 03:00:27 +00:00
Jason Parks
3c13b64267 Allow unaffiliated Profile Owners to use lock task
Bug: 64948750
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ib775161dd62c819e7975744eaa074fc60d9a6b1b
2018-01-23 20:57:34 -06:00
Amith Yamasani
bfc4bf5feb Keep history of standby bucket changes.
Push standby bucket changes into UsageStats as events.
Don't use the event for aggregation.

Bug: 63527785
Test: atest CtsUsageStatsTestCases:UsageStatsTest
Change-Id: Icd152b21935e3ef73aaa1a62f09574e51ce921bd
2018-01-23 18:34:34 -08:00
Lucas Dupin
90158d0a5c Fix alignment of ambient notificaiton
Change-Id: I85f7686e1e09d266308f00570bed6ae6b3eaa4a5
Fixes: 71769708
Test: visual
2018-01-23 18:20:50 -08:00
Yi Jin
148d7f4291 Implement activity --proto --processes
Bug: 66729158
Test: out/host/linux-x86/bin/incident_report -w amprocesses
Change-Id: Iae043203bca954bfc4aadad0460cc56621e9ba05
2018-01-23 16:49:58 -08:00
Jason Monk
f7be12dc75 Merge "Expose permission-related Slice APIs" 2018-01-23 23:41:58 +00:00
Sudheer Shanka
811c3765be Merge "Add DPM API to block apps from using metered data." 2018-01-23 23:02:40 +00:00
Jason Monk
d71d0fc508 Merge "Remove old slice APIs for color" 2018-01-23 23:01:54 +00:00
Kweku Adams
bc84aecc76 Fixing bugs in Notification proto dumping.
Also changing method signatures to be more in line with our convention.
Based on some of the changes I went through, it looks like:
1. We were only legitimately saving the very last NotificationRecord
that was dumped.
2. We weren't dumping any NotificationChannels into
NotificationChannelGroup protos.

Bug: 65750824
Test: Android builds
Change-Id: I8c1ef90cf69d8ea00a7bad0c67445741056e23ef
2018-01-23 13:36:23 -08:00
Roberto Perez
c4788e1f04 Merge "Adding a new category to mark car-optimized launcher activity" 2018-01-23 18:21:59 +00:00
Neil Fuller
ee33ac4bd2 Merge "Improve dumpsys for installed distros" 2018-01-23 17:54:29 +00:00
Chris Craik
6faa9e50e5 Add requireViewById
Bug:69461327
Test: atest android.view.cts.ViewTest android.view.cts.WindowTest android.app.cts.DialogTest
Test: make offline-sdk-docs

Didn't add require versions of #onFindViewById in
FragmentContainer/FragmentHostCallback since they're deprecated

Change-Id: I4231e318c92a39cfb82ab1ef8769ade2775d5e3e
2018-01-23 09:44:00 -08:00
Oscar Key
f5b99ad2ea Let the transport ask for non-incremental backup.
Add a new performBackup() return code TRANSPORT_PACKAGE_DATA_LOST. If
the transport returns this then delete the state for the package and
immediately retry it. Thus the retry will be a non-incremental backup.

I have left the new constant as @hide to unblock this change. I will add
this to the current API review change: ag/3477872.

Bug: 71887023
Test: I tested manually by returning the new code for both @pm@ and
other key value packages. No automated test exists for this file, and it
will be tricky to add this before IC.

Change-Id: I4357a8b297c373eb81e25afb82d480b26f6642b6
2018-01-23 17:16:28 +00:00
Jorim Jaggi
15e76d620a Merge changes I2b6bfca0,I9a854d43
* changes:
  Add option to retrieve pending intent result
  Fix issue with permission check for shortcuts and pendingIntent
2018-01-23 17:14:03 +00:00
Daniel Cashman
5cdda3425c Add API to expose signing certificate proof-of-rotation.
With the addition of APK Signature Scheme v3, the platform now can
support key rotation by using the proof-of-rotation provided by the
new scheme.  Create a new API which allows checking of the entire
provided history of an APK's signing certificates, not just the
current signer.  This should allow for changes of APK signing
certificates without fear of losing access to resources that would
have been provided under the old signing certificate.

Change getPackageInfo(GET_SIGNATURES) to return the oldest signing
certificate in the chain so that apps which do programmatic checks,
but are not updated to use the new API, still get the same information
they would have gotten had there been no rotation.

Bug: 64686581
Test: Builds, boots.
Change-Id: I8982fd4cce60f5d85a6180d157a6e2a661b1a6d7
2018-01-23 09:10:13 -08:00
TreeHugger Robot
4953824b89 Merge "Fix registerSliceCallback to match api guidelines" 2018-01-23 16:38:16 +00:00
Geoffrey Pitsch
88f3d4dbe1 Security model for moving sharesheet to systemui
ResolverActivity (still in frameworks) now requests a "permission token"
that it hands to a stubbed system ui activity ChooserActivity.

This permission token allows an app (SysUI) with the signed permission
"START_ACTIVITY_AS_CALLER" to call
ActivityManagerService#startActivityAsCaller. Permission tokens are a
one-time use, limited-time offer.

Test: runtest systemui && manual testing
Bug: 69850752
Change-Id: I3600e1a8ff9eea7397f5f59853423c79b6401f98
2018-01-23 10:23:55 -05:00
Jason Monk
e0bba99c94 Merge "Remove slice: from SliceProvider docs" 2018-01-23 14:24:35 +00:00
Adrian Roos
b237594777 FRP: Explicitly throw UnsupportedOperation when FRP is not supported
Changes KeyguardManager.createConfirmFactoryResetCredentialIntent such that
it throws UnsupportedOperationException when credential-based FRP is not
available on the device (either because storage was corrupted, or the device
simply does not support it).

This allows GMScore to distinguish this case from when the previous owner
simply didn't set up security.

Also fixes a few places where we previously unintentionally crashed with an
NPE.

Bug: 72368658
Test: atest LockSettingsStorageTests
Change-Id: I92fe1d4b06834e76a4bfffad41276ca28c68ce70
2018-01-23 15:06:50 +01:00
Julia Reynolds
fc9767b845 Add broadcast when notification block state changes
At the app level, to match channel and group broadcasts.

Test: runtest systemui-notification
Bug: 63927402
Change-Id: If6bf8b468f90fe5ed225ea136425104a418d4974
2018-01-23 09:04:30 -05:00
TreeHugger Robot
2c78c181e7 Merge "Track the most recent notifying packages" 2018-01-23 13:56:24 +00:00
Jorim Jaggi
e2ad37f9bc Add option to retrieve pending intent result
Used by SystemUI to check whether an activity start will
actually lead to something animating.

Also fixes an issue where we return MOVED_TO_FRONT instead of
DELIVERED_TO_TOP.

Test: go/wm-smoke
Test: Use PendingIntent.sendAndReturnResult
Change-Id: I2b6bfca0a53125635bc462f32ab7eaae366c0c8a
2018-01-23 14:40:28 +01:00
Adam Lesinski
68d10d00a5 Revert "Make idiomatic use of ApkAssets and AssetManager"
This reverts commit c857766ca5.
2018-01-23 03:17:01 -08:00
Adam Lesinski
1f62f7c72e Merge changes from topic "assetmanager-refactor"
* changes:
  libandroidfw: Improve performance of AssetManager2
  libandroidfw: Add ApplyStyle and SetConfiguration benchmark
  Make idiomatic use of ApkAssets and AssetManager
  Replace AssetManager with AssetManager2 implementation
2018-01-23 05:28:11 +00:00
TreeHugger Robot
060ac9bc9f Merge "Fixed Messaging style with empty senders" 2018-01-23 05:23:23 +00:00
Lorenzo Colitti
2899a0ed1b Merge "Support passing a template to NetworkStatsManager queries." 2018-01-23 04:02:58 +00:00
Sudheer Shanka
04d61ae6c3 Add DPM API to block apps from using metered data.
Bug: 63700027
Test: cts-tradefed run singleCommand cts-dev -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetMeteredDataDisabled
Test: cts-tradefed run singleCommand cts-dev -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.MixedProfileOwnerTest#testSetMeteredDataDisabled
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest#testSetGetMeteredDataDisabled
Change-Id: I147399d316f375c68b415dc6ede837c53cd1aad0
2018-01-22 19:33:09 -08:00
Selim Cinek
2dd3e72ac0 Fixed Messaging style with empty senders
Empty senders were treaded badly before, leading to empty
space and a bad layout. Now the conversation title is taken
as the name of the other sender.

Bug: 63708826
Test: add message with empty senders, observe layout
Change-Id: I6d3ce84c421ddbcd55260f34e8ff5bf46437c2b6
2018-01-22 18:57:14 -08:00
TreeHugger Robot
83178bc099 Merge "Allow Recents in current user to access APIs in its child profile" 2018-01-22 22:09:19 +00:00