Commit Graph

17769 Commits

Author SHA1 Message Date
Beverly Tai
78a66d6c36 Merge "Add badge colors for dark theme" into rvc-dev 2020-05-10 18:10:15 +00:00
Beverly
2b4306a8ec Add badge colors for dark theme
Test: manual
Test: atest UserManagerTest#testProfileTypeInformation
Fixes: 149669756
Change-Id: Ib3fd377a4902bbe936d574dc52bac4eae6e25dd4
2020-05-07 09:20:19 -04:00
Hui Yu
a6099ac785 Merge "Revert "Add isUidActiveOrForeground() for camera/audio to use."" into rvc-dev 2020-05-06 16:59:34 +00:00
Marco Ballesio
ce9b47859d Merge changes from topic "developer option for app freezer" into rvc-dev
* changes:
  Resources and strings for freezer settings
  Settings option to enable/disable the app freezer
  ActivityManager API to check availability of app freezer
2020-05-06 16:35:44 +00:00
Galia Peycheva
95f8aba25e Merge "Add isDreaming method to DreamManager" into rvc-dev 2020-05-06 08:18:19 +00:00
Marco Ballesio
240bea3f47 ActivityManager API to check availability of app freezer
A method to verify the availability of the app freezer is required for
configuration code running in places like the Settings app

Bug: 155465196
Change-Id: I5779d263536091689a099eec0815f207dfbbf6ad
Test: verified its workings through the developer options CL
2020-05-05 15:22:43 -07:00
Galia Peycheva
e1903416bb Add isDreaming method to DreamManager
This CL adds isDreaming to DreamMaanger and changes the way it starts a
dream to use IDreamManager.dream()

DreamManager is only used for testing. So far it has been using the
DreamManagerInternal.testDream() API to start the dream. This restricts
the amount of verification that can be done in the dream tests because
it doesn't put the device in a dreaming state -
IDreamManager.isDreaming() is always false.
IDreamManager.dream() puts the device in a dreaming state and enables
better testing.

Bug: 152994058

Test: atest DreamManagerServiceTests
Change-Id: Id4d947e83eabcafa9724764b8d063357c5f2cb49
2020-05-05 21:59:24 +02:00
Adam Bookatz
182862e595 Listener to watch op starts
Currently, there is
onOpNoted - tells listeners that noteOp has occurred
onOpActiveChanged - tells listeners that an op's 'active' state has
changed, i.e. that a successfull startOp or stopOp has happened

There was, however, no way of telling a listener that a startOp has
happened (regardless of whether it was successful). This cl introduces
it, via a OnOpStartedListener.

This is required by the ForegroundServiceAppOpSessionEnded atom,
which counts the number of accepted vs. rejected attempts, and
therefore also needs to know when a rejected start happened.

This cl also contains some cosmetic moving of code so that
startOperation() and noteOperationImpl() are almost
exactly parallel.

* Also *
This cl fixes a bug I discovered in stopWatchingNoted, in which
the callback wasn't fully removed. Consequently, if a callback
was unregistered and then re-registered, the re-registration would
mistakingly be ignored (in direct contradiction to the javadoc).

Test: atest UidAtomTests#testForegroundServiceAccessAppOp
Test: atest AppOpsStartedWatcherTest AppOpsActiveWatcherTest AppOpsNotedWatcherTest
Test: manually monitor: adb shell cmd stats print-logs && adb logcat -v uid -s statsd | grep "statsd  : {" | egrep '\(256\)'
Bug: 152800926
Change-Id: Icdb9edf6b2b7c5807b339c1aabb32e882190b071
2020-05-04 21:59:29 +00:00
Hui Yu
3e376ab5d1 Revert "Add isUidActiveOrForeground() for camera/audio to use."
Revert "Add isUidActiveOrForeground for camera/audio to use."

Revert submission 10829580-isUidForeground

Reason for revert: In CameraService.cpp, before this change, around "am.isUidActive", there was up to 300 ms retry. After this change, the code could move forward fast without retry, but at "mAppOpsManager->startOpNoThrow" call, for the same reason as uid is not updated fast enough, "mAppOpsManager->startOpNoThrow" could also fail.

This CL does not really fix the root cause, but it changes the timing and now the code fails at "mAppOpsManager->startOpNoThrow" call.

Also the timing change may also cause recent multiple CTS test failures.

Bug: 154570809, 155032617, 154849083


Reverted Changes:
Iffed63293:Add isUidActiveOrForeground() for camera/audio to ...
I3685e0c8d:Add isUidActiveOrForeground() for camera/audio to ...
I51ed1fe78:Add isUidActiveOrForeground for camera/audio to us...

Change-Id: I07cbf45949d14489404cb304c80c9ba4276ebe63
2020-05-04 18:07:16 +00:00
Andrew Sapperstein
975ca816ec Merge changes from topic "cherrypick-ctor-refs-03y8i58ine" into rvc-dev
* changes:
  Update inner class constructor refs to use proper syntax.
  Fix broken @see tags in public documentation.
2020-05-02 00:21:33 +00:00
Garfield Tan
abe5a4f3f5 Merge changes I702d89c9,Id7bfc3e6 into rvc-dev
* changes:
  Remove TaskRecordFactory.
  Notify when task changes requested orientation.
2020-05-02 00:10:29 +00:00
Darryl Johnson
ceb2befc1b Merge "Don't override activity display adjustments with app config" into rvc-dev 2020-05-01 23:05:10 +00:00
Garfield Tan
afa0de8a91 Notify when task changes requested orientation.
This allows listener know task's orientation request change before
handling display rotation through IDisplayWindowRotationController if
they can register a local TaskStackListener.

Bug: 150409355
Test: atest WmTests:TaskStackChangedListenerTest#testNotifyTaskRequestedOrientationChanged
Change-Id: Id7bfc3e63329ce26d454b7e9c143e084e04dd365
2020-05-01 12:52:46 -07:00
Andrew Sapperstein
88d565e7e7 Update inner class constructor refs to use proper syntax.
Previously, we generally required fully qualified names for referring
to inner class constructors (like #Notification.Builder()) despite that
not being valid javadoc. Now, we properly support #Builder() syntax and
the old syntax will error.

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
Merged-In: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
(cherry picked from commit 4c4aa41272)
2020-05-01 18:33:15 +00:00
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
Dianne Hackborn
f55fbde1bd Merge "Fix #155437855: "dumpsys activity" package filtering doesn't filter everything" into rvc-dev 2020-05-01 15:49:51 +00:00
Abodunrinwa Toki
1cf3ce8fde Merge "Rewrite Icons from the TCS." into rvc-dev 2020-05-01 10:52:43 +00:00
TreeHugger Robot
75c82108f6 Merge "Add the IME insets to virtual display for bubble" into rvc-dev 2020-05-01 03:58:14 +00:00
Dianne Hackborn
9106f2a73d Fix #155437855: "dumpsys activity" package filtering doesn't filter everything
Clean up various code paths to correctly use the "packageName" option to
limit its output to only information about that package.

Also do a little re-arranging of the output to cleanup a bit recent
stuff that was added, so the end of the output is still the important
high-level summary of process states.

Bug: 155437855
Test: manually inspected various "dumpsys activity" output.
Change-Id: I2ebe6f7ab3d433281993eb3959d375e2e53e0df9
2020-04-30 17:29:16 -07:00
Hongwei Wang
28c136e1cb Merge "Move PIP/MW mode callbacks to be on the client side" into rvc-dev 2020-04-30 23:38:56 +00:00
Mady Mellor
a0f44693f5 Merge "Enable flagging shortcuts to launch properly in a bubble" into rvc-dev 2020-04-30 21:52:11 +00:00
Darryl L Johnson
e810bc539e Don't override activity display adjustments with app config
When process configuration was applied on the client side it
accidentally applied an override to display adjustments in resources
for all ResourceImpl objects. This resulted in resources of
activities having incorrect display adjustments and reporting
incorrect display size.

This change fixes the issue by applying the activity's override
configuration on top of the app config before updating the
display adjustments.

Note: This is a slight revert/rework of Ib3ee007bc

Fixes: 148639826

Test: ActivityThreadTest#testHandleConfigurationChanged_DoesntOverrideActivityConfig
Change-Id: I08a5bc29443fbdefbca791240aeaff8f138b8756
2020-04-30 13:44:38 -07:00
Hongwei Wang
5711b8fdaf Move PIP/MW mode callbacks to be on the client side
We now infer the PIP/MW mode change from the new configuration.
Note also that both
- Activity#isInPictureInPictureMode
- Activity#isInMultiWindowMode
infer the current state from the configuration rather than querying
against the WM.

Also in this CL:
- When in removePinnedStackInSurfaceTransaction, keep the pinned stack
hidden till the windowing mode is set to fullscreen, this is to surpress
the attempt to set the activities to be started in reparenting
- When in ActivityRecord#shouldBeVisible, should take account the force
hidden flag, which is not actually in use before

Bug: 144097203
Bug: 142282126
Bug: 138329093
Test: atest ActivityLifecyclePipTests \
            ActivityLifecycleSplitScreenTests \
            ActivityLifecycleTopResumedStateTests \
            PinnedStackTests \
            SplitScreenTests \
            ActivityTaskManagerServiceTests \
            RecentsAnimationTest \
            AssistantStackTests \
            StartActivityTests \
            ActivityVisibilityTests \
            MultiDisplaySecurityTests \
            MultiDisplaySystemDecorationTests
Change-Id: Ibe032b5e50ba5c6d6bc44ebb54d07ac974ebe656
2020-04-30 08:48:09 -07:00
Yunfan Chen
b83940c9e7 Add the IME insets to virtual display for bubble
This patch will add a fake IME window to virtual display when IME is
showing and covering a bubble window. Without the fake window, the
bubble will not receive the correct IME insets.

To do that, this patch:
1. Added an interface in ActivityView to get VirtualDisplay when needed,
   in order to create the display context.
2. Modify the visibility update. When the target is not a client
   controlled target, we ignore the client visibility. We also call
   visibility update when the control target updated.
3. With the modified infra, add the window with correct param and
   context.

Bug: 150780413
Test: atest WmTests:DisplayPolicyLayoutTests
Test: atest InsetsStateTest
Test: atest InsetsPolicyTest
Test: go/wm-smoke
Test: See reproduce steps in the bug

Change-Id: I52691b5c7f81261de580bb4fc762e88486e78141
2020-04-30 16:21:11 +09:00
Darryl Johnson
77fae23490 Merge "Add test to ensure virtual display orientation doesn't change when device rotates." into rvc-dev 2020-04-30 00:18:02 +00:00
Todd Kennedy
aeb383ec87 Merge "Add documentation for OPSTR_LOADER_USAGE_STATS" into rvc-dev 2020-04-29 22:27:55 +00:00
Todd Kennedy
0f00675d74 Add documentation for OPSTR_LOADER_USAGE_STATS
Fixes: 150219240
Test: None. Doc only change
Change-Id: I6b156acd49acf95b34ecacff6d252b7ccab6303a
2020-04-29 09:37:10 -07:00
Mady Mellor
cf8ab8447e Merge "Fix CTS" into rvc-dev 2020-04-29 14:33:36 +00:00
TreeHugger Robot
447914fcfe Merge "Add RoleControllerManagerTest." into rvc-dev 2020-04-29 05:56:34 +00:00
Mady Mellor
a114b79392 Fix CTS
* fix BubbleExtractor tests to work with this & better
  test things now that the channel is a tristate

Test: atest NotificationManagerTest BubbleExtractorTest
Bug: 155025024
Change-Id: I8b75c1b0087ca79cea29741e32c7c524cb056d04
2020-04-28 20:06:03 -07:00
TreeHugger Robot
007a73c551 Merge "Don't remove OnAlarmListener mappings in the client" into rvc-dev 2020-04-29 01:09:32 +00:00
Suprabh Shukla
7d40780e39 Don't remove OnAlarmListener mappings in the client
Removing the mapping is prone to races in keeping the state consistent
with the server. An inconsistent state can lead to multiple alarms on
the server for the same listener.

Test: atest CtsJobSchedulerTestCases doesn't fill the alarm queue with
more than one alarm.
atest CtsAlarmManagerTestCases

Bug: 154444435
Change-Id: Iaf11d5decb17fbf2366b49d9865231bf65dbdc41
2020-04-28 15:37:21 -07:00
TreeHugger Robot
48f0527199 Merge "Close heap dump ParcelFileDescriptor." into rvc-dev 2020-04-28 20:52:29 +00:00
Darryl L Johnson
78d4e6dc7b Add test to ensure virtual display orientation doesn't change when
device rotates.

Bug: 148639826
Bug: 149213586

Test: ActivityThreadTest#testOrientationChangeDoesntOverrideVirtualDisplayOrientation

Change-Id: I74d5d9ad6d051e1059ca03102716319ac1b674a7
2020-04-28 13:38:01 -07:00
Mady Mellor
80d5ed1473 Enable flagging shortcuts to launch properly in a bubble
For things to work correctly in a bubble they must be
flagged to behave as documentLaunchMode=always

Test: atest NotificationManagerTest
Bug: 150719933
Change-Id: Ic5680c40fd2cbf0e9d0809a0a87a166f1e328c74
2020-04-28 13:24:03 -07:00
Hai Zhang
a39cf78c63 Add RoleControllerManagerTest.
Fixes: 155119713
Test: atest RoleControllerManagerTest
Change-Id: If90ba60cccbe1589365142a06d917a87b7a092ef
2020-04-28 12:14:01 -07:00
Julia Reynolds
49467eebac Update logging
Priority isn't used; shortcut is

Test: manual
Bug: 149651274
Change-Id: If6577c5588afe5e48787ae7e6bc528442fdb3423
2020-04-28 14:50:01 +00:00
Abodunrinwa Toki
8f2bf3cb53 Rewrite Icons from the TCS.
Because of the new app visibility constraints introduced in Android R,
apps may be unable to load icons from the TextClassifierService (TCS).
This is because the TCS returns "Icons" based on resources to the apps.
These resources were globally available until this new restriction.

In this CL, the TCMS rewrites responses with Icon(typ=RESOURCE) coming
from a TCS to responses with Icon(typ=URI). The new icons are backed
by a content provider that may be used to retrieve the necessary icons.

Bug: 151847511
Test: atest tests/tests/textclassifier/src/android/view/textclassifier/cts
Test: atest core/tests/coretests/src/android/view/textclassifier
Test: Select a phone number text, check that the "Call" icon shows
Change-Id: Ib63e54462508029cdf0e56c2c6a82ff4e81b02a8
2020-04-28 15:02:26 +01:00
Alex Johnston
a077a8a0cc Merge "Update setOrganizationColor javadoc" into rvc-dev 2020-04-28 08:36:57 +00:00
Chris Li
9859a326c1 Merge "Cache isSystemOrSystemUI on ContextImpl creation" into rvc-dev 2020-04-28 04:02:05 +00:00
Kweku Adams
f1ddecc60e Close heap dump ParcelFileDescriptor.
The file descriptor is only closed in certain situations. Explicitly
closing it to ensure we don't have any leaks.

Bug: 154277871
Test: take a system heap dump via developer options & and watch for StrictMode violation
Test: adb shell am dumpheap <system|another app> & and watch for StrictMode violation
Change-Id: I3ae3e270bcec18ba531055becfff32924c8f2a2d
2020-04-27 18:43:09 +00:00
Chris Li
e7f4f30698 Cache isSystemOrSystemUI on ContextImpl creation
When creating Context without a container Context, cache the value of #isSystemOrSystemUI().

Fix: 154161051
Test: atest FrameworksCoreTests:ContextTest
Change-Id: I1d16173c7da06a73d1338e3d6e75f5b56fcdbe23
2020-04-27 11:35:31 -07:00
TreeHugger Robot
756662fb2f Merge "Inform receivers of restart attempt previous visibility" into rvc-dev 2020-04-27 18:29:46 +00:00
Diego Vela
7c59c63943 Merge "Update Documentation for onActivityResult." into rvc-dev 2020-04-27 17:58:29 +00:00
Evan Rosky
8d1c24e0a5 Inform receivers of restart attempt previous visibility
This way receivers like recents know whether the activity
was already visible before a restart attempt.

Bug: 154575664
Test: added test. Can also launch a running activity into
      split-primary and it won't expand it.
Change-Id: If59ee1615fa36bbe3af9412194a7f96b9377528a
2020-04-27 09:13:31 -07:00
Diego Vela
6e99bfcd6c Update Documentation for onActivityResult.
Update doc to be more accurate about when onActivityResult is called

Bug: 140608415
Test: n/a
Change-Id: If44b02719e18b3107b064d749396d896bed08f86
2020-04-27 15:10:18 +00:00
Alex Johnston
6be8cda180 Update setOrganizationColor javadoc
Background
* In Android R, the UI of the work challenge was
  updated to latest material spec which no longer
  uses the organization color.

Changes
* Update javadoc of setOrganizationColor mentioning
  the organization color will no longer affect the
  work challenge starting from R.

Bug: 153607870
Bug: 153607569
Test: verify no build breakages
Change-Id: I071f544e4fba1915d810fa741dbc79966f9e72f4
2020-04-27 15:20:14 +01:00
Alex Johnston
c5e9a48db8 Merge "Add factory reset protection policy Test API to DPM" into rvc-dev 2020-04-27 11:04:46 +00:00
TreeHugger Robot
525fab26a1 Merge "Add back ActivityManagerService.onUserRemoved" into rvc-dev 2020-04-25 01:16:49 +00:00
Darryl Johnson
637fd24378 Merge "Revert "Try to reland Ib3ee007bc"" into rvc-dev 2020-04-25 00:37:46 +00:00