Commit Graph

1154 Commits

Author SHA1 Message Date
Alex Chau
9a42318fcd Merge "Ensure SensorManager is destroyed on Launcher activity destruction" 2022-01-11 10:42:32 +00:00
Alex Chau
1a3c645186 Ensure SensorManager is destroyed on Launcher activity destruction
- Add back necessary destroy call chain

Fix: 210114103
Test: labtest
Change-Id: I96bf525fe3730e7bf6b4c1042c18ef96622248fd
2022-01-07 17:26:46 +00:00
Nicolo' Mazzucato
2e4d663ee0 Create FoldStateLoggingProvider
The aim of this class it to output fold state changes with the time between them.
Those will be logged in a follow up change to uptimize fold/unfold experience.

+ Changed files have been reformatted according to ktfmt. Those are minimal changes.
+ Making some return type explicit in dagger modules

Bug: 198305865
Test: atest FoldStateLoggingProviderTest
Change-Id: I3dcfa742f2cf3c712796b5c6f5481f319b680a12
2022-01-07 14:47:37 +01:00
TreeHugger Robot
5223943b0e Merge "Replace aborted with half_open in FoldStateProvider" 2022-01-06 18:27:27 +00:00
Nicolo' Mazzucato
b680365e1f Replace aborted with half_open in FoldStateProvider
All FOLD_UPDATE_ABORTED emissions were due to device stuck in half opened state.

This will allow us to log FULL_OPEN, HALF_OPEN and FULL_CLOSED states easily.

+ Removed some unused states.
+ DeviceFoldStateProviderTest.kt formatted with ktfmt

Bug: 198305865
Test: atest DeviceFoldStateProviderTest
Change-Id: Iadbe4bdc4cbdf2720efb46fbd69cfadf0b8357a8
2022-01-06 16:55:10 +01:00
TreeHugger Robot
5a6ec22676 Merge "Quick fix for NullPointerException 211713013" into sc-v2-dev am: b7f37cd797 am: 19516a0496
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16569980

Change-Id: I4842f7c2e4e74a29f6b1868838dfb6d9d3b49158
2022-01-06 00:31:28 +00:00
TreeHugger Robot
19516a0496 Merge "Quick fix for NullPointerException 211713013" into sc-v2-dev am: b7f37cd797
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16569980

Change-Id: I6c8bce01aa621ad8c09c5c2f1bed93e8de3c3b17
2022-01-06 00:27:03 +00:00
Sebastian Franco
76f9cda458 Quick fix for NullPointerException 211713013
Test: Manually tested
Fix: 211713013
Change-Id: Ie701bee61a69d88cc9fce12c9d001a52f30578c4
2022-01-05 19:54:40 +00:00
Nicolo' Mazzucato
f2b97883aa Trace fold/unfold animation with atrace
This cl adds an always present listener to UnfoldTransitionProgressProvider to log a trace when the animation is running, and it's progresses with a counter.

Bug: 203391751
Test: Traced with perfetto on top of this change and verified it is present as expected
Change-Id: I04062587b47a6238d969dc196ce06bb712ed0840
2022-01-04 18:10:17 +01:00
Jerry Chang
8959d0b139 Fix back to split pair from overview with shell-transition hang.
Prevent it throws index out of bounds exception when entering split pair
from overview panel. And make sure to update split screen state properly
when enter split transition got merged to other transition.

Fix: 210852531
Bug: 206487881
Test: Trigger split screen, swipe up to overview, verified it won't hang
      when select split pair from overview panel.
Change-Id: Ifc5c224b7185224b811e6e2e7fa5d798c99bc6b1
2021-12-22 04:58:37 +00:00
Vinit Nayak
255e26e865 Merge "Add API to get multiple running tasks for split" into sc-v2-dev am: 3a91691eb6 am: 4dde648761
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16482617

Change-Id: I49acf0d87915ba02dfa3c2f2c4f17cc86161f89d
2021-12-16 00:54:45 +00:00
Vinit Nayak
4dde648761 Merge "Add API to get multiple running tasks for split" into sc-v2-dev am: 3a91691eb6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16482617

Change-Id: I368b4025726bda6b2315dd2a4d6205311eef4189
2021-12-16 00:36:17 +00:00
Vinit Nayak
e4dd959073 Add API to get multiple running tasks for split
Bug: 205675364
Change-Id: Ia350e443b6b80ca8af2d546cb35cad23b212d86e
2021-12-15 13:14:47 -08:00
Shuming Hao
e68f21997e Merge "Implement toggle notification panel for new buttons in taskbar" 2021-12-15 16:49:19 +00:00
TreeHugger Robot
9975e2c412 Merge "Add ACTION_SWITCH_DISPLAY_UNFOLD to LatencyTracker" 2021-12-15 14:34:40 +00:00
Tracy Zhou
741c3d7b7b Add haptic feedback to rotation button am: eab69869a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16465449

Change-Id: Ic386ca454ddbeb2c53146c923aca10a20f8ce4db
2021-12-15 06:15:24 +00:00
Tracy Zhou
eab69869a0 Add haptic feedback to rotation button
Fixes: 205503732
Test: tap rotation button in vibration only mode
Change-Id: I8fe29afc03353943b56fea9e80618441f7bca174
(cherry picked from commit 8f30dd7aea)
2021-12-15 03:40:22 +00:00
Tracy Zhou
6cb7638137 Merge "Add haptic feedback to rotation button" 2021-12-15 03:39:55 +00:00
Nicolo' Mazzucato
ea41bd1c52 Add ACTION_SWITCH_DISPLAY_UNFOLD to LatencyTracker
Thanks to this, we will be able to create a dashboard of the time needed to turn on the screen after unfolding the device.

Test: atest DeviceFoldStateProviderTest
Test: atest KeyguardViewMediatorTest
Test: atest UnfoldLatencyTrackerTest
Bug: 209963184
Change-Id: I078be6431e1053bd9658b5756ab2d54f6f28c630
2021-12-14 21:57:48 +01:00
Tracy Zhou
8f30dd7aea Add haptic feedback to rotation button
Fixes: 205503732
Test: tap rotation button in vibration only mode
Change-Id: I8fe29afc03353943b56fea9e80618441f7bca174
2021-12-14 14:38:52 +08:00
Winson Chung
4f21beb568 Merge "Expose recents animation targets pre-rotation bounds" 2021-12-13 05:29:09 +00:00
Shuming Hao
a549d1d2ae Implement toggle notification panel for new buttons in taskbar
This CL adds toggle notification panel function for new buttons in Kingyo taskbar.

Bug: 199333223
Test: m, verify that clicking the new buttons will expand/collapse quick settings and notification panel

Recall: http://recall/clips/993bc14b-98a7-4d7d-98c4-17ba271d4da9
Change-Id: Iacec5b4aa1ea6d89e084c0a7c91ee62d2bbba8ae
2021-12-10 16:58:36 -08:00
Songchun Fan
5e303008b4 Merge "[pm] new APIs for ApplictaionInfo/PackageInfo/ComponentInfo/ResolveInfo flags" 2021-12-10 16:08:09 +00:00
Hongwei Wang
827556ca5a Merge "Fix the transition from Split to PiP" into sc-v2-dev am: 54fed092f8 am: df3e2e6be8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16418705

Change-Id: I3f1abb78032b7edae240827ae456722a41bb3479
2021-12-10 09:01:08 +00:00
Hongwei Wang
df3e2e6be8 Merge "Fix the transition from Split to PiP" into sc-v2-dev am: 54fed092f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16418705

Change-Id: I6b1fba80348615129bcabf11debd19a758b8e41c
2021-12-10 08:45:42 +00:00
Hongwei Wang
d4848611d2 Fix the transition from Split to PiP
- Do not bring split to top on entering PiP
  When swiping up to home (or other cases) triggers one of the
  split-screen children enters PiP, do not try to bring the other task
  to top since the pair should be considered invisible.
- When entering PiP from split screen or non-auto PiP case, use the
  alpha information in PictureInPictureSurfaceTransaction to hide the
  task which would later be turned back on to avoid flicker.

Bug: 190855091
Bug: 205894095
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/42RWtayanp2qG0mHSf4Q5
Test: manual, enter PiP from split-screen, see Video
Change-Id: I1559748cd583c20d79ee458822d66e7801733d3a
2021-12-09 21:07:45 -08:00
Winson Chung
a34abedbe6 Expose recents animation targets pre-rotation bounds
Bug: 197687032
Test: Enable shell transitions and swipe up from a landscape app into
      force-portrait Launcher

Change-Id: I2a35567ee0afe8a413c4feb37d6ab1d307498c5a
2021-12-09 01:41:51 +00:00
TreeHugger Robot
5df9de8baf Merge changes from topic "jeffdq_flag_proposal"
* changes:
  Generalize some flag manager methods by flag type.
  FeatureFlags Listeners:
2021-12-08 23:34:48 +00:00
TreeHugger Robot
57563e46d4 Merge "Improve fold state provider logic handling posture" into sc-v2-dev am: 9a33c9de70 am: 51d4883620
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16380166

Change-Id: Iedbb418d902d7245536c3682c9b9f947076a38d1
2021-12-08 17:19:34 +00:00
TreeHugger Robot
51d4883620 Merge "Improve fold state provider logic handling posture" into sc-v2-dev am: 9a33c9de70
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16380166

Change-Id: Idef48440e720f0470a8dec6844ce3b4d660a2038
2021-12-08 17:01:42 +00:00
Jeff DeCew
3b6176a6bd Generalize some flag manager methods by flag type.
Bug: 209081785
Test: atest FeatureFlagsDebugTest FlagManagerTest
Change-Id: Ie92667e33e7c086258cdd03e7b9ebccdefef5938
2021-12-08 15:48:53 +00:00
Jeff DeCew
595956489d FeatureFlags Listeners:
* Convert FlagReader interface to FlagListenable.
* Move Flag reading to FeatureFlags interface.
* Remove isEnabled(id, boolean) from all interfaces; make private in implementations where used.

Bug: 209081785
Test: atest FlagManagerTest
Change-Id: I8c90a67def242b5d2fa55d5effab8270ecafabb4
2021-12-08 15:11:13 +00:00
Nicolo' Mazzucato
5aef2c1fab Improve fold state provider logic handling posture
Now FOLD_UPDATE_START_CLOSING event is emitted when the angle decreases.
After each angle update, a timeout is started to finish the animation.
When the timeout is reached, FOLD_UPDATE_ABORTED is emitted.

The timeout logic has been moved from
PhysicsBasedUnfoldTransitionProgressProvider to DeviceFoldStateProvider.

This change should not create problems to
FixedTimingTransitionProgressProvider, as it doesn't use any
intermediate FOLD_UPDATE event.

Test: Locally on device
Test atest com.android.systemui.unfold.updates.DeviceFoldStateProviderTest
Bug: 208977663
Change-Id: Ibc5df1e089d6543e7cf6ee2e0ce3d48a0b24cc07
2021-12-08 11:09:36 +01:00
Evan Rosky
5930f8a31a Merge "Use the correct TransitionINfo when creating recent leashes" 2021-12-03 17:32:35 +00:00
Dave Mankoff
b117df1dbf Merge "Better support for Resource based flags." 2021-12-03 15:26:13 +00:00
Nicolò Mazzucato
ab1a8a8fc4 Merge "Disable unfold animation when animations disabled" into sc-v2-dev am: b6815ae344 am: d07dc67f9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16378723

Change-Id: I8cf3166e123aefa2a7741b9586288caaca9c1308
2021-12-03 13:57:33 +00:00
Nicolò Mazzucato
d07dc67f9e Merge "Disable unfold animation when animations disabled" into sc-v2-dev am: b6815ae344
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16378723

Change-Id: I1febabbf23ade790a957a9000eed1a1edf2f980a
2021-12-03 13:43:17 +00:00
Nicolo' Mazzucato
4a0cad571a Disable unfold animation when animations disabled
When AnimatorScale is set to zero (possible from settings),
the fold animation is disabled.

The change to UnfoldLightRevealOverlayAnimation is needed
because the overlay view is added independently from
UnfoldTransitionProgressProvider callbacks every time the
internal screen is turned on.

Test: Tested on device &&
   atest com.android.systemui.unfold.util.ScaleAwareUnfoldProgressProviderTest
Bug: 208791440
Change-Id: Icda9ed6d708873768c4ac533b9c790ae1631b45c
2021-12-03 13:15:23 +00:00
Dave Mankoff
62ac77294a Better support for Resource based flags.
Introduce ResourceFlag class and ParcelableFlag classes, from which
other flag types are based.

ResourceFlags always pull there default values out of
context.getResources. They can not, however, be directly
serialized and sent to the flag app.

For that, we now have ParcelableFlag. Prior to this change, we
were not properly alerting the Flag app about the current value of
flags when it asked. This change now also fixes that.

All flags are coerced into ParcelableFlag before being sent to the
app.

Note that ResourceFlags perform runtime logic, even in release builds,
meaing that the opportunity for optimizing them at compile time is
much smaller. Tools such as proguard will not have the opportunity
to strip them out entirely.

Bug: 203548827
Test: atest SystemUITests
Change-Id: I3c37ccae16c00237f9cffffc9c22580454ecb8cc
2021-12-02 22:55:22 -05:00
Evan Rosky
ad7d5d34b8 Use the correct TransitionINfo when creating recent leashes
Was using the wrong info which caused a crash.

Bug: 208925002
Test: launch portrait activity, go to recents, launch landscape-only activity.
Change-Id: I48153f5eda8d027dd9126fe9d7136247959d3e35
2021-12-02 19:51:43 -08:00
Songchun Fan
cf3f673b48 [pm] new APIs for ApplictaionInfo/PackageInfo/ComponentInfo/ResolveInfo flags
We are running out of int flags for public API methods such as
PackageManager.getPackageInfo(String packageName, int flags). As a
solution, we will change the flags param to Flags objects. At the
same time, we deprecate the old methods that directly use int flags.

The new flags classes are: ApplicationInfoFlags, PackageInfoFlags,
ComponentInfoFlags and ResolveInfoFlags. Because there are already
annotations of the same names, we renamed the annotations to *FlagsBits.

Old API usage example:
getPackageInfo(pkgName, MATCH_UNINSTALLED_PACKAGES)

New API usage example:
getPackageInfo(pkgName, PackageInfoFlags.of(MATCH_UNINSTALLED_PACKAGES))

See b/204433742 for discussions.

CTS-Coverage-Bug: 206147270
BUG: 204432643
BUG: 204433659
Test: manual
Change-Id: I8ab2adad6907670c5879c043d170c950afefe46c
2021-12-02 15:35:51 -08:00
Nicolo' Mazzucato
8c7ad03ea8 Convert ScopedUnfoldTransitionProgressProvider.java to kotlin
Test: NaturalRotationUnfoldProgressProviderTest
Bug: 208791440
Change-Id: I6b2f0fba5ab72aa1561403ed19ff71154f602d9e
2021-12-02 17:51:32 +01:00
TreeHugger Robot
7d960ede6d Merge "Handle configuration changes in floating rotation button" into sc-v2-dev am: 294c3c12fc am: 7fe996963f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16343965

Change-Id: Ia4b740900f7ab1c1b1c842ae7886befbfc83a5c0
2021-11-29 20:19:02 +00:00
TreeHugger Robot
7fe996963f Merge "Handle configuration changes in floating rotation button" into sc-v2-dev am: 294c3c12fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16343965

Change-Id: I02a4056792e208f1374fadf90b444d3661ac01ec
2021-11-29 19:58:51 +00:00
TreeHugger Robot
294c3c12fc Merge "Handle configuration changes in floating rotation button" into sc-v2-dev 2021-11-29 19:41:19 +00:00
Nick Chameyev
c487edc5a9 Handle configuration changes in floating rotation button
Update resources in floating rotation button
when configurations such as screen density, screen size,
current locale have changed.

Bug: 200103245
Test: change display size, locale, fold/unfold
 -> check that floating rotation button resources
    are updated
Change-Id: I140eeaf6df3dcca2fca42d5f9dd44ab59d068e57
2021-11-29 15:42:52 +00:00
Riddle Hsu
67714172db Merge "Do not skip restoring rotation lock when returning to home" into sc-v2-dev am: 49794ebb48 am: 669edf2083
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16334320

Change-Id: I8390ba655923f8a495d98b496e1b304e3bbbefe9
2021-11-25 02:52:13 +00:00
Riddle Hsu
669edf2083 Merge "Do not skip restoring rotation lock when returning to home" into sc-v2-dev am: 49794ebb48
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16334320

Change-Id: Ic0076cdb9c39381977121463a364cd1253c9e681
2021-11-25 02:35:31 +00:00
Riddle Hsu
49794ebb48 Merge "Do not skip restoring rotation lock when returning to home" into sc-v2-dev 2021-11-25 02:20:20 +00:00
Riddle Hsu
3549a251fc Do not skip restoring rotation lock when returning to home
Since live-tile is enabled, the foreground app is still the original
activity, the display rotation doesn't change by the recents app
activity. So the condition added in commit 95cb52a doesn't need to
be enabled.

Bug: 205979005
Test: 1. Disable auto-rotation and home rotation.
      2. Launch an activity in portrait.
      3. Rotate the device to landscape and press rotation button.
      4. Enter overview (recents).
      5. Return to the application (keep in landscape).
      6. Return to home and launch the app again (restore to portrait).
Change-Id: Iccf87b2d66d57911cd49f2ea9080a71a85801e4c
2021-11-24 17:31:24 +08:00