Fixed
Status Update
Comments
ki...@google.com <ki...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit c46d3e79b2ea8b839358f0215b0a432ef8fad7a2
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 15:23:25 2022
Convert androidx.activity.Cancellable to kotlin
Test: ./gradlew activity:activity:cC
Bug: 257291701
Change-Id: I057f3e54811e7399e40083ef5e3915adc4fa425d
M activity/activity/src/main/java/androidx/activity/Cancellable.kt
https://android-review.googlesource.com/2288554
Branch: androidx-main
commit c46d3e79b2ea8b839358f0215b0a432ef8fad7a2
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 15:23:25 2022
Convert androidx.activity.Cancellable to kotlin
Test: ./gradlew activity:activity:cC
Bug: 257291701
Change-Id: I057f3e54811e7399e40083ef5e3915adc4fa425d
M activity/activity/src/main/java/androidx/activity/Cancellable.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 7fd8a3206a49baefee8340f0839fcd4de7716788
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 15:13:23 2022
Rename androidx.activity.Cancellable from .java to .kt
Test: n/a
Bug:257291701
Change-Id: I7f2ff8ce79af41c6437fb9a0f1be90e8990495e8
M activity/activity/src/main/java/androidx/activity/Cancellable.kt
https://android-review.googlesource.com/2288553
Branch: androidx-main
commit 7fd8a3206a49baefee8340f0839fcd4de7716788
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 15:13:23 2022
Rename androidx.activity.Cancellable from .java to .kt
Test: n/a
Bug:257291701
Change-Id: I7f2ff8ce79af41c6437fb9a0f1be90e8990495e8
M activity/activity/src/main/java/androidx/activity/Cancellable.kt
il...@google.com <il...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 4d21e0a45f19ed238ef30756f576930af07449c2
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 13:25:08 2022
Convert ActivityResultCallback to kotlin
Including clean up in test usages of this interface
Test: ./gradlew activity:activity:cC
Bug: 257291701
Relnote: Converted ActvitiyResultCallback to kotlin. Maintains source and binary comptability.
Change-Id: Ifc5e5e1a9a7ed4e281007830fb8d4c74237c63ce
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultRegistryTest.kt
M activity/activity/src/main/java/androidx/activity/result/ActivityResultCallback.kt
https://android-review.googlesource.com/2288334
Branch: androidx-main
commit 4d21e0a45f19ed238ef30756f576930af07449c2
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 13:25:08 2022
Convert ActivityResultCallback to kotlin
Including clean up in test usages of this interface
Test: ./gradlew activity:activity:cC
Bug: 257291701
Relnote: Converted ActvitiyResultCallback to kotlin. Maintains source and binary comptability.
Change-Id: Ifc5e5e1a9a7ed4e281007830fb8d4c74237c63ce
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/result/ActivityResultRegistryTest.kt
M activity/activity/src/main/java/androidx/activity/result/ActivityResultCallback.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit ae5bcbc9174b9767f143bfd9629a69fcd3ed325d
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 13:06:36 2022
Rename ActivityResultCallback from .java to .kt
Test: n/a
Bug: 257291701
Change-Id: I43a8c76cb51e3eee4a1ec2cb6f0128753d85965d
M activity/activity/src/main/java/androidx/activity/result/ActivityResultCallback.kt
https://android-review.googlesource.com/2288333
Branch: androidx-main
commit ae5bcbc9174b9767f143bfd9629a69fcd3ed325d
Author: Clara Fok <clarafok@google.com>
Date: Fri Nov 04 13:06:36 2022
Rename ActivityResultCallback from .java to .kt
Test: n/a
Bug: 257291701
Change-Id: I43a8c76cb51e3eee4a1ec2cb6f0128753d85965d
M activity/activity/src/main/java/androidx/activity/result/ActivityResultCallback.kt
Description
1. Add a menu to the activity
2. Override the onMenuOpened callback
3. Tap the overflow menu
Notice that callback was invoked with the null menu, despite the signature having a NonNull annotation
Kotlin apps might get a crash if they treated the platform type as non-null or a type-mismatch warning if the menu argument is declared as nullable and super.onMenuOpened is invoked.
10-17 10:37:16.152 E/AndroidRuntime( 843): Process: some.package, PID: 843
10-17 10:37:16.152 E/AndroidRuntime( 843): java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter menu
10-17 10:37:16.152 E/AndroidRuntime( 843): at some.activity.onMenuOpened(Unknown Source:2)
10-17 10:37:16.152 E/AndroidRuntime( 843): at androidx.appcompat.view.WindowCallbackWrapper.onMenuOpened(WindowCallbackWrapper.java:104)
10-17 10:37:16.152 E/AndroidRuntime( 843): at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.onMenuOpened(AppCompatDelegateImpl.java:2868)
10-17 10:37:16.152 E/AndroidRuntime( 843): at androidx.appcompat.view.WindowCallbackWrapper.onMenuOpened(WindowCallbackWrapper.java:104)
10-17 10:37:16.152 E/AndroidRuntime( 843): at androidx.appcompat.app.ToolbarActionBar$ActionMenuPresenterCallback.onOpenSubMenu(ToolbarActionBar.java:560)
10-17 10:37:16.152 E/AndroidRuntime( 843): at androidx.appcompat.view.menu.BaseMenuPresenter.onSubMenuSelected(BaseMenuPresenter.java:221)
10-17 10:37:16.152 E/AndroidRuntime( 843): at androidx.appcompat.widget.ActionMenuPresenter.showOverflowMenu(ActionMenuPresenter.java:345)
10-17 10:37:16.152 E/AndroidRuntime( 843): at androidx.appcompat.widget.ActionMenuPresenter$OverflowMenuButton.performClick(ActionMenuPresenter.java:681)
10-17 10:37:16.152 E/AndroidRuntime( 843): at android.view.View.performClickInternal(View.java:6574)
10-17 10:37:16.152 E/AndroidRuntime( 843): at android.view.View.access$3100(View.java:778)
10-17 10:37:16.152 E/AndroidRuntime( 843): at android.view.View$PerformClick.run(View.java:25885)
10-17 10:37:16.152 E/AndroidRuntime( 843): at android.os.Handler.handleCallback(Handler.java:873)
10-17 10:37:16.152 E/AndroidRuntime( 843): at android.os.Handler.dispatchMessage(Handler.java:99)
10-17 10:37:16.152 E/AndroidRuntime( 843): at android.os.Looper.loop(Looper.java:193)
10-17 10:37:16.152 E/AndroidRuntime( 843): at android.app.ActivityThread.main(ActivityThread.java:6669)
10-17 10:37:16.152 E/AndroidRuntime( 843): at java.lang.reflect.Method.invoke(Native Method)
10-17 10:37:16.152 E/AndroidRuntime( 843): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
10-17 10:37:16.152 E/AndroidRuntime( 843): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Upon investigation it appears the ActionMenuPresenter invokes the callback with the null menu to indicate that the menu is opening:
// ActionMenuPresenter uses null as a callback argument here
// to indicate overflow is opening.
super.onSubMenuSelected(null);