Commit Graph

20852 Commits

Author SHA1 Message Date
Mady Mellor
c0a3fa5ffe Merge "Re-add checks for mutable intents on bubbles" into sc-dev am: f8218030bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14792011

Change-Id: Ibc1f94b5c03fe067befbdcce60832ab7d20ccdf3
2021-06-01 23:27:32 +00:00
Mady Mellor
f8218030bb Merge "Re-add checks for mutable intents on bubbles" into sc-dev 2021-06-01 22:59:54 +00:00
Mady Mellor
4d9ab47b4b Re-add checks for mutable intents on bubbles
Also adds a note in the javadoc.

Bug: 177252626
Test: atest NotificationManagerServiceTest
Change-Id: I1e55b08d3de7b6be22090cc821794c78c6659620
2021-06-01 14:01:17 -07:00
Jeff DeCew
59c0a6b4cc Merge "Do not show the custom views of spoofing notitifactions." into sc-dev am: 3c3af99d00
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14739250

Change-Id: I3c90492fe703d499421e776d28b8de0d592242b9
2021-06-01 19:40:29 +00:00
TreeHugger Robot
8358468870 Merge "Fix various FGS notification deferral issues" into sc-dev am: 2ee596d203
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14736145

Change-Id: If439610cf43da7ba0f18d901687a6319b58055c8
2021-06-01 19:34:05 +00:00
Jeff DeCew
3c3af99d00 Merge "Do not show the custom views of spoofing notitifactions." into sc-dev 2021-06-01 18:24:21 +00:00
TreeHugger Robot
2ee596d203 Merge "Fix various FGS notification deferral issues" into sc-dev 2021-06-01 17:32:02 +00:00
Jing Ji
ea4646691e Merge "Don't call onNullBinding when the service host is dead" into sc-dev am: e6436d95f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14739098

Change-Id: I4d9c7464005bdad716df41330bc76ecd7528e113
2021-05-28 03:03:04 +00:00
Ryan Mitchell
a1cb15f54e Merge changes from topic "inc-dis" into sc-dev am: 488522c9c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14505818

Change-Id: I5ae5007659172d8a247b8613646d72a68a7dd06a
2021-05-28 02:49:33 +00:00
Bernardo Rufino
e52ffd21cc Merge "Fix background bypass via notifications" into sc-dev am: 365d013e43
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14736230

Change-Id: I6872834f125417a2a31ee1d86435ac2c71958791
2021-05-28 02:25:29 +00:00
TreeHugger Robot
fab7d6a152 Merge "Create ActivityClientRecord early in preExecute" into sc-dev am: 018e114202
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14673572

Change-Id: I30b9949c8be0905202a2370fbfa57bad2f07096a
2021-05-28 02:24:32 +00:00
Jing Ji
e6436d95f8 Merge "Don't call onNullBinding when the service host is dead" into sc-dev 2021-05-28 01:35:24 +00:00
Ryan Mitchell
488522c9c5 Merge changes from topic "inc-dis" into sc-dev
* changes:
  Disable incremental hardening on own resources
  StringBlock incremental hardening default values
2021-05-27 21:31:04 +00:00
Christopher Tate
10a3ccad53 Fix various FGS notification deferral issues
A number of scenarios involving both FGS and non-FGS notification
operations were not yet working as intended.  This CL lands the
following behaviors:

* notify() to update the notification content during an FGS's
notification deferral period now respects the new Notification's
deferral policy rather than forcing immediate display.  An app can now
choose whether to force immediate display, or to have the new content be
what eventually appears at the end of the deferral period, by using the
same builder API as controls the deferral policy for startForeground().

* If an app posts a notification via notify() then adopts that
notification with new content (i.e. uses the same notification ID) in a
call to startForeground(), there is now no deferral: the existing
notification is always updated immediately, regardless of the
notification's or the service's configuration viz deferral policy.

* Fixed a latent bug when the app called notify() to update the
notification after startForeground(), then the service was killed for
memory and relaunched.  The notification might have been reposted with
stale content.

* Adjusted the metrics handling to more accurately express "was display
of the notification content for this transition to the FGS mode
deferred?"

Bug: 178406514
Bug: 185771298
Bug: 187860135
Test: atest CtsAppTestCases:android.app.cts.ServiceTest
Test: atest CtsAppTestCases:NotificationManagerTest
Change-Id: Ieb62f7195eb619c1769e3c1bd518cb6a7b6e4b7c
2021-05-27 12:57:11 -07:00
Ryan Mitchell
c0416698db Disable incremental hardening on own resources
When an application is incrementally installed, and a resources
operation fails due to the resources not being fully present,
the app should crash instead of swallowing the error and
returning default values to not alter the experience of
using the application.

Disable IncFsFileMap protections on ApkAssets that are a part of the
application that is running (base and splits).

Bug: 187220960
Test: atest ResourcesHardeningTest
Change-Id: Ibc67aca688720f983c7c656f404593285a54999b
2021-05-27 09:50:36 -07:00
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
Jing Ji
980dc5ae12 Don't call onNullBinding when the service host is dead
Bug: 189038850
Test: atest CtsAppTestCases
Change-Id: I8bcdaf545ee8ca46327fc25c14d9821e288600a4
2021-05-26 14:01:06 -07:00
Jeff DeCew
31b55249e8 Do not show the custom views of spoofing notitifactions.
Fixes: 189189308
Fixes: 189189219
Fixes: 189189310
Fixes: 189078626
Test: lots of manual testing with custom views
Change-Id: I069a83288f72803b6d0956899a44a527a7758c18
2021-05-26 16:40:54 -04: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
f74e79928c Merge "Use updated NetworkEventDispatcher API" into sc-dev am: 2869d5a8c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14722570

Change-Id: I5a935fb91eb9282e308b3fa87f6e021d1b364042
2021-05-26 13:53:44 +00:00
Orion Hodson
2869d5a8c8 Merge "Use updated NetworkEventDispatcher API" into sc-dev 2021-05-26 13:34:07 +00:00
Wei Sheng Shih
3be1e2b579 Merge "Fix setApplicationNightMode crash due to permission denial." into sc-dev am: d42b8e2c73
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14702762

Change-Id: I77d5eb3f3e71b0b4f6a55b054d2b937fc81fb60f
2021-05-26 11:31:21 +00:00
Li Li
56f795a97e Merge "Freezer kill reason in App Process Kill Stats" into sc-dev am: a80340f9c6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14359202

Change-Id: I8f51c1b7ddfa36e86d273d0c39b29e7ade353d88
2021-05-26 11:09:04 +00:00
Jeff DeCew
4e19c0f201 Merge "Resolve Notification.Colors once, instead of lazily." into sc-dev am: f294d0ba5f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14140988

Change-Id: Icaeb16f0e3fbb114c4de551e75adaa948c312ce6
2021-05-26 11:05:23 +00:00
Vadim Caen
847c9f75ae Merge changes from topic "splashscreen-surface" into sc-dev am: fc1efcb428
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14186656

Change-Id: I7c295f6f285fdd54f5be77d26eaaddeba9194bed
2021-05-26 11:04:14 +00:00
Jeff Sharkey
a1d0580e40 Merge "Retire preliminary FGS deferral control API" into sc-dev am: 023570d056
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14703963

Change-Id: Id165b46a61acffae36ee8fa71618226049e9c0e9
2021-05-26 11:02:35 +00:00
Shan Huang
6aa4481153 Merge "Tweak dark area thresholds." into sc-dev am: 35a187904c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14700835

Change-Id: I113b70fba2c36243754201afc64fc2929ea1eede
2021-05-26 10:51:18 +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
vichang
7da86d8d3e Merge "Refactor ddm ChunkHandler utility methods from libcore to framework" am: efc3806b1c am: 2d170271ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1686655

Change-Id: I23ef95bb40a210baebd22343dca0757675551069
2021-05-26 01:07: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
vichang
efc3806b1c Merge "Refactor ddm ChunkHandler utility methods from libcore to framework" 2021-05-26 00:26:20 +00:00
Treehugger Robot
4c2e19766f Merge "Add OWNERS for StorageStats related code." am: 1050f27b56 am: fc716dbc8b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1716368

Change-Id: Ib34358f3baae6a233475f83f2db3770d91c849e4
2021-05-25 23:39:02 +00: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
Nikita Iashchenko
77f6bbff3c 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
Change-Id: I1d43f12aaf70c7c079577d3f3248248ed39f9865
2021-05-25 14:29:21 +01: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
Sudheer Shanka
2910735d59 Add OWNERS for StorageStats related code.
Test: n/a
Change-Id: Idc16f09a5aa3b56af232c12f267614eaad94d9e4
2021-05-25 00:14:23 +00: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