Commit Graph

15599 Commits

Author SHA1 Message Date
Philip P. Moltmann
c073e956dc Mark getProfileOwnerAsUser(int) as UnsupportedAppUsage again
As it was in P. There are no public APIs created, hence there is no
better, _public_, alternative.

Fixes: 135282729
Test: none
Change-Id: I199cfcc125f948b983eb55a199abf673cc58b7e1
2019-06-14 14:09:35 -07:00
Andrew Solovay
b230dd4fe6 Merge "docs: Fixing broken HTML" into qt-dev 2019-06-10 18:23:40 +00:00
Andrew Solovay
7ad2170f4e docs: Fixing broken HTML
A couple of broken </code> tags were messing up the formatting
for the entire page (see b/134696600 , http://screen/aThdcpoDvJo.png )

Staged the fixed doc to:

http://go/dac-stage/reference/android/app/Activity

(The live version of this doc has already been fixed -- I fixed
the HTML by hand in cl/251937759 -- but we need to fix the Java
comment, or the file will revert when we publish beta 5.)

Bug: 134696600
Test: make ds-docs (& staged HTML output)
Exempt-From-Owner-Approval: Docs-only fix
Change-Id: I7e6d11ca358d747cdc6d04741d31c7acd85aa080
2019-06-07 14:14:04 -07:00
Eugene Susla
fa5fb1f661 Add timeout for setPermissionGrantState
Fixes: 134380096
Test: presubmit
Change-Id: Ifff243068eea2637cf8f6391b52a4c53bc544615
2019-06-07 12:56:47 -07:00
Adam Bookatz
14a34b9efb Merge "loadUnbadgedItemIcon doesn't crash from getUserIcon" into qt-dev 2019-06-06 17:54:24 +00:00
Antoan Angelov
dad55ca4fe Merge "Update docs for EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS." into qt-dev 2019-06-05 14:17:39 +00:00
Bookatz
9313af68c2 loadUnbadgedItemIcon doesn't crash from getUserIcon
AppicationPackageManager.loadUnbadgedItemIcon would call
UserManager.getUserIcon if the icon was supposed to represent
switching to another the parent user (from a work profile).
However, that call requires extra permissions which may not be
available, which would cause a crash. The work profile doesn't
generally have permission to see the parent's icon, so rather
than showing the actual icon, a generic user icon is shown instead.

Bug: 134177607
Test: Manual confirmation: create a work profile and try to share a
picture (from Photos) to the personal profile.

Change-Id: Id79ca50b8e0a26593addbacf1a0ea709a2bc4da2
2019-06-05 03:03:24 +00:00
TreeHugger Robot
57854d3b90 Merge "Post finishing after transition in onBackPressed" into qt-dev 2019-06-04 19:11:52 +00:00
Alan Stokes
9e2457622a Cleanup background activity starts for release.
This removes the parts of the feature that were only needed in beta
releases:
- Toast when a start is or would be blocked.
- Configurable whitelist of exempt apps.
- Global setting to disable.

Not to be submitted until after beta 5 is cut.

Bug: 131747138
Test: atest BackgroundActivityLaunchTest
Test: atest RootWindowContainerTests
Test: atest WmTests:ActivityStarterTests
Test: atest CtsWindowManagerDeviceTestCases:ActivityStarterTests
Test: atest CtsAppTestCases:.ServiceTest

Change-Id: I3d8b9c72c8fac86b93ac57a8a1988f4133043af8
2019-06-04 14:26:00 +00:00
TreeHugger Robot
a54b943d59 Merge "Fix a bug about missing onConfigurationChanged" into qt-dev 2019-06-03 18:09:34 +00:00
arangelov
f59d691da2 Update docs for EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS.
Bug: 134391678
Test: none
Change-Id: I7c88200470163b0ec07f345727cfd85ec4d8b96e
2019-06-03 18:05:51 +01:00
TreeHugger Robot
ae76af46b2 Merge "Prevent double teardown of service connections" into qt-dev 2019-05-31 17:27:34 +00:00
TreeHugger Robot
26a28f64c5 Merge "Remove @VisibleForTesting from DevicePolicyEventLogger getters." into qt-dev 2019-05-30 15:05:26 +00:00
arangelov
3b37af4c3c Remove @VisibleForTesting from DevicePolicyEventLogger getters.
Also make it extendable for mocking and update atoms.proto comments.

Bug: 131833599
Test: compiled
Change-Id: I6a0e8a6175e7e9e46572ea4aa50ce7669a02588b
2019-05-30 14:40:12 +01:00
Christopher Tate
36c998c6b7 Prevent double teardown of service connections
Asynchronicities in activity teardown -> service connection teardown
introduced a race in which the teardown could race with new service
bindings to "the same" service instance, and then wind up attempting to
shut down a new, valid instance inappropriately.  Fixed by making sure
to clear the "what needs to be torn down" bookkeeping as part of the
act of doing that teardown, removing the possibility for stale state.

Fixes: 131029480
Test: manual
Test: atest CtsAppTestCases
Change-Id: I33a63f524d147ff6ec97dd3efb0127dcace8bf3c
2019-05-29 18:46:09 -07:00
Tiger Huang
968064bed0 Fix a bug about missing onConfigurationChanged
The original logic sends the new configuration to the non-activity
components only if there is any public field changed. However, it
doesn't use the latest configuration to compare to the current one,
which caused ActivityThread dropping some onConfigurationChanged
callbacks.

This CL uses the latest configuration to compare to the current one.

Fix: 132653657
Test: Steps in the bug
Change-Id: I969ef189c36ba1903503d8b7de5641103aed8cf3
2019-05-28 07:29:56 +00:00
Rubin Xu
6cf5ea63eb Merge "Fix deadlock in KeyguardDisableHandler" into qt-dev 2019-05-27 19:50:06 +00:00
TreeHugger Robot
98876f0727 Merge "Handling race condition when dumping heaps." into qt-dev 2019-05-25 01:24:39 +00:00
Andrei-Valentin Onea
71a267b66f Merge "Move blacklisted methods back to greylist" into qt-dev 2019-05-24 12:02:31 +00:00
Kweku Adams
4af1b5084b Handling race condition when dumping heaps.
1. The IPC to ActivityThread.dumpHeap() dups the input file descriptor but
closes it when the IPC returns. Since the heap dump is generated
asynchronously, a race condition ensues between the returning close and
the dump being generated. For the intra-system-process call, the race is
with ActivityManagerService closing the created file descriptor. Duping
the file descriptor on the ActivityThread side should deal with this.
2. For some reason, the file descriptor wasn't closed for native heap
dumps. Closing the fd in those cases as well.
3. Catch the RuntimeException from Debug.dumpHprofData in case anything
else was missed.

Bug: 133424499
Test: adb shell am dumpheap com.android.systemui
Test: adb shell am dumpheap system
Test: Use the "Capture System Heap Dump" option in Developer Settings
Change-Id: I44817161533359766250de04e35902587ea9cc40
2019-05-23 16:23:48 -07:00
Sudheer Shanka
c0ff908a40 Trigger a mediascan when downloads get renamed.
Fixes: 132811564
Test: manual
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: I319a5b45e703b1eda5846d085c5e1e1e86bbae2b
2019-05-23 10:47:30 -07:00
Mady Mellor
9d662c0f0a Post finishing after transition in onBackPressed
Test: manual - hit back in app & bubbles & when you get a phone call in
      start up wizard
Bug: 132353272

Change-Id: I8bfb868e8e165adb2fa51b6cda1e9afe237d154c
2019-05-23 07:09:18 -07:00
Rubin Xu
13531ccab8 Fix deadlock in KeyguardDisableHandler
At the moment KeyguardDisableHandler calls into DevicePolicyManager
to retrive the aggregated password quality for the current user
while holding the WindowManager lock. This is a lock inversion
and causes deadlock. To fix this, introduce a per-user password quality
cache in DevicePolicyCache and switch KeyguardDisableHandler
to use that instead.

Test: manual
Fix: 129087668
Change-Id: I8c02ca442dde76ed350f22ac04a52adc82d21d00
2019-05-23 11:27:11 +01:00
Sudheer Shanka
4344e7c721 Merge "Don't use linked mediastore uris in DownloadProvider operations." into qt-dev 2019-05-22 02:20:08 +00:00
TreeHugger Robot
7aa28bd502 Merge "Minor improvements on voice interaction workflows." into qt-dev 2019-05-21 21:05:41 +00:00
Sudheer Shanka
1b817f65db Don't use linked mediastore uris in DownloadProvider operations.
When MediaProvider db gets recreated, all the media content ids
get renumbered. It's possible that when DownloadProvider is
trying to delete an entry, it is holding onto a invalid mediastore
uri. So, don't use linked mediastore uris in DownloadProvider
operations. Also, revoke any prior uri grants of media content from
DownloadStorageProvider.

Bug: 132087334
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java
Change-Id: I4885f5a0ae0b3ab660426605a8a43b8c1d66a4c7
2019-05-21 10:21:43 -07:00
Andrei Onea
2bbb6542f7 Move blacklisted methods back to greylist
These methods used to be greylisted, but have been either accidentally
or prematurely added to blacklist.

Test: m
Bug: 133207859
Change-Id: I0f73828956d0c5e4b1c147580bb11c8073c3461b
2019-05-21 18:13:26 +01:00
TreeHugger Robot
70e0438d59 Merge "Force system ApplicationInfo update and notify DisplayManager" into qt-dev 2019-05-20 19:12:20 +00:00
TreeHugger Robot
b46293f8f6 Merge "Adds setCornerRadius to ActivityView & SurfaceView" into qt-dev 2019-05-20 16:30:20 +00:00
Philip P. Moltmann
4f09b09f62 Merge "Whitelist all perms on installExistingPackage" into qt-dev 2019-05-17 19:56:19 +00:00
Mark Renouf
34d04f36c3 Adds setCornerRadius to ActivityView & SurfaceView
Applies corner radius to Bubbles when expanded, based on
dialogCornerRadius theme attribute.

Test: manual -- Enable Bubbles, add one and expand, observe corners
Bug: 123545569
Change-Id: I88162a974534786b4ac8bed4e0fa1302bded9096
2019-05-16 11:22:25 -04:00
Rubin Xu
8c10c28673 Merge "Do not compare ID when deduplicating SecurityEvent" into qt-dev 2019-05-16 11:17:48 +00:00
Michael Wachenschwanz
a324083f3d Merge "Clarify UsageStatsManager#queryUsageStats behavior" into qt-dev 2019-05-16 06:18:48 +00:00
Felipe Leme
ada5184574 Minor improvements on voice interaction workflows.
Bug: 131411751
Fixes: 132783948

Test: atest CtsVoiceInteractionTestCases CtsAssistTestCases

Change-Id: I28c8577caa35a783863f4313487c6e9b9abc8ff2
2019-05-15 22:40:38 +00:00
Philip P. Moltmann
a4bd150588 Whitelist all perms on installExistingPackage
The code allows to also whitelist only a select set of permissions, but
this is not yet exposed in the API.

Also: Fix up shell commands for restricted permissions

Fixes: 132368462
Test: - Enabled app via device admin in secondary profile
        -> verified that permissions were whitelisted
      - Installed existing and new app using --restrictpermissions and
        not
	-> verified that permissions were whitelisted or not
      atest AppRestrictionsHelperTest
            RestrictedPermissionsTest
Change-Id: I9cd76c555b40663f2e25ad86e8a54991baae346c
Merged-In: I9787e63d8beb8f6b1ba2d15532d4c0f69dbdf863
2019-05-15 11:09:45 -07:00
Rubin Xu
17d08f474c Do not compare ID when deduplicating SecurityEvent
Two SecurityEvents should be considered identical as long as
their event content equals, disregarding the id field.

Test: manual
Change-Id: I811f9a104ed3a0d9e02991aeb9e3653c5c02efc3
Fix: 132367517
2019-05-15 17:39:46 +01:00
Ian Pedowitz
3bd719b534 Merge "Revert "Revert "Remove deprecated System APIs added in Q.""" into qt-dev 2019-05-15 16:28:54 +00:00
Lei Yu
35fcd6b0e3 Merge "Use merged NetworkTemplate to query data usage" into qt-dev 2019-05-15 00:27:23 +00:00
TreeHugger Robot
aa6965983b Merge "Fixed NPE on VoiceInteractor.destroy()" into qt-dev 2019-05-14 20:27:44 +00:00
Felipe Leme
8092cdaeda Fixed NPE on VoiceInteractor.destroy()
Fixes: 131411751
Test: atest CtsVoiceInteractionTestCases # ran a few times on different devices, got no failures

Change-Id: I484db53772bf503f091f30f67ae92c8ae52d4105
2019-05-14 10:15:31 -07:00
TreeHugger Robot
3245017b87 Merge "Using ParceledListSlice to send large lists over Binder." into qt-dev 2019-05-14 16:25:28 +00:00
Suprabh Shukla
169bed7b7a Revert "Revert "Remove deprecated System APIs added in Q.""
This reverts commit 79a19effee.

Bug: 129975435
Change-Id: I113c87f8c0b7ab225e4b99ef2462ae12e199b816
2019-05-13 21:04:39 +00:00
TreeHugger Robot
2d976f9b3d Merge "Fix typo." into qt-dev 2019-05-13 19:31:34 +00:00
Lei Yu
c00a30eb8a Use merged NetworkTemplate to query data usage
This CL uses merged NetworkTemplate so that it shows correct
data for carrier which is a virtual that has multiple
subscriberId under the hood.

By doing this, this CL also adds several hidden API so settings
can query by NetworkTemplate directly.

Fixes: 120566366
Test: RunSettingsLibRoboTests
Change-Id: I8b747697933c75b48b14387adafb5ac9ca165926
2019-05-13 11:42:23 -07:00
TreeHugger Robot
895d5c546c Merge "DO NOT MERGE: Delete persisted historical app ops on package uninstall" into qt-dev 2019-05-11 00:09:22 +00:00
TreeHugger Robot
9af275a752 Merge "Clarify required/optional fields in BubbleMetadata." into qt-dev 2019-05-10 22:22:37 +00:00
TreeHugger Robot
1a91f0ddf3 Merge "Document non-effective mode return of AppOps batch fetch" into qt-dev 2019-05-10 21:25:32 +00:00
Michael Wachenschwanz
d1e659be25 Clarify UsageStatsManager#queryUsageStats behavior
Fixes: 67037735
Test: n/a
Change-Id: I02f90f9ae93257dbe883710288a7a35ba87e1f26
2019-05-10 14:20:32 -07:00
Winson
4e3b435c0e DO NOT MERGE: Delete persisted historical app ops on package uninstall
They're removed from the current state, but not the persisted state.

This adds HistoricalRegistry#clearHistoryForPackage which reads the
disk state, strips the corresponding UID/package, and re-writes
to disk.

Bug: 129796626

Test: manual test app with location access
Test: atest AppOpsServiceTest#testPackageRemovedHistoricalOps

Change-Id: I8daa2e3474b400a3789b2eaf178441c6d1578af1
2019-05-10 19:24:02 +00:00
TreeHugger Robot
04d00184cc Merge "Null check ApplicationInfo for ApplicationPackageManager#loadUnbadgedItemIcon" into qt-dev 2019-05-10 18:46:49 +00:00