Status Update
Comments
el...@gmail.com <el...@gmail.com> #2
to...@gmail.com <to...@gmail.com> #3
Branch: androidx-master-dev
commit a9b67eca31e73a3f975b53e22a9e5983e2d76864
Author: Filip Pavlis <pavlis@google.com>
Date: Thu Oct 01 15:32:27 2020
Add FLAG_SECURE on Dialog and Popup.
Added a new way on how to pass platform specific parameters for popups
and dialogs.
Also renamed children to content. And made expect / actual to be
internal for dialog as it is for popup.
Bug: 143778148
Bug: 143778149
Test: Added tests for both dialog and popup.
Relnote: "Popups and dialogs now inherit FLAG_SECURE from parent Window.
Also added option to configure this explicitly".
Change-Id: I649663482e91757df751315b03fee9867b580e96
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/AlertDialog.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/AndroidManifest.xml
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/window/DialogSecureFlagTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/window/PopupDismissTest.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/window/PopupSecureFlagTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/window/PopupTestUtils.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidDialog.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidPopup.kt
A compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/SecureFlagPolicy.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/selection/SelectionLayout.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/window/Dialog.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/window/Popup.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/DesktopDialog.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/DesktopPopup.kt
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #4
Thanks for your feedback! We have just landed a CL that enables to configure a FLAG_SECURE on a dialog. By default it will inherit it from window launching it, so all compose popups from now on should inherit the flag. The flag can be also configured for AlertDialog. This will be available in the next release.
ra...@google.com <ra...@google.com>
da...@gmail.com <da...@gmail.com> #5
I am tremendously grateful that you added fixes for this and
For testing purposes, by "the next release", do you mean alpha05
? I don't know when your internal cutoff is for what makes it into a particular release.
Thanks again!
ra...@google.com <ra...@google.com> #6
Sorry, yes you are right, alpha05
is the release that will have this change included. Thanks!
na...@google.com <na...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.4.3
he...@gmail.com <he...@gmail.com> #8
This bug still exists with androidx.compose.ui:ui:1.4.3
:
java.lang.IllegalStateException: Check failed.
at androidx.compose.ui.focus.FocusTargetModifierNode.fetchFocusProperties$ui_release(FocusTargetModifierNode.kt:197)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:189)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:192)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.findChildCorrespondingToFocusEnter--OM-vw8(TwoDimensionalFocusSearch.kt:103)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.twoDimensionalFocusSearch--OM-vw8(TwoDimensionalFocusSearch.kt:84)
at androidx.compose.ui.focus.FocusTraversalKt.focusSearch-sMXa3k8(FocusTraversal.kt:106)
at androidx.compose.ui.focus.FocusOwnerImpl.moveFocus-3ESFkO8(FocusOwnerImpl.kt:162)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1.invoke-ZmokQxo(AndroidComposeView.android.kt:206)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1.invoke(AndroidComposeView.android.kt:201)
at androidx.compose.ui.input.key.KeyInputModifierNodeImpl.onKeyEvent-ZmokQxo(KeyInputModifier.kt:80)
at androidx.compose.ui.focus.FocusOwnerImpl.dispatchKeyEvent-ZmokQxo(FocusOwnerImpl.kt:193)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:646)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1965)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1965)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1965)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1965)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:486)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1889)
at android.app.Activity.dispatchKeyEvent(Activity.java:4222)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:85)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:400)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6500)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6366)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5826)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5883)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5849)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6014)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5857)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6071)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5830)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5883)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5849)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5857)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5830)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5883)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5849)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6047)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6227)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3741)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:3261)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:3252)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3718)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:161)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
na...@google.com <na...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.5.0-alpha04
he...@gmail.com <he...@gmail.com> #10
Issue is fixed with 1.5.0-alpha04
pa...@geocaching.com <pa...@geocaching.com> #11
mr...@gmail.com <mr...@gmail.com> #12
pl...@google.com <pl...@google.com> #13
To the authors of
mr...@gmail.com <mr...@gmail.com> #14
FATAL EXCEPTION: main Process: sampleapp.tv.debug, PID: 10202 java.lang.IllegalStateException: Check failed. at androidx.compose.ui.focus.FocusTargetModifierNode.fetchFocusProperties$ui_release(FocusTargetModifierNode.kt:197) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:189) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:192) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.findChildCorrespondingToFocusEnter--OM-vw8(TwoDimensionalFocusSearch.kt:103) at androidx.compose.ui.focus.FocusRequester.focus$ui_release(FocusRequester.kt:74) at androidx.compose.ui.focus.FocusRequester.requestFocus(FocusRequester.kt:63) at androidx.tv.material3.NavigationDrawerKt$DrawerSheet$2$1.invokeSuspend(NavigationDrawer.kt:249) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7898) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@fc1e6d, androidx.compose.runtime.BroadcastFrameClock@1ec5aa2, StandaloneCoroutine{Cancelling}@8c2333, AndroidUiDispatcher@ad6b6f0]
mr...@gmail.com <mr...@gmail.com> #15
In my case its happening when using a NavigationDrawer from androidx.tv.material3. reproduction steps are easy, let the Navigation drawer gain focus and then move the focus to something else, try go back to Navigation drawer and boom!
pa...@geocaching.com <pa...@geocaching.com> #16
Good news - The crash is now resolved for us. We had been declaring each Compose dependency individually in our build.gradle. I updated all of our Compose dependencies to the latest available versions, including androidx.compose.ui:ui:1.5.0-alpha04. This did not resolve the issue for us. Finally, I switched over to using the Compose BoM (2023.04.01), and that fixed it! Interestingly, that version of the BoM is using version 1.4.2 of Compose UI. I hope this may help others who are still experiencing the crash.
pr...@google.com <pr...@google.com> #17
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-foundation:1.0.0-alpha07
ir...@gmail.com <ir...@gmail.com> #18
```kotlin
Box(
modifier = Modifier
.clickable(false) {}
) {
SelectionContainer {
Text(
text = value,
fontSize = 18.sp,
color = MaterialTheme.colors.normalTextColor,
overflow = TextOverflow.Ellipsis,
maxLines = 2
)
}
}
```
bb...@jeniusbank.com <bb...@jeniusbank.com> #19
To add to .clickable(enabled = true)
then the user long presses to highlight text, and the state is changed to false
, or if you change the text in some way (ex. from another button) an exception is thrown. This is the same exception that is thrown when long pressing and the .clickable
is set to false
java.lang.IllegalStateException: Cannot read CompositionLocal because the Modifier node is not currently attached.
Using a combinedClickable
in the same manner crashes with the same exceptions.
Description
1.4.0
1.8.10
Unfortunately I have not managed to create a reproducible example or certain steps to recreate this. I will update more details in response if I can find out more details.
Stack trace 1
In this case
moveFocus
was called by the framework in response to a key press.Stack trace 2
In this case
LocalFocusManager.current.moveFocus(FocusDirection.Enter)
was manually called from application code.Both traces seem to have
twoDimensionalFocusSearch
in the stack only once, which to my understanding would indicate the focus search is beginning from the root of the hierarchy. I am not yet familiar with the Modifier Node architecture, but this would seem to indicate that the root node is for some reason detached from the layout?