Commit Graph

20815 Commits

Author SHA1 Message Date
Bernardo Rufino
365d013e43 Merge "Fix background bypass via notifications" into sc-dev 2021-05-27 10:48:45 +00:00
TreeHugger Robot
018e114202 Merge "Create ActivityClientRecord early in preExecute" into sc-dev 2021-05-27 03:50:20 +00:00
Bernardo Rufino
5fbeff59df Fix background bypass via notifications
Apps were able to bypass BAL and BG-FGS restrictions by retrieving their
own notifications and firing their PI since those were allowlisted for
those operations.

Now we strip the token that granted them that ability
from notifications returned via NM.getActiveNotifications(), which
returns the notifications of the caller.

Notifications returned via notification listener APIs still contain such
token, as they should.

Bug: 185388103
Bug: 169821287
Test: atest -d android.app.cts.NotificationManagerTest#testActivityStartFromRetrievedNotification_isBlocked
Change-Id: I2ede0d639a560f6acacec3864a0a7d23af152ba5
2021-05-26 16:25:39 +01:00
Orion Hodson
2869d5a8c8 Merge "Use updated NetworkEventDispatcher API" into sc-dev 2021-05-26 13:34:07 +00:00
Victor Chang
ad227b1cab Merge "Refactor ddm ChunkHandler utility methods from libcore to framework" into sc-dev 2021-05-26 08:27:06 +00:00
Chilun
8f3a6caab8 Create ActivityClientRecord early in preExecute
We can guarantee that LaunchActivityItem will queue before
ActivityConfigurationChangeItem.
But ActivityConfigurationchangeItem#preExecute() still has the
opportunity to execute before LaunchActivityItem#execute(). And at this
time, ActivityClientRecord has not been created.

This CL create ActivityClientRecord early in
LaunchActivityItem#preExecute() and store in a new list of
ActivityThread. Thus others can guarantee to get the
ActivityClientRecord in preExecute().

Bug: 187691892
Test: atest TransactionExecutorTests
Change-Id: Ib40270345223c5c6e76333803faf98937c5527f9
2021-05-26 12:50:33 +08:00
Wei Sheng Shih
d42b8e2c73 Merge "Fix setApplicationNightMode crash due to permission denial." into sc-dev 2021-05-26 01:56:30 +00:00
Nikita Iashchenko
3938aac8a6 Refactor ddm ChunkHandler utility methods from libcore to framework
As a part of internal libcore cleanup three utility methods for ddm
chunks (de)serialization were removed from the CorePlatformApi set and
moved to framework.

As a part of API council review made following changes:
 * Renamed connected/disconnected callback methods to
   onConnected/onDisconnected, respectively
 * Made unregisterHandler method a part of core api
 * Renamed threadNotify/enableRecentAllocations setters

Bug: 154796679
Bug: 184654804
Test: m droid
Merged-In: I1d43f12aaf70c7c079577d3f3248248ed39f9865
Change-Id: I1d43f12aaf70c7c079577d3f3248248ed39f9865
2021-05-26 01:36:53 +01:00
Orion Hodson
a0ce8ac42c Use updated NetworkEventDispatcher API
Bug: 185153775
Test: m
Change-Id: Ib5ea04b0bae0dce9783c4017f1dd0db0efd49976
2021-05-25 21:05:55 +01:00
Li Li
a80340f9c6 Merge "Freezer kill reason in App Process Kill Stats" into sc-dev 2021-05-25 19:34:49 +00:00
Jeff DeCew
f294d0ba5f Merge "Resolve Notification.Colors once, instead of lazily." into sc-dev 2021-05-25 16:44:59 +00:00
Vadim Caen
fc1efcb428 Merge changes from topic "splashscreen-surface" into sc-dev
* changes:
  Do not reparent the SC when package is already realeased
  Display Splashscreen AVD in a SurfaceView
2021-05-25 15:24:08 +00:00
Jeff Sharkey
023570d056 Merge "Retire preliminary FGS deferral control API" into sc-dev 2021-05-25 14:27:07 +00:00
Jeff DeCew
cab7d8e011 Resolve Notification.Colors once, instead of lazily.
* Instead of resolving colors as-needed, resolve the entire palette potentially used by the notification at the start.
* Centralize color logic and palette storage into Notification.Colors for easier unit testing.
* Adds unit tests for the Notification.Colors, including validating color contrast ratios for various colors.
* Fix a bug with ColorContrastUtil where the luminosity for dark/light font cutoff was 0.5, which resulted in a max contrast ratio of 1.9 for some colors.  Now contrast ratios of 4.5:1 can be achieved for all colors.
* Removes a few of the color accessors in Notification.Builder which were infrequently used, and replaces them with direct use of Notification.Colors.
* Notification specific colors (primary, secondary, default) have only been used by colorized notifications for a few months.  Remove the dark mode overrides of these, ensuring that colorized notifications have the same exact appearance in light and dark themes.
* Replace the use of the "default" color with the "secondary text color"; this practically only affects the alerted bell icon, is more consistent, and reduces complexity.

Fixes: 187881776
Test: manual
Test: atest android.app.NotificationTest
Change-Id: Ib8840d04093094c324d8bdce5b2e84c93a94db8d
2021-05-25 09:57:11 -04:00
wilsonshih
d22e8b1403 Fix setApplicationNightMode crash due to permission denial.
Test activity crash when calling UiModeManager#setApplicationNightMode.
There should call clearCallingIdentity before updating configuration in
system server.
Also clear some code around those methods.

Fixes: 189166288
Test: atest SplashscreenTests#testSetApplicationNightMode
Change-Id: I163919927030f81739aa3d9520e2012a92028793
2021-05-25 19:09:58 +08:00
Shan Huang
35a187904c Merge "Tweak dark area thresholds." into sc-dev 2021-05-25 06:07:39 +00:00
Li Li
71fd3dc694 Freezer kill reason in App Process Kill Stats
The reason code is helpful for developers to understand why an app is
killed. It is also valuable to better quantify the benefit and impact
of App Freezer.

Bug: 183714099
Bug: 179715791
Test: dumpsys activity exit-info shows subreasons.

Change-Id: Iea808cdc8adbe9d84663071dc849d00ea28a9f7d
2021-05-24 22:17:42 -07:00
Christopher Tate
baf1aad78e Retire preliminary FGS deferral control API
Now that we've settled the final API for this mechanism, retire the
preliminary one.

Bug: 186475652
Test: atest CtsAppTestCases:ServiceTest
Test: atest CtsAppTestCases:NotificationManagerTest
Change-Id: Ibe911627ad59b991f2e498689f7fa3019c19dc36
2021-05-24 14:28:16 -07:00
Hyunyoung Song
46d6e25d25 Merge "ApiCouncil review round3 / setHidden, Query.getExtras" into sc-dev 2021-05-24 21:14:10 +00:00
Patrick Baumann
dff37ee6d2 Merge "Updates OWNERS files" into sc-dev 2021-05-24 18:30:19 +00:00
Shuo Qian
5fcdcebfd2 Merge "Change default value from true to false for preferential network service enabling" into sc-dev 2021-05-24 17:57:56 +00:00
Hyunyoung Song
c94e76051f ApiCouncil review round3 / setHidden, Query.getExtras
Bug: 186756959
Test: atest CtsSearchUiServiceTestCases
Change-Id: I2d13556fd71ddf8ae4e44879a91039a698667001
2021-05-24 09:29:49 -07:00
Shan Huang
9130229cb2 Tweak dark area thresholds.
Bug: 185890335
Test: Manual
Change-Id: Iee125b21cd742ebe5895a407a8062e8826a72931
2021-05-24 14:34:08 +08:00
Soonil Nagarkar
20b934e7db Merge "Update location bypass allowlist" into sc-dev 2021-05-22 04:04:54 +00:00
Shuo Qian
63c9e34ae9 Change default value from true to false for preferential network service enabling
Test: atest DevicePolicyManagerTest#testSetGetPreferentialNetworkServiceEnabled;
      atest DevicePolicyManagerTest#testUpdateNetworkPreferenceOnStartUser;
      atest DevicePolicyManagerTest#testUpdateNetworkPreferenceOnStopUser;
      atest MixedManagedProfileOwnerTest#testSetPreferentialNetworkServiceStatusLogged;
      atest MixedManagedProfileOwnerTest#testSetGetPreferentialNetworkServiceStatus

Bug: 187771747
Change-Id: I3c7af4de7fb2c8ed284a27ada9092450e32aeb89
2021-05-21 22:49:43 +00:00
Patrick Baumann
43628ca24c Updates OWNERS files
Bug: 186864416
Test: Builds
Change-Id: I04dfc5c2c7143825334ebc62742e335b8c889492
2021-05-21 14:13:18 -07:00
Calin Juravle
dd8b94557d Merge "Update the use of registerAppInfo" into sc-dev 2021-05-21 20:29:17 +00:00
Hai Zhang
5044308999 Merge "Expose platform permission group mapping as public API." into sc-dev 2021-05-21 17:26:10 +00:00
Soonil Nagarkar
1ea818347e Update location bypass allowlist
Create a new DeviceConfig entry to replace the prior Settings entry on
which the location ignore settings allowlist is based. This allows us to
allowlist based on attribution tag, and eliminate holes for large
applications.

Test: manual + CTS + GTS
Bug: 187421886
Change-Id: I31e61db79b93e202bd8c66efae1bb5aaf0c88ff5
2021-05-21 09:25:47 -07:00
Calin Juravle
2d2bd54bd5 Update the use of registerAppInfo
Pass additional parameters to ART to assist with better profiling
and debuggability.

(cherry picked from commit 3e308c6270)

Test: m
Bug: 182793486
Bug: 185979271

Merged-In: Iae0beab92194d75f191147578922c760f04470b9
Change-Id: Iae0beab92194d75f191147578922c760f04470b9
2021-05-21 14:13:03 +00:00
Vadim Caen
cb81f1716d Display Splashscreen AVD in a SurfaceView
If the splashscreen uses an animated icon, we need to display it in a
surface view to avoid any jank if the view is passed to the client.

Test: CtsWindowManagerDeviceTestCases:SplashscreenTests#testHandleExitIconAnimatingActivity
Bug: 181757194

Change-Id: I7e2745a68626849374f5ebb9011c2e8c3b3b92c3
2021-05-21 13:13:15 +02:00
Tom Natan
02f8f6cc9a Merge "Rename addPackageOverrides to putPackageOverrides." into sc-dev 2021-05-21 06:53:56 +00:00
Hai Zhang
8bda34c493 Expose platform permission group mapping as public API.
The API is moved from PermissionControllerManager (only a System API)
to PackageManager to expose it as public API.

Bug: 182094776
Test: atest GetPermissionGroupInfoTest
Change-Id: I175afb2e37bf2651b91765029645f7940f58f39c
2021-05-21 03:03:56 +00:00
Antonio Kantek
b1c5d7fabb Merge "Deleting ActivityView" into sc-dev 2021-05-21 01:05:17 +00:00
TreeHugger Robot
d0bcac4e41 Merge "Avoid a SecurityExcetion crash" into sc-dev 2021-05-21 00:38:53 +00:00
TreeHugger Robot
c7e659afd0 Merge "Add OPSTR_PHONE_CALL_* op strings to System API" into sc-dev 2021-05-21 00:11:49 +00:00
Antonio Kantek
5456990f7e Deleting ActivityView
Test: atest CtsAccessibilityServiceTestCases
Bug: 179161778
Change-Id: Ic66f3740819634366edb20a34a7c8177af258c2f
2021-05-20 19:04:49 +00:00
Jeff DeCew
9b357d5480 Improve notification style comparisons
Bug: 178272497
Test: atest SystemUITests
Change-Id: I9b1a55834360e48e83c09dc1d61b9b35f1f6ec09
2021-05-20 15:02:00 -04:00
Jeff DeCew
98ce9ad59f Merge "Do not hide BigText from notification when showing progress." into sc-dev 2021-05-20 18:30:02 +00:00
Nate Myren
480e499ea4 Add OPSTR_PHONE_CALL_* op strings to System API
The PermissionController needs these ops to display phone calls in the
Privacy Dashboard

Test: build
Bug: 176902658
Change-Id: Ib2a862520a73f3e65eeefd0fcba3843ef9112354
2021-05-20 10:16:18 -07:00
Jeff DeCew
c9491b8199 Do not hide BigText from notification when showing progress.
Fixes: 188682444
Test: manual
Change-Id: Ifd384789f1358859d8ed51e91f2d2ae963baf4e0
2021-05-20 09:58:38 -04:00
tomnatan
b706bd3e98 Rename addPackageOverrides to putPackageOverrides.
Bug: 187738991
Test: atest FrameworksServicesTests:CompatConfigTest
Test: atest FrameworksServicesTests:PlatformCompatTest
Marged-In: I52e5051810cf31cbcee9ba600c92c86d335187a0
Change-Id: I52e5051810cf31cbcee9ba600c92c86d335187a0
2021-05-20 13:31:45 +00:00
Kholoud Mohamed
b04a005c3f Merge "Revert "Create non-bypassable op restrictions"" into sc-dev 2021-05-20 09:48:56 +00:00
Les Lee
8df7b875d4 Merge "Support to query TYPE_WIFI usage with subscriberId" into sc-dev 2021-05-20 08:55:59 +00:00
Ocean Chen
0d02112ea4 Revert "Create non-bypassable op restrictions"
This reverts commit a023924afd.

Reason for revert: Test Monitor triggers the test build

Bug: 188708756
Bug: 188733943
Change-Id: I2d17d4f77287020953fb559cf98ff8475f32ed1b
2021-05-20 07:47:51 +00:00
Guojing Yuan
b8488603d6 Avoid a SecurityExcetion crash
1. Instead of throwing SecurityException, log the error.
2. Set isAttributionTagNotFound to true when the attributionTag is not
null but not found in the package attributions.

Fix: 188549667

Test: N/A
Change-Id: I75a217893353ee5fe5d191e2b78ccf391847adb6
2021-05-20 00:14:29 +00:00
Evan Severson
05a30e41f3 Merge "Create non-bypassable op restrictions" into sc-dev 2021-05-19 19:24:22 +00:00
TreeHugger Robot
ee438f960a Merge "Deprecate Context#createApplicationContext" into sc-dev 2021-05-19 15:35:09 +00:00
Rubin Xu
68aa35b03d Merge "Send network & security logging callbacks in foreground" into sc-dev 2021-05-19 15:34:31 +00:00
Junyu Lai
b987babf5e Merge changes I3ba50cbd,I970ee365 into sc-dev
* changes:
  [FUI29] Migrate ConnectivityService to use getAllNetworkStateSnapshots
  [FUI27] Fix internal naming of notifyNetworkStatus
2021-05-19 12:36:03 +00:00