Commit Graph

17879 Commits

Author SHA1 Message Date
Michael Groover
2bcb70322c Merge "Update docs for methods that require subscriberId" into rvc-dev 2020-06-22 19:30:10 +00:00
Hongwei Wang
997150ee0a Merge "Updates enterPictureInPicture API doc" into rvc-dev 2020-06-22 18:14:10 +00:00
Stanislav Zholnin
7a65a7a37c Merge "Prevent developer provided strings from being uploaded through statsd." into rvc-dev 2020-06-22 08:10:52 +00:00
TreeHugger Robot
48e9dc67f1 Merge "Revert "Fix transition return issues when more than 1 level depth"" into rvc-dev 2020-06-22 03:04:37 +00:00
Jeff Chang
79f5a49b3c Revert "Fix transition return issues when more than 1 level depth"
This reverts commit 6d834d86fb.

Reason for revert: <http://b/159230864 WhatsApp image is visible after existing a chat>
Bug: 159230864

Change-Id: Ib266cff2e06a82ae9a0e85142ef80ae00328a040
2020-06-20 06:09:04 +00:00
Michael Groover
f4f6a7adac Update docs for methods that require subscriberId
In Android 10 additional restrictions were required to access the
subscriberId. The NetworkStatsManager has several methods that accept
a subscriberId of the mobile network for which usage should be queried.
This commit updates the docs for these methods to reference the new
access restrictions and offer null as an option to obtain the usage
for all mobile networks.

Fixes: 157871064
Test: m docs
Change-Id: I95c730c9418fced6312eb3ba4e0d69e6299f3ded
2020-06-19 19:48:07 -07:00
TreeHugger Robot
7ec25249ab Merge "Save AsyncOps for later forwarding instead of SyncOps." into rvc-dev 2020-06-19 21:29:40 +00:00
Stanislav Zholnin
456b496e4a Save AsyncOps for later forwarding instead of SyncOps.
Fixes: 159082266
Test: atest AppOpsLoggingTest
Change-Id: I3f8da9d7c2925233e5e53cfa7fd5e4cd1c258b29
2020-06-19 19:48:35 +01:00
Stanislav Zholnin
54762b293e Prevent developer provided strings from being uploaded through statsd.
- in situation when developer provides message when op is noted, do not
report it through stack trace collection infrastructure
 - collect only statcktraces for OP_FLAG_SELF and OP_FLAG_TRUSTED_PROXIED to
match collection of appops counts

Test: atest  android.app.appops.cts.RuntimeMessageCollectionTest
Fixes: 159433071
Change-Id: I1ab56a530832873a1f1f68aba5ab6eabc9e8a17a
2020-06-19 19:43:03 +01:00
Nikolas Havrikov
0cf1ad8495 Merge "Ensure mShowDialogs gets updated as part of global config update" into rvc-dev 2020-06-19 17:49:34 +00:00
Nikolas Havrikov
7771e6ebf5 Ensure mShowDialogs gets updated as part of global config update
The "App keeps crashing" dialog appears on Android TV even
though it should not. This would usually be accounted for
by setting mShowDialogs to false in the ActivityTaskManagerService
on boot. However, this does not happen because the service uses a
method of the ActivityTaskManager which pulls its configuration
from the context, which at this point is not yet updated to reflect
relevant values like the uiMode.

This change solves this problem by introducing an internal method
in the ActivityTaskManager, which acts on a given configuration
instead of the one from the context. This is helpful because the
caller ActivityTaskManagerService is holding on to the correct
configuration in the first place.

Furthermore, this change does not impact any outward-facing
behavior, nor does it introduce code duplication as the old
method of ActivityTaskManager new merely delegates its task
to the new one with the same configuration it would have
originally pulled from the context.

Test: Manually on ADT-3 device
Bug: 159019027
Change-Id: I0fac574a69a19243c2e62b967978ef5d8318ee51
2020-06-19 15:23:50 +02:00
Alex Johnston
2a02c8e381 Merge "Change behaviour of screen capture disabled" into rvc-dev 2020-06-19 12:20:38 +00:00
Alex Johnston
302c1fe947 Change behaviour of screen capture disabled
Background
* Historically, when the screen capture disabled
  policy was set on the personal profile, screen
  capture was disabled for the whole device
  (per-device).
* This should be changed to only be disabled in
  the personal profile (per-profile).

Changes
* Renamed DevicePolicyCache methods to setScreenCaptureAllowed
  and isScreenCaptureAllowed
* Added parameter ownerCanAddInternalSystemWindow to
  isScreenCaptureAllowed

Bug: 148453838
Bug: 157035400
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: If1bd68f0ec3e88497c5d3b4382977b526b2364ba
2020-06-18 22:58:28 +01:00
Evan Rosky
058a713a74 Merge "Use actual resizability for split-screen operations" into rvc-dev 2020-06-18 17:25:53 +00:00
Nikita Ioffe
663727472a Merge "Start OP_NO_ISOLATED_STORAGE on am instrument --no-isolated-storage" into rvc-dev 2020-06-16 20:17:29 +00:00
Shawn Lin
1c2e8eafff Merge "Fixed the conflict of the release methods of ActivityView & TaskEmbedder" into rvc-dev 2020-06-16 09:32:15 +00:00
Evan Rosky
889f49683f Use actual resizability for split-screen operations
Split-screen and activity-start were relying on resizeMode,
but that is what the activity requests vs how the system
actually treats a given task/activity. This caused some
inconsistencies in how non-resizable things were handled
when the developer option to force resizability was turned
on.

Also needed to fix an issue where non-leaf tasks would
get stuck with an out-dated intent. In particular, this
happened with the root HOME task which meant its
resizeMode could never change from that of FallbackHome.

Bug: 158514252
Test: enable force resizable in dev options and then launch
      camera into secondary split.
Change-Id: If06d047813315f39894bead19d2cbe0c9444f254
2020-06-15 19:57:55 -07:00
TreeHugger Robot
9ac716fc8b Merge "Properly handle situation when currentOpPackageName returns null." into rvc-dev 2020-06-15 20:06:31 +00:00
Stanislav Zholnin
9edce64ef2 Properly handle situation when currentOpPackageName returns null.
Fixes: 158309330
Test: adb shell content query --uri content://com.android.contacts/data --projection  contact_id:raw_contact_id:_id:display_name:last_time_used:data1:account_type:mimetype
Change-Id: I6c5d0c4fef150ba45721d474ac0f83778d543467
2020-06-15 17:28:33 +01:00
shawnlin
2806269a5a Fixed the conflict of the release methods of ActivityView & TaskEmbedder
There is a case in Bubble that we might release a un-initialized
TaskEmbedder while calling ActivityView.release() (ex. create a bubble
and don't expand it and then dismiss it) which will cause an exception.

Allow ActivityView.release() to be called at anytime and check the
initialization state before calling TaskEmbedder.release().

Bug: 155417004
Test: 1. Add bubbles and don't expands them then dimiss them
      2. Check logs.
Change-Id: I583ddd36f407c908cb63c109834940fc91c8d130
2020-06-15 15:47:14 +08:00
Jordan Jozwiak
7048655cbe Merge "DO NOT MERGE - Allow locking with feature or permission" into rvc-dev 2020-06-12 16:21:05 +00:00
TreeHugger Robot
a4c3cd425b Merge "Update javadoc for END_OF_DAY event." into rvc-dev 2020-06-11 22:11:50 +00:00
Nikita Ioffe
ac095e5a1d Start OP_NO_ISOLATED_STORAGE on am instrument --no-isolated-storage
This provides a signal for MediaProvider to whitelist access for full
external storage access.

Here is an overview of how the flow looks like:

1. When app is started within instrumentation with --no-isolated-storage
flag, ActivityManagerService will grant OP_NO_ISOLATED_STORAGE to that
package.
2. MediaProvider will note the OP_NO_ISOLATED_STORAGE app op as fallback
in case app doesn't have MANAGE_EXTERNAL_STORAGE permissions.
3. When instrumentation finishes, ActivityManagerService will change
mode of OP_NO_ISOLATED_STORAGE app op to MODE_ERRORED.

Test: atest ExternalStorageHostTest
Bug: 149894531
Change-Id: I51cd87e5e887b887fd8ac7a1a7ffff208266ffa8
2020-06-11 19:51:54 +01:00
TreeHugger Robot
0561690cac Merge "Apply theme shape clipping to group convo avatars" into rvc-dev 2020-06-11 18:22:46 +00:00
Alex Johnston
bde41fcacf Merge "Update setCameraDisabled javadoc" into rvc-dev 2020-06-11 11:33:19 +00:00
Steve Elliott
86bc69a491 Apply theme shape clipping to group convo avatars
Fixes: 158493588
Test: manual
Change-Id: I57b5e0712822b345c9dcce74b8a6d6ff33409de6
2020-06-10 15:23:33 -04:00
Alex Johnston
0589baeae9 Update setCameraDisabled javadoc
* DA targeting pre-Q will have this request
  silently ignored

Bug: 157212233
Test: build

Change-Id: I5b993443cdbcb2afed9f65c9d01063e7e1777842
2020-06-10 14:48:54 +01:00
Hui Yu
d507b3256e Update javadoc for END_OF_DAY event.
END_OF_DAY event has non-null packageName and null className.

Fix: 154842373
Test: NA
Change-Id: I3f225d459445db8416c822768f147f5b359c4ea4
2020-06-09 16:19:21 -07:00
TreeHugger Robot
6a28d69c24 Merge "Reduce "Failed to find provider info" logspam." into rvc-dev 2020-06-09 22:41:40 +00:00
Varun Shah
4bffd45f2f Reduce "Failed to find provider info" logspam.
If the user is not unlocked, log at the warning level instead of error
to reduce logspam from non-direct boot aware providers.

Fixes: 148747075
Test: manual (observe logs before and after user unlock)
Change-Id: Icd0fb23982a78fb413f329da93b2ce01d37aca2a
2020-06-09 13:39:53 -07:00
Hui Yu
cdfb1d6c30 Remove debug code before beta release.
Remove the debug code for feature:
1. Background started FGS while-in-use permission restriction
2. Foreground service type camera and microphone.

Bug: 158579189
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerApi29Test.java
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java
atest cts/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java

Change-Id: I9669db918af3740509a090c3075d93588110cea1
2020-06-09 10:36:57 -07:00
Hui Yu
c05fd22ce1 Merge "Add uid to PendingStartActivityUids when activity resumed." into rvc-dev 2020-06-09 05:01:28 +00:00
Hui Yu
08ab384989 Add uid to PendingStartActivityUids when activity resumed.
Previously we add uid to PendingStartActivityUids at activity start.
Now we also add uid to PendingStartActivityUids at activity resumed
because we can not wait for updateOomAdj() to be run by a runnable that
WindowManager send to DisplayThread at activity resumed.

At ActivityManagerService.getProcessStatesAndOomScoresForPIDs(), if the
ProcessRecord is in PendingStartActivityUids, we hard code the
ProcessRecord to be PROCESS_STATE_TOP and FOREGROUND_APP_ADJ, ahead of
result of updateOomAdj() the comes later.

Bug: 155143386, 157180494
Test: Reproduce steps of 155143386, swipe between GCA and
Snapchat, camera access is allowed after swipe.

Change-Id: Ia11b0e3400e4df851b250beb01dcfda43580668b
2020-06-08 15:35:26 -07:00
Joanne Chung
c6adc68368 Handle SyncResultReceiver.TimeoutException
1.Change SyncResultReceiver.TimeoutException to checked exception
2.Handle the SyncResultReceiver.TimeoutException in AutofillManager,
ContentCaptureManager, ContentSuggestionsManager
3.Fix the bug we should throw e.rethrowFromSystemServer()

Bug: 156044027
Test: atest CtsAutoFillServiceTestCases
Test: atest ContentSuggestionsManagerTest
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I959d2aca2b80866c076fae2520de66c123f5367d
2020-06-08 14:53:45 +08:00
Shawn Lin
c54d84a858 Merge "Add a @hide ctr to disable background layer in ActivityView & SurfaceView" into rvc-dev 2020-06-08 03:34:20 +00:00
Philip P. Moltmann
8083336a88 Merge "Make it clear that checking shouldShowPermissionRationale is recommended" into rvc-dev 2020-06-06 18:10:11 +00:00
Steve Elliott
05e10b59af Merge "Fix missing icon for one-to-one convos" into rvc-dev 2020-06-06 15:12:04 +00:00
Svetoslav Ganov
0ce4fba38f Merge "Correctly offset app op history on reboot" into rvc-dev 2020-06-06 14:50:03 +00:00
Stanislav Zholnin
c784a29dfd Merge "Keep unforwarded operation for noted ops." into rvc-dev 2020-06-06 14:12:38 +00:00
Stanislav Zholnin
e44f134adb Keep unforwarded operation for noted ops.
Align treatment of noted ops with AsyncNotedOps.

Fixes: 154775996
Test: atest AppOpsLoggingTest#disableCollectedAndNoteSyncOpAndCheckLog
Change-Id: I3dcd8275b6229946875bc184d25b18d2da76d5ba
Merged-In: I3dcd8275b6229946875bc184d25b18d2da76d5ba
2020-06-06 06:45:16 +00:00
Vinit Nayak
2983b70983 Merge "Pass displayId to onActivityRotation()" into rvc-dev 2020-06-05 18:58:32 +00:00
Ryan Mitchell
0053a10ea0 Merge "Use a ReferenceQueue to prune weak references" into rvc-dev 2020-06-05 18:27:50 +00:00
Svet Ganov
185ddf644b Correctly offset app op history on reboot
The offset was computed based off the offset represented by
the most recent historical file while we have to use the time
this file was written.

Also now we persist the history on reboot and shutdown,
significantly minimizing the possibility of data loss.

Added test API to emulate reboot of the history to allow for
precise and tightly controlled test to prevent flakes due to
boot time deviations.

Test: atest android.app.appops.cts.HistoricalAppopsTest#testRebootHistory

Fixes:156853195

Change-Id: I4142371f8bc2b1d710cc8c300e7e79cb03764c04
2020-06-05 09:55:27 -07:00
shawnlin
ba532aff3e Add a @hide ctr to disable background layer in ActivityView & SurfaceView
Bug: 152441717
Test: 1. Open bubble
      2. adb shell dumpsys SurfaceFlinger
      3. Check result
Change-Id: I3bda67bb56781eb75b51dc51f491a97efac7b4ef
2020-06-05 16:08:37 +08:00
Vinit Nayak
bedb9f33c2 Pass displayId to onActivityRotation()
Bug: 154580671
Change-Id: I220e1e9ac1a381c6ebadc3849a393225d1f53e3e
2020-06-04 17:15:32 -07:00
Jordan Jozwiak
9ead5a3c05 DO NOT MERGE - Allow locking with feature or permission
Instead of requiring the DEVICE_ADMIN feature, we accept either
the feature or the appropriate permission.

Bug: 133240910
Test: Manual testing
Verify that API executes when on a device without DEVICE_ADMIN
when the caller has the LOCK_DEVICE permission.

Change-Id: I30bd0dc81d9d7b7ed5503a926066caffb389b9c0
(cherry picked from commit 3cc489b7f3)
2020-06-04 19:21:31 +00:00
Steve Elliott
3d360da16d Fix missing icon for one-to-one convos
Fixes: 158089612
Test: manual
Change-Id: If588073ff1df557b755b844277e893e001822d79
2020-06-04 11:11:11 -04:00
Riddle Hsu
1421b3dace Merge "Override application display adjustments while launching activity" into rvc-dev 2020-06-04 06:20:45 +00:00
Vinit Nayak
38dbc97939 Merge "Add new callback for when activity rotates" into rvc-dev 2020-06-04 04:21:10 +00:00
Ryan Mitchell
a74111f81c Use a ReferenceQueue to prune weak references
Currently ResourcesManager iterates over all of its weak references to
Resources objects and calls Reference#get to determine if the object
has been garbage collected. This method of pruning WeakReferences
causes reference locks to be acquired in the native layer and causes
lock contention when "references are being processed" by the garbage
collector.

This change uses a ReferenceQueue to determine if a reference has been
garbage collected which should improve performance of
ResourcesManager#getResources when the system is under memory pressure.

By only removing garbage collected references when creating new
Resources objects, the lists grow larger and are periodically pruned
rather than attempting to prune entries from the list every getResources
invocation.

Bug: 157575833
Test: used debugger to observe pruning happening correctly
hange-Id: I3277e80edfa441d24de165e738d33c4fac6b4121
Change-Id: I3277e80edfa441d24de165e738d33c4fac6b4121
2020-06-04 00:47:35 +00:00