Fixed
Status Update
Comments
da...@google.com <da...@google.com> #2
Perhaps make a defensive copy of ApplicationInfo
or read the process name early in the process lifecycle as ApplicationInfo
is a mutable singleton.
pe...@avast.com <pe...@avast.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 0c92b8c8dd935872c4b425cae16f45ea0981226f
Author: Rahul Ravikumar <tikurahul@gmail.com>
Date: Thu Sep 17 10:38:46 2020
[GH] Use `ApplicationInfo` to determine the default app process name.
* Previously `context.getPackageName()` was used to determine the default app process name.
This is not always correct, because the app may have overriden the process name.
Fixes: b/168716641
Test: Ran integration tests.
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/78 .
Resolves #78
Github-Pr-Head-Sha: 4ee23d5b6fdaf7aa18a95a4289f15332d0209c93
GitOrigin-RevId: 9e113c7cdb36b37d4038f021ee691762c0feb132
Change-Id: I2add7f9b051e59ffb880b2fc5ffac220cf4b858e
M work/workmanager/src/main/java/androidx/work/impl/utils/ProcessUtils.java
https://android-review.googlesource.com/1429950
Branch: androidx-master-dev
commit 0c92b8c8dd935872c4b425cae16f45ea0981226f
Author: Rahul Ravikumar <tikurahul@gmail.com>
Date: Thu Sep 17 10:38:46 2020
[GH] Use `ApplicationInfo` to determine the default app process name.
* Previously `context.getPackageName()` was used to determine the default app process name.
This is not always correct, because the app may have overriden the process name.
Fixes:
Test: Ran integration tests.
This is an imported pull request from
Resolves #78
Github-Pr-Head-Sha: 4ee23d5b6fdaf7aa18a95a4289f15332d0209c93
GitOrigin-RevId: 9e113c7cdb36b37d4038f021ee691762c0feb132
Change-Id: I2add7f9b051e59ffb880b2fc5ffac220cf4b858e
M work/workmanager/src/main/java/androidx/work/impl/utils/ProcessUtils.java
da...@google.com <da...@google.com> #4
I ran the project in android studio with 28 and 29 TV emulator, cannot reproduce it.
ma...@avast.com <ma...@avast.com> #5
Yes, that is our experience as well.
We were not able to reproduce on emulator.
Only NVIDIA SHILED (android 9) & Xiaomi MiBOX (android 9).
da...@google.com <da...@google.com> #6
Okay, I can reproduce it on a physical device.
It's a bit hard to reproduce.
It's a bit hard to reproduce.
da...@google.com <da...@google.com> #7
+ilake
da...@google.com <da...@google.com> #8
I captured in debugger and found that in the crash stack when returning from fragment 2 to fragment 1.
FragmentStatementManager is calling fragment1.getFocusedView().requestFocus() when returning to fragment 1.
The "focusedView" is retained in Fragment.AnimationInfo but it belongs to the previous view tree that is supposed to be destroyed when navigate from fragment 1 to fragment 2.
focusedView.isAttachedToWindow is false as shown in the screenshot.
FragmentStatementManager is calling fragment1.getFocusedView().requestFocus() when returning to fragment 1.
The "focusedView" is retained in Fragment.AnimationInfo but it belongs to the previous view tree that is supposed to be destroyed when navigate from fragment 1 to fragment 2.
focusedView.isAttachedToWindow is false as shown in the screenshot.
da...@google.com <da...@google.com> #9
While leanback can add check in onFocusChangeListener whether the view belongs to the fragment's current view tree.
Is it a race condition in fragment library that calling requestFocus on a detached child?
Is it a race condition in fragment library that calling requestFocus on a detached child?
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 031d8dc8c746ca0840630cb6d641e91405362b6f
Author: Dake Gu <dake@google.com>
Date: Mon Nov 09 11:52:57 2020
leanback: fix wrong RecyclerView in GuidedActionAdapter
GuidedActionStylist has the same lifecycle as fragment that it can
be bound to different RecyclerViews in onCreateView/onDestroyView.
GuidedActionAdapter has the same lifecycle as the current fragment's
view. It adds onFocusChange listener to child views of RecyclerView.
Using GuidedActionStylist.getRecyclerView() may get the wrong one.
The fix is adding a final field mRecylerView in GuidedActionAdapter,
The adapter is created in fragment onCreateView and released in
fragment onDestroyView.
Bug: 172000115
Test: The bug is hard to reproduce, verified with existing Test and
verified demo app is still working.
Change-Id: Ic829f9256c1bd825a04bdeb81e673aa2a75527db
M leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
https://android-review.googlesource.com/1493237
Branch: androidx-master-dev
commit 031d8dc8c746ca0840630cb6d641e91405362b6f
Author: Dake Gu <dake@google.com>
Date: Mon Nov 09 11:52:57 2020
leanback: fix wrong RecyclerView in GuidedActionAdapter
GuidedActionStylist has the same lifecycle as fragment that it can
be bound to different RecyclerViews in onCreateView/onDestroyView.
GuidedActionAdapter has the same lifecycle as the current fragment's
view. It adds onFocusChange listener to child views of RecyclerView.
Using GuidedActionStylist.getRecyclerView() may get the wrong one.
The fix is adding a final field mRecylerView in GuidedActionAdapter,
The adapter is created in fragment onCreateView and released in
fragment onDestroyView.
Bug: 172000115
Test: The bug is hard to reproduce, verified with existing Test and
verified demo app is still working.
Change-Id: Ic829f9256c1bd825a04bdeb81e673aa2a75527db
M leanback/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
da...@google.com <da...@google.com> #11
projected to be in leanback:1.1.0-alpha06 at release of early December
pe...@avast.com <pe...@avast.com> #12
Kudos and Thank you for quick fix.
Description
Version used: leanback:1.1.0-alpha04 (leanback:1.1.0-alpha05)
Devices/Android versions reproduced on: NVIDIA SHILED (android 9) & Xiaomi MiBOX (android 9)
(cannot by reproduce on android TV emulator with android 10 though)
crashes once fragment-ktx version has been upgraded to beta01 and calling add():475 in GuidedStepSupportFragment
StackTrace:
java.lang.IllegalArgumentException: View androidx.leanback.widget.GuidedActionItemContainer{701d058 VFE...C.. .F....ID 0,340-576,427} is not a direct child of androidx.leanback.widget.VerticalGridView{8f45c82 V.E...... ......ID 0,96-576,1080 #7f0b0298 app:id/guidedactions_list}
at androidx.recyclerview.widget.RecyclerView.getChildViewHolder(RecyclerView.java:4944)
at androidx.leanback.widget.GuidedActionAdapter$ActionOnFocusListener.onFocusChange(GuidedActionAdapter.java:383)
at android.view.View.onFocusChanged(View.java:7265)
at android.view.View.handleFocusGainInternal(View.java:6934)
at android.view.ViewGroup.handleFocusGainInternal(ViewGroup.java:795)
at android.view.View.requestFocusNoSearch(View.java:11546)
at android.view.View.requestFocus(View.java:11520)
at android.view.ViewGroup.requestFocus(ViewGroup.java:3230)
at android.view.View.requestFocus(View.java:11487)
at android.view.View.requestFocus(View.java:11429)
at androidx.fragment.app.FragmentStateManager.resume(FragmentStateManager.java:603)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:310)
at androidx.fragment.app.SpecialEffectsController$FragmentStateManagerOperation.complete(SpecialEffectsController.java:723)
at androidx.fragment.app.SpecialEffectsController$Operation.completeSpecialEffect(SpecialEffectsController.java:657)
at androidx.fragment.app.DefaultSpecialEffectsController$SpecialEffectsInfo.completeSpecialEffect(DefaultSpecialEffectsController.java:739)
at androidx.fragment.app.DefaultSpecialEffectsController$9.run(DefaultSpecialEffectsController.java:615)
at androidx.transition.FragmentTransitionSupport$5.onTransitionEnd(FragmentTransitionSupport.java:280)
at androidx.transition.Transition.end(Transition.java:1965)
at androidx.transition.TransitionSet$TransitionSetListener.onTransitionEnd(TransitionSet.java:451)
at androidx.transition.Transition.end(Transition.java:1965)
at androidx.transition.Transition$3.onAnimationEnd(Transition.java:1914)
at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:552)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1232)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1474)
at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:693)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6721)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)