Commit Graph

7016 Commits

Author SHA1 Message Date
Louis Chang
d5c18447be Detects all activities for whether showing work challenge am: 69b3a3cd04
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14182408

Change-Id: I96c3433ccfb430ce9dae8c8b1459278f814221a3
2021-04-27 21:24:52 +00:00
Christopher Tate
3c507386ca DO NOT MERGE - Disallow deletion of channels with FGS notifications am: 88380a00d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13728411

Change-Id: I5c649a005fb5ad7bd904b64d03488a6be6ff30f7
2021-04-27 21:22:35 +00:00
Jonathan Scott
5af044fcf2 [RESTRICT AUTOMERGE] Use userId instead of USER_CURRENT in shouldLockKeyguard. am: bb4eded379
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13473565

Change-Id: I0ec616078dd0a5c2a0b99ad43d8d19169f3a2e1d
2021-04-27 21:16:05 +00:00
TreeHugger Robot
5079aa86c8 Merge "Add pkg target to snoozing alarm" into qt-dev am: 8e75c0526a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13676688

Change-Id: I284e21b4bd4fefb1f152e29de57b80aadfc46b1f
2021-04-27 21:14:18 +00:00
Louis Chang
69b3a3cd04 Detects all activities for whether showing work challenge
Work challenge did not show when a work activity is not on top, but
still visible after screen turns on.

Also show work challenge even if the work activity is behind a top
fullscreen activity of another profile because the user can still
navigate back to the work activity when top activity finishes.

Bug: 177457096
Test: RootActivityContainerTests

Change-Id: I5e09b09be547d04fdfd709cb9cd4bcd4a94bbf21
Merged-In: I5e09b09be547d04fdfd709cb9cd4bcd4a94bbf21
2021-04-19 09:21:55 +00:00
Chris Tate
7b0067c950 Merge "DO NOT MERGE - Disallow deletion of channels with FGS notifications" into qt-dev 2021-04-06 16:23:51 +00:00
Christopher Tate
88380a00d5 DO NOT MERGE - Disallow deletion of channels with FGS notifications
Bug: 156090809
Test: atest CtsAppTestCases:NotificationManagerTest
Test: atest CtsAppTestCases:android.app.cts.ServiceTest
Change-Id: I1c2bb78d86f194585d273661cecf3419f51965df
Merged-In: I1c2bb78d86f194585d273661cecf3419f51965df
2021-03-19 04:24:45 +00:00
TreeHugger Robot
e086a17e7d Merge "[RESTRICT AUTOMERGE] Use userId instead of USER_CURRENT in shouldLockKeyguard." into qt-dev 2021-03-03 13:50:43 +00:00
Julia Reynolds
49688ab659 Add pkg target to snoozing alarm
Test: SnoozeHelperTest
Bug: 174493336
Change-Id: I6aaf80a11dcae2eca41d4647411126ed41587027
(cherry picked from commit 6b5813b1f1)
Merged-In: I6aaf80a11dcae2eca41d4647411126ed41587027
2021-02-23 16:51:58 +00:00
Jonathan Scott
bb4eded379 [RESTRICT AUTOMERGE] Use userId instead of USER_CURRENT in shouldLockKeyguard.
USER_CURRENT is not an acceptable input to isSecure(). The test has also
been updated as the use of any() for the mock hid this bug.

Test: atest LockTaskControllerTest
Bug: 176801033
Change-Id: Ib8a11ed4fc895bcd6eda8cf777a8dd2ce253e11e
2021-02-03 17:24:10 +00:00
Evan Laird
6dc0941994 DO NOT MERGE: Associate notif cancels with notif posts
CancelNotificationRunnables just spin on the work handler of
NotificationManagerService, hoping that they get executed at the correct
moment after a PostNotificationRunnable and before the next
EnqueueNotificationRunnable completes. Otherwise, you end up in a bad
state where the cancel either is canceling notifications before they get
a chance to post, or missing its only chance to cancel the notification
(for instance, ActivityManagerService is the only caller that can cancel
FGS notifications).

This change attempts to execute a CancelNotificationRunnable at the
moment its run() method is called, otherwise it associates the runnable
with the latest enqueued notificaiton record which has yet to post.

It then associates PostNotificationRunnable with the delayed cancel
list, executing any missed cancel operations immediately upon finishing
the PostNotificationRunnable.

Test: atest SystemUITests NotificationManagerServiceTest; manual
Bug: 162652224
Bug: 119041698
Change-Id: I88d3c5f4fd910a83974c2f84ae3e8a9498d18133
2021-01-29 10:48:14 -05:00
Jay Aliomer
e6b4c38f90 Failed UiModeManagerServiceTest
Added a mock and mockito helpers to remedy failed tests

Fixes: 151984124

Test: UiModeManagerServiceTest
Change-Id: Ic128ed9853f6f3b9f8641c1bec2a7c981e52865f
Merged-In: I09af78fd16662185d01aea427188f79527d47a9e
2020-03-25 03:13:25 +00:00
Riddle Hsu
1ec2f403e9 RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
Originally, if the caller of navigateUpTo is alive, even the calling
uid is set to the caller who launched the existing destination activity,
the uid from caller process has higher priority to replace the given
calling uid. So this change doesn't modify the existing behavior if
the caller process is valid. Besides, the case of delivering new intent
uses the source record as calling identity too, so the case of starting
new activity should be consistent.

Also forbid attaching null application thread to avoid unexpected state
in process record.

Bug: 144285917
Test: atest ActivityStackTests#testNavigateUpTo
Test: atest CtsSecurityTestCases:ActivityManagerTest# \
      testActivityManager_attachNullApplication
Change-Id: I60732f430256d37cb926d08d093581f051c4afed
2020-03-04 12:54:55 +00:00
Riddle Hsu
8a2c62c286 RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
Originally, if the caller of navigateUpTo is alive, even the calling
uid is set to the caller who launched the existing destination activity,
the uid from caller process has higher priority to replace the given
calling uid. So this change doesn't modify the existing behavior if
the caller process is valid. Besides, the case of delivering new intent
uses the source record as calling identity too, so the case of starting
new activity should be consistent.

Also forbid attaching null application thread to avoid unexpected state
in process record.

Bug: 144285917
Test: atest ActivityStackTests#testNavigateUpTo
Change-Id: I60732f430256d37cb926d08d093581f051c4afed
2020-03-03 11:14:07 +00:00
Jay Aliomer
d9d21afdd4 Merge "Back porting Dark theme bug fixes from R" into qt-qpr1-dev 2020-03-02 23:18:48 +00:00
Jay Aliomer
7c7f3dc678 Back porting Dark theme bug fixes from R
Applying theme on start
update system properties on startup to apply the updates

Fixes: 149441632
Fixes: 149385662
Test: UiModeManager tests
Change-Id: I7f71e27a43eb24be833b3003340653fefc75d0cc
Merged-In: I0bee6517b39216146681097262cf55c7192b0131
2020-02-19 19:18:44 +00:00
kwaky
c26e4fa64f Add vertical type check to prevent non-Automotive Androids from force displaying system bars.
Force displaying system bars can cause app screen compatibility issues
in non-Automotive Android.

Bug: 148407132
Test: CTS Test + Unit Tests
Change-Id: Ia433572650760e3b85954724c63084dca769eaa0
Merged-In: Ia433572650760e3b85954724c63084dca769eaa0
2020-02-18 09:15:54 -08:00
Michael Groover
b6f974b26b Merge "Ensure adb key store is instantiated before revoking grants" into qt-qpr1-dev 2020-02-13 23:18:35 +00:00
TreeHugger Robot
c1e78426b5 Merge "Re-activate backup service after cleaning a profile owner" into qt-qpr1-dev 2020-02-11 23:20:29 +00:00
Christophe Koessler
d3e7186a06 CountryDetector: Enable detector class override for automotive
The detector class to be used by the CountryDetectorService can be set
by overlaying config_customCountryDetector in the device config.

Test: atest CountryDetectorServiceTest
Bug: 141626568
Merged-In: I158abd6397e3102d13e431ba043e8ce45061b64a
Change-Id: I158abd6397e3102d13e431ba043e8ce45061b64a
(cherry picked from commit 34147601d8)
2020-02-11 00:31:54 +00:00
TreeHugger Robot
7d26587263 Merge "Refactor CountryDetectorService" into qt-qpr1-dev 2020-02-10 20:32:35 +00:00
Pavel Grafov
b9c4862b86 Re-activate backup service after cleaning a profile owner
Currently backup service is re-activated unconditionally when clearing
a device owner but not profile owner. With this CL it should be
re-activate in both cases.

NB: there are two bits of state related to backup service:
1. activated or deactivated: This is out of user control, but can be
   changed by the admin via DPM.setBackupServiceEnabled (this name is
   a bit misleading here).
2. enabled or disabled: this is controlled by the user via Settings
   and only available when backup service is activated (see 1.)

Bug: 143274029
Bug: 147997438
Test: atest CtsAdminTestCases && adb shell bmgr enabled
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Merged-In: I6f11642abe544c7df265ed7e2ad466d47796e7f9
Change-Id: I6f11642abe544c7df265ed7e2ad466d47796e7f9
(cherry picked from commit 775b26d884)
2020-02-04 10:54:27 +00:00
Michael Groover
c718e54c27 Ensure adb key store is instantiated before revoking grants
If adb is not enabled on a device then the adb key store is not
instantiated when the AdbDebuggingManager's handler is started as
in most cases it will not be needed. However if the user attempts
to revoke any previous adb grants when a device is booted with adb
disabled it will result in a NPE. This commit ensures the key store
is instantiated before attempting to revoke authorizations.

Test: atest AdbDebuggingManagerTest
Test: Manually invoked 'Revoke USB debugging authorizations' after
      a boot with adb disabled.
Fixes: 145790817

Change-Id: Id00e531c18412be009a211eec80a72867659608f
Merged-In: Id00e531c18412be009a211eec80a72867659608f
2020-01-23 13:37:15 -08:00
Martijn Coenen
074d6fbd3f Merge "Fix IsolatedUidAllocator for non-primary users." into qt-qpr1-dev 2020-01-17 14:39:49 +00:00
Philip P. Moltmann
05024a1523 DO NOT MERGE Fix AppOpsServiceTest
- Mock LocalService dependency
- Always assume calling app has appropriate permissions

Test: atest atest FrameworksMockingServicesTests:com.android.server.appop
Fixes: 132274015
Fixes: 147778434
Bug: 146463528
Bug: 146590200
Merged-In: Ie816e0c6c81ecf25d37f05187591ca0d1edf0bc2
Change-Id: Ie816e0c6c81ecf25d37f05187591ca0d1edf0bc2
2020-01-16 11:15:42 -08:00
Martijn Coenen
c6a61a6b0c Fix IsolatedUidAllocator for non-primary users.
The UID allocator stores complete UIDs, not app IDs. When removing a UID
from the range, we should therefore also use the UID, not the app ID.

Also added a test to cover this scenario, which passes with this change.

Bug: 146313311
Test: atest ActivityManagerTest
Change-Id: I1118ec73dcee5987e12f35aabce5cfa8cbe407a1
(cherry picked from commit c9a0df2d88)
2020-01-15 18:25:51 +00:00
Automerger Merge Worker
6d35c7c7c2 Merge "Fix ModuleInfoProviderTest by passing correct flag" into qt-dev am: 5d612f02b8
Change-Id: Ide396764d369792eb55000119d4383598e76964d
2020-01-14 16:17:07 +00:00
Mohammad Samiul Islam
3dd716a130 Fix ModuleInfoProviderTest by passing correct flag
Bug: 140941633
Bug: 147476459
Test: atest ModuleInfoProviderTest
Change-Id: Icf93ca7dcf4fc2d7625fe7f9175c59200ae600b6
Merged-In: Icf93ca7dcf4fc2d7625fe7f9175c59200ae600b6
2020-01-10 17:26:27 +00:00
Christophe Koessler
611bad9556 Refactor CountryDetectorService
Clean-up the test to use Mockito instead of the deprecated
AndroidTestCase, also getting rid of 1.5s of Thread.sleep.
No logic change.

Bug: 141626568
Test: atest CountryDetectorServiceTest
Merged-in: Ic0782b1ffcd1dcb30b9f1d91b37521d1f9887f03
Change-Id: Ic0782b1ffcd1dcb30b9f1d91b37521d1f9887f03
(cherry picked from commit 50361687ba)
2020-01-10 00:12:11 +00:00
Kweku Adams
265b8356e8 Re-register SMD after motion detected.
One shot sensors need to be re-registered after they've been triggered.
Since DeviceIdleController wasn't doing that, we weren't properly
tracking motion to inform stationary listeners. This change makes sure
to re-register the motion sensor after some time to make sure motion is
properly tracked.

Bug: 140162457
Test: atest com.android.server.DeviceIdleControllerTest
Change-Id: Ic712e46bdc9d107d56cea3bce72c2e7b2187530a
Merged-In: I8600a8382b7c773be9e200afba96a7f1a74f6e10
2019-12-19 18:59:42 -08:00
TreeHugger Robot
72daf56b90 Merge "Revert "Fix drag and drop (3/3)"" into qt-qpr1-dev 2019-12-19 07:49:32 +00:00
TreeHugger Robot
e0f4421f23 Merge "Revert "Fix drag and drop (1/3)"" into qt-qpr1-dev 2019-12-19 07:49:32 +00:00
TreeHugger Robot
90387eb27f Merge "more precise definition for undecorated remoteviews" into qt-qpr1-dev 2019-12-14 16:49:31 +00:00
Chris Wren
6cbf57b4b0 more precise definition for undecorated remoteviews
Bug: 145994957
Test: atest NotificationRecordTest
Change-Id: I9427137879dc87f32231fbc5cb8ed34cf5ce787a
2019-12-13 15:42:19 -05:00
Santos Cordon
a7991ab888 Clamp brightness thresholds to the maximum brightness.
Bug: 144702254
Test: atest AutomaticBrightnessControllerTest

Change-Id: Ia8ac92cf306424d1324d028559f4260b9f80d482
Merged-In: Ia8ac92cf306424d1324d028559f4260b9f80d482
2019-12-12 12:17:02 -08:00
TreeHugger Robot
e24e97f9b2 Merge "DO NOT MERGE: unrevert "Force FGS notifications to show for a minimum time"" into qt-qpr1-dev 2019-12-11 23:16:31 +00:00
TreeHugger Robot
1eb5828022 Merge "track and report packages with undecorated remoteviews" into qt-qpr1-dev 2019-12-10 18:36:43 +00:00
Evan Laird
b0d526ac12 DO NOT MERGE: unrevert "Force FGS notifications to show for a minimum time"
See CL with change id (I0680034ed9315aa2c05282524d48faaed066ebd0) for
the meaningful changes/description. This change was reverted in qt-qpr1-dev
in order to fix a bug but never got unreverted due to the qt-dev CL
having the same change-id as the reverted one.

Bug: 119041698
Test: atest NotificationManagerServiceTest
Test: atest ForegroundServiceNotificationListenerTest
Change-Id: I50f16072b0e56ab69aabf8010ffffd172ca7c05a
2019-12-09 17:15:00 -05:00
Chris Wren
bc487b5759 track and report packages with undecorated remoteviews
print query results with:
  adb shell dumpsys notification --remote-view-stats

test the pulled atom with:
  make statsd_testdrive
  ./out/host/linux-x86/bin/statsd_testdrive 10066

Bug: 144855217
Test: atest frameworks/base/services/tests/uiservicestests/src/com/android/server/notification
Change-Id: I6dcc9871f78298a8b213a051223c7316f8feefc5
Merged-In: I773378fc7cfb47a9f9c7495404ddafa63f39cfaf
2019-12-09 15:48:14 -05:00
Arthur Hung
a9f15f0b0a Revert "Fix drag and drop (3/3)"
This reverts commit 6262f22411.

Bug: 137819199
Test: manual
Change-Id: I10800ff8f76fa68b9a93c935d14c5ade68504917
Merged-In: I10800ff8f76fa68b9a93c935d14c5ade68504917
(cherry picked from commit fd9d94d8e3)
2019-12-09 09:33:19 +00:00
Arthur Hung
bc71da4f47 Revert "Fix drag and drop (1/3)"
This reverts commit 59f532efad.

Bug: 137819199
Test: manual
Change-Id: If5e8856aad74b6f232fff9d5fd746f56d63288eb
Merged-In: If5e8856aad74b6f232fff9d5fd746f56d63288eb
(cherry picked from commit c499ad3775)
2019-12-09 09:31:45 +00:00
Alex.tc Huang
a5b6b37c02 DO NOT MERGE Allow app switches for accessibility services
Set allow app switches so the accessibility service can start activity
without delay.

Bug: 141873810
TEST: atest AccessibilityServiceConnectionTest
Change-Id: I4204c4cf0baa1f66d6d2d73d56a342ae803d24dd
(cherry picked from commit 24ef87d5f1)
2019-12-05 05:29:11 +00:00
TreeHugger Robot
570b037d9d Merge "Ignore null package names on AppIdleHistory writes" into qt-qpr1-dev 2019-12-03 19:11:38 +00:00
Kenny Guy
a845a40472 RESTRICT AUTOMERGE
Turn off color sampling for qpr2

A separate CL has been submitted to add an API
to enabled / disabled color sampling in master.

Bug: 143556482
Test: atest BrightnessTrackerTest
Change-Id: I4401cd35a2aa0ec35afaba928c95c971f92b0557
2019-11-27 17:56:08 +00:00
Michael Wachenschwanz
8c644b1070 Ignore null package names on AppIdleHistory writes
AppIdleHistory will fail to persist to disk if a null package name makes
it into the map. This change avoids the failure and adds more detail to
the log in the event of a failure.

Test: atest AppIdleHistoryTests
Fixes: 122609407
Change-Id: I30115265a1b963a0d66bad4fe15c69907ee8e53c

Merged-In: Ifec5a14f488fdb425bdcfee6ffe1f48f9fa9d1e8
2019-11-22 22:54:32 +00:00
TreeHugger Robot
d6dfaf4c9d Merge "Update equals and hashCode methods of NoMan.Policy" into qt-qpr1-dev 2019-11-22 00:51:41 +00:00
Jay Aliomer
381e3300e8 Dark theme twilight mode backend and tile
When the user has Dark theme scheduling turned on (b/141567787), the quick settings tile subtext should reflect the following:
If Dark theme is on: "Until sunrise"
If Dark theme is off: "On at sunset"
If the user does not have Dark theme scheduled, the text should not appear.
This matches the appearance of the Night Light QS tile.
All starting windows snapshots will be deleted and splash screens
will be used instead.

Test: atest UiModeManagerServiceTest
Fix: 143874807
Merged-In: Ie2ce64b5c5544fffe76be7ec3f971eb7461f8c4d

Change-Id: Ie2ce64b5c5544fffe76be7ec3f971eb7461f8c4d
(cherry picked from commit 8b2671b029)
2019-11-21 18:05:22 +00:00
Satakshi Rana
73b4e1923a Merge "Screenshot Notification Smart Action: AiAi and - Sys UI integration" into qt-qpr1-dev 2019-11-19 17:14:49 +00:00
Satakshi
ce35ce9f08 Screenshot Notification Smart Action: AiAi and - Sys UI integration
Create a constant in ContentSuggestionsManager, which will
be used to pass a hardware bitmap to ContentSuggestionsService.
In the presence of this key in the request extras, we skip taking a
snapshot in ContentSuggestionsPerUserService.
Bitmap is extracted from reading this value from extras in
ContentSuggestionsService.

Create ScreenshotNotificationSmartActionsProvider, which is overridden
in GoogleSystemUI.
Calling AiAi is guarded by a device config flag created in cl/277143225.

(cherry picked from commit d2010f2628 and c45d86fc15)

Test: Manually tested the code in this CL and corresponding change in SystemUIGoogle.
Took a screenshot and verified that AiAi gets invoked and the screenshot notification
shows smart actions.
Ran new tests added in this CL
'atest ScreenshotNotificationSmartActionsTest'
'atest ContentSuggestionsPerUserServiceTest'
Bug: 141634285
Change-Id: I439a4be9aac53fb02b566ae4d438afe3edf2b37a
Merged-In: I439a4be9aac53fb02b566ae4d438afe3edf2b37a
2019-11-18 16:06:08 -08:00
Suprabh Shukla
c8e1162852 Remove cancel listeners from pending intent alarms
The cancel listeners are created per PendingIntent instance and were
spamming the callback list stored inside PendingIntentRecord. In cases
where there is even a single live PendingIntent backed by this
PendingIntentRecord, all PendingIntent instances backed by this
PendingIntentRecord for which a callback was ever registered will leak.

Test: atest FrameworksMockingServicesTests:\
com.android.server.am.PendingIntentControllerTest
atest FrameworksMockingServicesTests:\
com.android.server.AlarmManagerServiceTest

Bug: 143091024
Change-Id: I65df12da0c437064e6e3719911926738c677c4eb
Merged-In: I65df12da0c437064e6e3719911926738c677c4eb
(cherry picked from commit 0d51a8bcc0)
2019-11-14 00:02:06 +00:00