Status Update
Comments
ch...@google.com <ch...@google.com> #2
First of all thanks for this detailed issue.
This issue had been investigated thoroughly when it was first reported internally. The surprising detail in this report is that the issue is not reproducible before 1.7
. I will look into this.
The main problem with POBox is the fact that it is deprecated. Since 2021 Sony has been shipping new Xperia devices with Gboard pre-installed. Although we are aware that there is still a considerable amount of users still using POBox, the described behavior is caused by POBox's noncompliant behavior with InputConnection
and InputMethodManager
documentation. However, this is understandable since TextView
implementation was also not respecting the behavior that is expected from Editors.
Ultimately we have decided to enforce the documented behavior with specifically regards to when editors should call InputMethodManager.updateSelection
. Also, although unconfirmed, there were traces of possible custom code being included in Sony OEM images that changed how InputMethodManager was notified from TextView. If POBox also depended on something like this, it would be impossible for Compose code to replicate the same unknown behavior.
lp...@google.com <lp...@google.com> #3
Or is that option not available?
Even if the root cause is POBox, from the perspective of the app's customers, it looks like an app bug, so this issue is a blocker against updating Jetpack Compose.
ch...@google.com <ch...@google.com> #4
Just to be sure, it is dangerous to replace Compose TextField with Android View EditText as a workaround for this issue.
Compose 1.7 has a bug that causes ANR when the focus is on EditText.
Another View-related bug in Compose 1.7 is that an Android View is focused by calling FocusManager.clearFocus().
Perhaps there is a lack of testing of Compose 1.7 in combination with Android View. There is also a possibility that there are other fatal bugs related to View.
In other words, the only options for apps targeting the Japanese market that require POBox support are to continue using Compose 1.6 or to use EditText in combination with various workarounds.
lp...@google.com <lp...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Halil Ozercan <
Link:
Fix POBox keyboard issue
Expand for full commit details
Fix POBox keyboard issue
Fix: 373743376
Fix: 329209241
Test: NullableInputConnectionWrapperTest
Change-Id: I94e0e598274fb88b255f977f9fbd50dfbbb1ecb1
Files:
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapperTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapper.android.kt
Hash: 57f58c4b80d5d8470b2aca325dfdcd55f235231e
Date: Thu Oct 24 01:25:20 2024
ch...@google.com <ch...@google.com> #6
Many thanks again for this report. Especially for giving us a huge clue in terms of what could be going wrong. The fix is now merged and I will ask for a cherry-pick into a stable release.
ap...@google.com <ap...@google.com> #7
Do you have any concrete plan to cherry-pick the fix into current stable version (1.7.x)? We are currently waiting it.
an...@gmail.com <an...@gmail.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
le...@google.com <le...@google.com> #9
Thanks for the fix. Sorry to follow up on this. is it possible for you to share specific release version/date for the stable version? We are waiting on this to decide on our direction.
le...@google.com <le...@google.com>
ap...@google.com <ap...@google.com> #10
Branch: androidx-master-dev
commit 797bd0cda4fd10a1d9d8b3b06b5954644a200334
Author: Leland Richardson <lelandr@google.com>
Date: Thu May 07 15:16:51 2020
Turn on Function-body-based code generation strategy
Relnote: “
Changes the code generation strategy of Compose’s compiler. Prior to the change, the compose compiler would transform calls to composable functions. With this change, we now transform the body of a composable function and leave the callsite unaltered (mostly).
This means that most of the logic communicating with the compose runtime happens at the start of the function body, instead of at the callsite.
This should be a source-compatible change for all usage of compose. Most users of compose should not have to update any code as a result of this change.
In order to support this work, the JVM signature of all composable functions has changed. A Composable function accepting a single parameter is transformed into a function accepting 3 parameters, the additional parameters are the Composer, a ‘key’ integer. a bitmask integer used to propagate metadata through calls.
Compose now also transforms default arguments to a composable function. It does this without introducing an additional synthetic default overload of the function itself, so this change will result in fewer functions being defined.
Known intentional behavioral changes resulting from this:
1. Some calls will skip where they wouldn’t have previously
2. Composable expressions in default argument expressions are now correctly subscribed to and handled
This work included some optimizations:
1. The result of comparisons of parameters are propagated through the call graph to other composable functions. This will result in fewer comparisons at runtime, reduces the slot table size, as well as more skipping of composable functions that were previously not skipped
2. Paremeters which are determined to be “static” at compile time are no longer compared or stored in the runtime. This reduces the number of comparisons and reduces slot table size.
3. Control flow structure of the body of functions is used to minimize the number of groups that are generated. This reduces slot table size and results in less work for the runtime
4. Unused dispatch and receiver parameters to functions are not included in determining skippability of the function if they are not used inside of the body of the function.
Most breaking changes were for APIs that the compiler targets directly, and typical use of compose will not be affected:
1. Composer::startExpr was removed
2. Composer::endExpr was removed
3. Composer::call was deprecated
4. The non-varargs overloads of `key` have been removed. Use the `vararg` version going forward.
5. The Pivotal annotation was deprecated. Use `key` as a replacement.
6. ScopeUpdateScope::updateScope was changed to expect a Function3 instead of Function1
7. restartableFunction and restartableFunctionN were updated to include additional compile time parameters
“
Bug: 144283149
Bug: 144283416
Bug: 144283245
Bug: 150777987
Bug: 143464846
This effort has been a work in progress for some time, and much of the work has
been done in the following previous commits:
Make ComposableFunctionBodyTransformer work for any number of parameters
Icc265a253c629f5533f1e68e5109db67234311f9
Generate Movable groups with key and handle dynamic groups properly
I5fe7799eb303dadbbdd47d71fe764767407c4ae2
Function Body Skipping and Comparison Propagation
I2ee971458ea466ba070dff25da5a4f60d42ff678
Add Default Parameter IR Transform
If530f61034b284bb3e1a8919e2b0be2511e2f243
Handle Break/Continue in Control Flow Codegen
I2c2c3261886ab8936baeb8a5b5e6b8f5e9e8d409
Allow for early returns in control flow codegen
If6446a90b7364a31ae67816595408c0aa971a39a
Add ControlFlowTransformer WIP and tests
I1f96ab3e11e3f26bf4f9e375e00420d25463510d
Change-Id: I607560574d83b4b6c1e68ff72cc4124c5f8c2602
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/AbstractIrTransformTest.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/AbstractLoweringTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposeCallLoweringTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposeMultiPlatformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposerParamSignatureTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ComposerParamTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/ControlFlowTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/DefaultParamTransformTests.kt
A compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/EmitTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FcsCodegenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FcsModelCodeGenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FunctionBodySkippingTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxCrossModuleTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxModelCodeGenTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/KtxTransformationTest.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/RobolectricComposeTester.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeEmitResolver.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeFqNames.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/ComposeIrGenerationExtension.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/KtxNameConventions.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/AbstractComposeLowering.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableCallTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableFunctionBodyTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableTypeRemapper.kt
D compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposeObservePatcher.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposerIntrinsicTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposerParamTransformer.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/IrSourcePrinter.kt
M compose/compose-runtime/api/0.1.0-dev12.txt
M compose/compose-runtime/api/current.txt
M compose/compose-runtime/api/public_plus_experimental_0.1.0-dev12.txt
M compose/compose-runtime/api/public_plus_experimental_current.txt
M compose/compose-runtime/api/restricted_0.1.0-dev12.txt
M compose/compose-runtime/api/restricted_current.txt
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/siblings/SiblingManagement.kt
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/PivotalSamples.kt
M compose/compose-runtime/src/androidMain/kotlin/androidx/compose/KeySourceInfo.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Composer.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Key.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/Pivotal.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/SlotTable.kt
M compose/compose-runtime/src/commonMain/kotlin/androidx/compose/internal/RestartableFunction.kt
M compose/compose-runtime/src/jvmMain/kotlin/androidx/compose/internal/RestartableFunctionN.kt
M ui/ui-core/src/androidTest/java/androidx/ui/core/AndroidPointerInputTest.kt
M ui/ui-core/src/main/java/androidx/ui/core/ComposedModifier.kt
M ui/ui-core/src/main/java/androidx/ui/core/focus/FocusModifierImpl.kt
M ui/ui-core/src/main/java/androidx/ui/res/FontResources.kt
M ui/ui-core/src/test/java/androidx/ui/core/ComposedModifierTest.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/BoundsTest.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/InspectableTests.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/ModifierInfoTest.kt
M ui/ui-tooling/src/main/java/androidx/ui/tooling/preview/PreviewUtils.kt
le...@google.com <le...@google.com>
lp...@google.com <lp...@google.com> #11
Still seeing this in the demo app, switching from light -> dark theme doesn't cause the app bar to change color. But if I manually do:
val color = MaterialTheme.colors.primarySurface
TopAppBar(
...
backgroundColor = color,
...
)
(manually writing the default value)
Then this works correctly again.
tc...@google.com <tc...@google.com> #12
ap...@google.com <ap...@google.com> #13
Branch: androidx-master-dev
commit 458aaff814870edec3837f3ebe343f197a198697
Author: Leland Richardson <lelandr@google.com>
Date: Mon Jun 08 15:00:32 2020
Prevent non-static default expressions from being treated as static
Fixes: 143464846
Change-Id: I26c8a7f54581c38aede45c5db2f2a2a4ee2e39df
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/DefaultParamTransformTests.kt
M compose/compose-compiler-hosted/integration-tests/src/test/java/androidx/compose/plugins/kotlin/FunctionBodySkippingTransformTests.kt
M compose/compose-compiler-hosted/src/main/java/androidx/compose/plugins/kotlin/compiler/lower/ComposableFunctionBodyTransformer.kt
Description
```
@Composable
fun FooComponent(number: Int = +ambient(NumberAmbient)) {
...
}
NumberAmbient.Provider(someChangingValue) {
FooComponent()
}
```
When the ambient value changes, because the ambient is being consumed inside the default value it looks like we are not correctly generating the code / observing changes to this ambient, so when we go to compare parameters, (my assumption is that) we see that no parameters have changed, and hence do not recompose.
The workaround is explicitly adding the `+ambient` consumption to the function body, and not in the default value, but then this defeats the point of default values. This currently causes smaller components that contain only comparable parameters, such as ProgressIndicators, to not recompose when the colour in the theme changes.