Commit Graph

18132 Commits

Author SHA1 Message Date
Jake Wharton
d72728ff08 Revert "Add Activity non-config instance map-like API"
Revert "Tests for non-config instance map"

Revert submission 11077952-non-config-map

Reason for revert: API council would like to go straight to Jetpack
Reverted Changes:
Ib2484d433:Add Activity non-config instance map-like API
Ibc3daf82f:Tests for non-config instance map

Bug: 155401916
Change-Id: I9dd8226375e86d66b8cef3731642c0cf9f74434c
2020-04-30 18:58:01 +00:00
Jake Wharton
4fa4197a41 Add Activity non-config instance map-like API
This re-deprecates the single instance non-config instance API. Previously this was deprecated in favor of retained fragments. It was then undeprecated and platform fragments were deprecated (although those two events were not related).

The problem here is that there needs to be a composable mechanism of retaining non-config instances for libraries to use.
This is evidenced in Activity.java itself which already emulates a map internal by using a type and named fields.
The Jetpack library (nee support library) has historically needed this as well, and has been forced to resort to marking the single non-config instance API as final, exposing a differently-named overload, and then coalescing everything into a single type with named fields, just like Activity.java.

This change adds a class-keyed map-like API so that anyone can hook in without being directly in the activity subtype hierarchy.

Unlike the single non-config instance API, the map-like API has a few different behaviors:

- You can store an instance into the map anytime between onCreate and onDestroy (including inside those two lifecycle methods). The old API had a dedicated callback. You can use isChangingConfiguration() in onDestroy to conditionally create the retained instance.
- Stored instances are available for the entire lifetime of the activity instance. The old API cleared the non-config object in onResume.
- By virtue of the previous behavior, instances are retained across multiple config changes without having to re-create the state.

While behaviorally different from the old API, this is more in line with the behavior of retained fragments or non-framework solutions like Jetpack fragments and view models.

A compatibility shim for this in Jetpack will be added.

Bug: 152476567
Test: atest ActivityNonConfigInstanceTest
Change-Id: Ib2484d43327dd52e9cceac1f7201a5b4f694f7bb
2020-04-17 12:44:34 -04:00
Charles Chen
fff14c87a7 Merge "Fix WindowContextTests" into rvc-dev am: 5c984b9a09 am: a903d2fab4 am: 993020db5c am: 9945caaef5
Change-Id: I95947386583086facfad21e22626ddf790c5eecc
2020-04-14 19:32:23 +00:00
Charles Chen
993020db5c Merge "Fix WindowContextTests" into rvc-dev am: 5c984b9a09 am: a903d2fab4
Change-Id: I6328a1e25a9b5870d497f13f835d0c63aa91c1b6
2020-04-14 18:26:30 +00:00
Charles Chen
5c984b9a09 Merge "Fix WindowContextTests" into rvc-dev 2020-04-14 17:44:47 +00:00
Mady Mellor
5d84e7b91f Make bubble settings a pref with an int rather than a bool am: a92268cd01 am: 82b58a59a9 am: 1b484246be am: 6f3393fda3
Change-Id: Ia7daa314d296de1bbf6b0222978d11866834f6b4
2020-04-14 12:07:23 +00:00
Mady Mellor
1b484246be Make bubble settings a pref with an int rather than a bool am: a92268cd01 am: 82b58a59a9
Change-Id: I70f06051cd13f8cdbf4ee3eef2035d2448ab4ca7
2020-04-14 11:47:15 +00:00
Mady Mellor
82b58a59a9 Make bubble settings a pref with an int rather than a bool am: a92268cd01
Change-Id: Icbbfcc38f9cf065c437a7de14ab3cf94d3c05d0d
2020-04-14 11:27:42 +00:00
Julia Reynolds
c026d54cd7 Merge changes from topic "bubble_settings_wooo" into rvc-dev
* changes:
  Changes to enable bubble settings CTS
  Notification Bubble Button
  Make bubble settings a pref with an int rather than a bool
2020-04-14 11:22:14 +00:00
Charles Chen
7ba8e26c87 Fix WindowContextTests
Previously, window token assigns last config to mLastReportedConfiguration
directly, which makes it share the same reference with getConfiguration(),
and blocks all config changes request to clients.

This CL uses Configuration#setTo instead.

fixes: 152227175
Bug: 150251036
Test: atest WindowContextTests

Change-Id: I44143aa558f223eb301e28f2e9110bfd66eac636
2020-04-14 16:57:18 +08:00
Winson Chung
94cb950999 Merge "Send task description changed though task org taskInfoChanged" into rvc-dev am: 3908fb22b6 am: 068eabcc85 am: 1a24a44553 am: 81cc3656e6
Change-Id: I198b311d55e5eac904f15379c31848d65111cd06
2020-04-13 18:22:43 +00:00
Winson Chung
1a24a44553 Merge "Send task description changed though task org taskInfoChanged" into rvc-dev am: 3908fb22b6 am: 068eabcc85
Change-Id: I4a843fd5bf313c0a4babf4c26e3d92ef7e073cd9
2020-04-13 17:40:35 +00:00
Winson Chung
3908fb22b6 Merge "Send task description changed though task org taskInfoChanged" into rvc-dev 2020-04-13 16:58:07 +00:00
Julia Reynolds
037b98dfea Merge "Add guidance on conversation notifications" into rvc-dev am: f5590f558d am: 47d9d300bf am: db833a5d39 am: fdbe32a4c7
Change-Id: I9ff317bf38cff252bb986fe5646184c98694d4b8
2020-04-13 13:55:15 +00:00
Julia Reynolds
db833a5d39 Merge "Add guidance on conversation notifications" into rvc-dev am: f5590f558d am: 47d9d300bf
Change-Id: I01ac7d41918117fada1884ce8d9d954ff659041c
2020-04-13 13:06:26 +00:00
Julia Reynolds
f5590f558d Merge "Add guidance on conversation notifications" into rvc-dev 2020-04-13 12:28:28 +00:00
Riddle Hsu
6a29f4eba4 Merge "Do not unparcel bundle from application in LaunchActivityItem" into rvc-dev am: aec74e1a62 am: d01fcc5406 am: 857e94b00b am: 250adb0967
Change-Id: Ib8f7feb30337c1ad36d3d0ac60a2b01b1e7637aa
2020-04-13 10:57:05 +00:00
Riddle Hsu
d01fcc5406 Merge "Do not unparcel bundle from application in LaunchActivityItem" into rvc-dev am: aec74e1a62
Change-Id: I59b3e2be49433159706168d54d0417a6487b302a
2020-04-13 10:17:01 +00:00
Riddle Hsu
aec74e1a62 Merge "Do not unparcel bundle from application in LaunchActivityItem" into rvc-dev 2020-04-13 10:12:56 +00:00
Winson Chung
1df39e2cf6 Send task description changed though task org taskInfoChanged
- This removes the need for a separate task stack listener and aligns
  with other task info change properties
- Also implement equals/hashCode for the token so we can use it in
  containers

Bug: 148977538
Test: atest TaskOrganizerTests

Signed-off-by: Winson Chung <winsonc@google.com>
Change-Id: Ie035e6389fdbdc374c1a4b4a684758efa0cb7a9e
2020-04-11 00:01:05 -07:00
Julia Reynolds
7aca3b64aa Add guidance on conversation notifications
Test: make
Fixes: 153469444
Change-Id: I3df7fcdd03418bf8fe80c531385868d1d39409d8
2020-04-10 16:00:46 -04:00
Riddle Hsu
3c3e0c659a Do not unparcel bundle from application in LaunchActivityItem
The bundle fields may contain custom Parcelables. And Bundle#size
will call unparcel that causes BadParcelableException from
LaunchActivityItem#hashCode and LaunchActivityItem#equals.

Since the bundle fields of LaunchActivityItem may not be significant
for being the accurate identity of the item, the bundle fields can
be treated roughly (empty or not) to avoid unparceling.

Fixes: 153737846
Test: atest FrameworksCoreTests:TransactionParcelTests#testLaunch

Change-Id: I7ec55bbfcffcd47cfb586ede8053ab411891902d
2020-04-11 02:21:10 +08:00
Ryan Mitchell
591263c2c9 Merge changes from topic "invalidate_idmap" into rvc-dev am: 6cb79cdfb7 am: 7cfbff64eb am: 3c0b8da2c1 am: 14ecb445e0
Change-Id: Iff2ec5111ca814c5eab122e9834c1dcc87f191ff
2020-04-10 17:08:18 +00:00
Ryan Mitchell
3c0b8da2c1 Merge changes from topic "invalidate_idmap" into rvc-dev am: 6cb79cdfb7 am: 7cfbff64eb
Change-Id: Ief1e732e3b18738c5c0f62f2fe8c47f66169c85b
2020-04-10 16:17:25 +00:00
Ryan Mitchell
cca1593b23 Merge changes from topic "invalidate_idmap" into rvc-dev am: 6cb79cdfb7
Change-Id: Iec3d0e3bab28964442c5aada00c2586e284feb92
2020-04-10 15:53:05 +00:00
Ryan Mitchell
6cb79cdfb7 Merge changes from topic "invalidate_idmap" into rvc-dev
* changes:
  Fix InstallOverlayTests fail to install overlay
  Test that upgrading target apk invalidates idmap
  Invalidate idmap when target updates
2020-04-10 15:50:15 +00:00
Darryl Johnson
f433f1e348 Merge "Temporal fix of the Android Auto orientation chaniging on phone's orientation change." into rvc-dev am: 6c6d81a121 am: 2f8bead66d am: cb5b73717f am: 2631d50702
Change-Id: I70d663d5eaec68058f972a321e0222f6146b0875
2020-04-10 15:24:52 +00:00
Darryl Johnson
cb5b73717f Merge "Temporal fix of the Android Auto orientation chaniging on phone's orientation change." into rvc-dev am: 6c6d81a121 am: 2f8bead66d
Change-Id: I26433dca499ff0731ee713d050606a0da1437ec5
2020-04-10 14:43:49 +00:00
Darryl Johnson
f1c8746e77 Merge "Temporal fix of the Android Auto orientation chaniging on phone's orientation change." into rvc-dev am: 6c6d81a121
Change-Id: Idb50c517925b64041772af2cbd35c6ff553c29cf
2020-04-10 14:26:28 +00:00
Darryl Johnson
6c6d81a121 Merge "Temporal fix of the Android Auto orientation chaniging on phone's orientation change." into rvc-dev 2020-04-10 14:07:36 +00:00
Mady Mellor
a92268cd01 Make bubble settings a pref with an int rather than a bool
This will allow us to do all/selected/none preferences for
bubbles in settings.

- Feature is on by default
- App is none by default
- Channel is off by default

Test: atest NotificationManagerServiceTest BubbleExtractorTest
Bug: 138116133
Change-Id: Ifad1c22525123354f76959c2d44392a25d56347d
2020-04-09 14:49:29 -07:00
Hui Yu
7f54e09fdb Merge "Document process capability in AppOps.md." into rvc-dev am: d0139b01dd am: 096aafc8d2 am: 1552de74b7 am: 9faede2998
Change-Id: Ib56c3031c293fdef89db185255df46ba4511eb2e
2020-04-09 20:44:01 +00:00
Hui Yu
1552de74b7 Merge "Document process capability in AppOps.md." into rvc-dev am: d0139b01dd am: 096aafc8d2
Change-Id: I40077ccb1687e484b6a8eda78d680c0d3e060b42
2020-04-09 20:12:04 +00:00
Hui Yu
080037053c Merge "Document process capability in AppOps.md." into rvc-dev am: d0139b01dd
Change-Id: I46c7e278db9ef7749619c65b392c852f2c900b1d
2020-04-09 19:51:02 +00:00
Hui Yu
d0139b01dd Merge "Document process capability in AppOps.md." into rvc-dev 2020-04-09 19:42:09 +00:00
Selim Cinek
b3db34782b Merge changes I7dc8f5fd,Ia5262ca7 into rvc-dev am: 279238f3c2 am: 671d3aed9a am: deca8ecb66 am: dcc2af62db
Change-Id: I8f99e334f47fb7a16e5c4065fbbd4d03e6f55d50
2020-04-09 18:11:27 +00:00
Pavel Grafov
74173166ae Merge "Copy the remaining policies on migration." into rvc-dev am: c4adf5e87b am: 942034fa4a am: 59b22d2058 am: 7292a984ad
Change-Id: I9845fa1cb31ae5fadec09c0f500f89d9030b9b18
2020-04-09 18:02:23 +00:00
Selim Cinek
671d3aed9a Merge changes I7dc8f5fd,Ia5262ca7 into rvc-dev am: 279238f3c2
Change-Id: I48ea415cdf09b483b1de6009c7f4802969239084
2020-04-09 17:58:00 +00:00
Selim Cinek
279238f3c2 Merge changes I7dc8f5fd,Ia5262ca7 into rvc-dev
* changes:
  Fixed the transformation of min priority notifications
  Always use the largeIcon as avatar replacement
2020-04-09 17:55:27 +00:00
Pavel Grafov
942034fa4a Merge "Copy the remaining policies on migration." into rvc-dev am: c4adf5e87b
Change-Id: I5b21baef6cce593f42033b690bd3ea053d267fbb
2020-04-09 17:39:00 +00:00
Pavel Grafov
57c69d1e30 Copy the remaining policies on migration.
* accountTypesWithManagementDisabled
* disableScreenCapture

For security logging nothing has to be done since the state is
stored in a system property, just changed it so that the logging
will be started after the migration and only events for the
right user are logged.

Also removed the todo about hardening for power cut case, the
risk of additional complexity sees to outweight the benefit.

Bug: 149075700
Test: atest DevicePolicyManagerServiceMigrationTest
Change-Id: I3a58325f2d6f415e51998c5096c5fc123d26602d
2020-04-09 15:47:18 +01:00
Charles Chen
fa42fcc372 Merge "Fix WindowContext leak" into rvc-dev am: 5c082c998f am: c4750c036b am: 020b6173bb am: 57a0f90a57
Change-Id: I751bbbc8991c33679c22eba2e67f59a047fd997d
2020-04-09 11:50:59 +00:00
Yvonne Jiang
7210447a5d Merge "Fix secondary lock screen implementation such that DevicePolicyKeyguardService calls are made on the main (UI) thread." into rvc-dev am: eb31eb5bae am: 3190352ab0 am: a22cf96a39 am: ed0563648c
Change-Id: I1d2731860a0df86f4aba599aaeef0df043d74a00
2020-04-09 11:48:02 +00:00
Charles Chen
020b6173bb Merge "Fix WindowContext leak" into rvc-dev am: 5c082c998f am: c4750c036b
Change-Id: Id387c98e87df610c9657fe550b95603fdc2c3f17
2020-04-09 08:10:55 +00:00
Yvonne Jiang
a22cf96a39 Merge "Fix secondary lock screen implementation such that DevicePolicyKeyguardService calls are made on the main (UI) thread." into rvc-dev am: eb31eb5bae am: 3190352ab0
Change-Id: Iccac40f64aa89cb5307ec86efc0f11492e89c498
2020-04-09 08:08:46 +00:00
Charles Chen
aac2a05518 Merge "Fix WindowContext leak" into rvc-dev am: 5c082c998f
Change-Id: I6683cb8b7dcf4aa57ff7f6d681fa41d88156abc6
2020-04-09 07:52:44 +00:00
Yvonne Jiang
c20ac39f27 Merge "Fix secondary lock screen implementation such that DevicePolicyKeyguardService calls are made on the main (UI) thread." into rvc-dev am: eb31eb5bae
Change-Id: I688c2644161c8c9aa0b375430dc67875efa1a10f
2020-04-09 07:50:45 +00:00
Charles Chen
5c082c998f Merge "Fix WindowContext leak" into rvc-dev 2020-04-09 07:39:29 +00:00
Yvonne Jiang
eb31eb5bae Merge "Fix secondary lock screen implementation such that DevicePolicyKeyguardService calls are made on the main (UI) thread." into rvc-dev 2020-04-09 07:26:48 +00:00
TreeHugger Robot
9536de2cb4 Merge "Make OPSTR_MANAGE_EXTERNAL_STORAGE test API" into rvc-dev am: ffce5f2b7c am: 753638650e am: ff79d60437 am: a195939fa3
Change-Id: I998fc2069e19e52705b5bd27add25ae52aa9f803
2020-04-09 00:13:49 +00:00