Infeasible
Status Update
Comments
ra...@google.com <ra...@google.com> #2
jo...@gmail.com <jo...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e465976de8f05f0d1db49b4e2887c9f3cd4beab5
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 17 17:07:42 2021
Add OnBackPressedDispatcher observer before NavController observer
If you add a OnBackPressed callback with the NavBackStackEntry as the
lifecycle owner, if the Activity Lifecycle is STOPPED and STARTED again, the navController callback and NavBackStackEntry callback are readded to the Activity Lifecycle in the wrong order. This means that the new callback will not properly intercept onBackPressed() calls from the system, they will instead be intercepted by NavController.
If an OnBackPressedDispatcher is set, we should remove and readd the
NavController observer after we add the callback to the dispatcher.
RelNote: "OnBackPressedCallbacks added to a dispatcher with the
NavBackStackEntry as the LifecycleOwner now properly intercept back
after the Activity Lifecycle is STOPPED, then STARTED"
Test: NavControllerTest
Bug: 182284739
Change-Id: I6acf78848546160eaea7ed700ef8875664a125d0
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/1643646
Branch: androidx-main
commit e465976de8f05f0d1db49b4e2887c9f3cd4beab5
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 17 17:07:42 2021
Add OnBackPressedDispatcher observer before NavController observer
If you add a OnBackPressed callback with the NavBackStackEntry as the
lifecycle owner, if the Activity Lifecycle is STOPPED and STARTED again, the navController callback and NavBackStackEntry callback are readded to the Activity Lifecycle in the wrong order. This means that the new callback will not properly intercept onBackPressed() calls from the system, they will instead be intercepted by NavController.
If an OnBackPressedDispatcher is set, we should remove and readd the
NavController observer after we add the callback to the dispatcher.
RelNote: "OnBackPressedCallbacks added to a dispatcher with the
NavBackStackEntry as the LifecycleOwner now properly intercept back
after the Activity Lifecycle is STOPPED, then STARTED"
Test: NavControllerTest
Bug: 182284739
Change-Id: I6acf78848546160eaea7ed700ef8875664a125d0
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
mo...@gmail.com <mo...@gmail.com> #4
This has been fixed internally and will be part of the Navigation 2.3.5
release (via 2.4.0-alpha01
).
ra...@google.com <ra...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit f231e0f384f9fd2e7a078bfcbeb7768c82c617b1
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 17 17:40:05 2021
Add BackHandler callback with a LifecycleOwner
We need to ensure that the callback from BackHandler remains in the
proper position in the event of Lifecycle changes.
RelNote: "The BackHandler will now properly intercept back presses in
the event that the Activity is STOPPED, then STARTED again, and other
callbacks were added with a LifecycleOwner."
Test: BackHandlerTest
Bug: 182284739
Change-Id: I71de6184ba73f56b34de9dcddaf138d98c46417f
M activity/activity-compose/build.gradle
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/BackHandlerTest.kt
M activity/activity-compose/src/main/java/androidx/activity/compose/BackHandler.kt
https://android-review.googlesource.com/1644062
Branch: androidx-main
commit f231e0f384f9fd2e7a078bfcbeb7768c82c617b1
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 17 17:40:05 2021
Add BackHandler callback with a LifecycleOwner
We need to ensure that the callback from BackHandler remains in the
proper position in the event of Lifecycle changes.
RelNote: "The BackHandler will now properly intercept back presses in
the event that the Activity is STOPPED, then STARTED again, and other
callbacks were added with a LifecycleOwner."
Test: BackHandlerTest
Bug: 182284739
Change-Id: I71de6184ba73f56b34de9dcddaf138d98c46417f
M activity/activity-compose/build.gradle
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/BackHandlerTest.kt
M activity/activity-compose/src/main/java/androidx/activity/compose/BackHandler.kt
ff...@gmail.com <ff...@gmail.com> #6
This has been addressed internally and will be available when using both the Activity 1.3.0-alpha06
and Navigation 2.3.5
releases.
ra...@google.com <ra...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit d1d6f89ba90be8e7fba193570b427f52ec98f57a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 31 09:40:42 2021
Make nav compose depend on Navigation 2.3.5
Upgrading to the latest Navigation version to take advantage of fixed
bugs, (particularly around OnBackPressedDispatcher and lifecycles
b/182284739 ).
RelNote: "Navigation-compose now depends on Navigation version `2.3.5`"
Test: ./gradlew bOS
Change-Id: I7e63b32c93deaee60b1d5e132d3fa255c3ba85e2
M navigation/navigation-compose/build.gradle
https://android-review.googlesource.com/1660640
Branch: androidx-main
commit d1d6f89ba90be8e7fba193570b427f52ec98f57a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 31 09:40:42 2021
Make nav compose depend on Navigation 2.3.5
Upgrading to the latest Navigation version to take advantage of fixed
bugs, (particularly around OnBackPressedDispatcher and lifecycles
RelNote: "Navigation-compose now depends on Navigation version `2.3.5`"
Test: ./gradlew bOS
Change-Id: I7e63b32c93deaee60b1d5e132d3fa255c3ba85e2
M navigation/navigation-compose/build.gradle
ra...@google.com <ra...@google.com> #8
does not work for me on '2.4.2'
val navController: NavHostController = rememberNavController()
HomeNavHost(navController = navController)
BackHandler(true) {
// code doesnt get called here
}
val navController: NavHostController = rememberNavController()
HomeNavHost(navController = navController)
BackHandler(true) {
// code doesnt get called here
}
ra...@google.com <ra...@google.com> #9
I got similar issue, after I run launcher (exp: select document), BackHandler no longer triggers
BackHandler{
action.onBack()
}
BackHandler{
action.onBack()
}
ky...@gmail.com <ky...@gmail.com> #10
to solve BackHandler no longer triggers after i run launcher, i am using this
@Composable
fun BaseBackHandler(onBackHandler: () -> Unit = {}) {
var refreshBackHandler by rememberSaveable { mutableStateOf(false) }
OnLifecycleEvent { _, event ->
when (event) {
Lifecycle.Event.ON_PAUSE -> {
refreshBackHandler = false
}
Lifecycle.Event.ON_RESUME -> {
refreshBackHandler = true
}
else -> {}
}
}
if (refreshBackHandler) {
BackHandler {
onBackHandler()
}
}
}
@Composable
fun BaseBackHandler(onBackHandler: () -> Unit = {}) {
var refreshBackHandler by rememberSaveable { mutableStateOf(false) }
OnLifecycleEvent { _, event ->
when (event) {
Lifecycle.Event.ON_PAUSE -> {
refreshBackHandler = false
}
Lifecycle.Event.ON_RESUME -> {
refreshBackHandler = true
}
else -> {}
}
}
if (refreshBackHandler) {
BackHandler {
onBackHandler()
}
}
}
Description
Description
When activating Google Assistant with the hotword "Hey Google" a screen with the notification "Still setting up 'Hey Google'" shows up on the watch. When activating Google Assistant with a button press on the watch the assistant starts normally and fully functional, so this is only related to the hotword activation. This can not be resolved by reinstallation of the apps or reinitialization of the voice match.
Device Info
Smartphone
Huawei VOG-L29
Kernel 4.14.116
Build 12.0.0.139
Assistant App 0.1.474378801
Play Services 22.44.17
Watch
Galaxy Watch 4 SM-R870
WearOS 3.5
Play Services 22.44..17
Wear Main 1.3.0.455404579
Wear Assistant App 1.1.51.474820069.release
Logcat snippet
Attachment