Fixed
Status Update
Comments
jo...@gmail.com <jo...@gmail.com> #2
Trying to reproduce this on my 4.2.2 (v17) Nexus 4. Added this drawable:
<transition xmlns:android="http://schemas.android.com/apk/res/android " >
<item android:drawable="@drawable/test_drawable_blue"/>
<item android:drawable="@drawable/test_drawable_green"/>
</transition>
where blue/green drawables look like this:
<shape
xmlns:android="http://schemas.android.com/apk/res/android "
android:shape="rectangle">
<size
android:width="@dimen/drawable_large_size"
android:height="@dimen/drawable_small_size" />
<solid
android:color="@color/test_blue" />
</shape>
Then added this test:
@Test
public void testMutateTransitionDrawable() {
Drawable drawable = ResourcesCompat.getDrawable(mResources,
R.drawable.test_transition_drawable, null);
assertTrue(drawable instanceof TransitionDrawable);
Drawable mutated = drawable.mutate();
assertTrue(drawable instanceof TransitionDrawable);
assertTrue(mutated instanceof TransitionDrawable);
}
It passes on the device. Going to also try on other earlier devices a bit later in the day once they are charged.
<transition xmlns:android="
<item android:drawable="@drawable/test_drawable_blue"/>
<item android:drawable="@drawable/test_drawable_green"/>
</transition>
where blue/green drawables look like this:
<shape
xmlns:android="
android:shape="rectangle">
<size
android:width="@dimen/drawable_large_size"
android:height="@dimen/drawable_small_size" />
<solid
android:color="@color/test_blue" />
</shape>
Then added this test:
@Test
public void testMutateTransitionDrawable() {
Drawable drawable = ResourcesCompat.getDrawable(mResources,
R.drawable.test_transition_drawable, null);
assertTrue(drawable instanceof TransitionDrawable);
Drawable mutated = drawable.mutate();
assertTrue(drawable instanceof TransitionDrawable);
assertTrue(mutated instanceof TransitionDrawable);
}
It passes on the device. Going to also try on other earlier devices a bit later in the day once they are charged.
gy...@google.com <gy...@google.com>
gy...@google.com <gy...@google.com> #3
Also not reproducible on Galaxy Nexus running 4.0.1 (v14), 4.0.4 (v15) and 4.2.2 (v17)
ap...@google.com <ap...@google.com> #4
ja...@google.com <ja...@google.com>
ja...@google.com <ja...@google.com> #5
Sorry, fix above cuased regression. b/146467882
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 4295f15a153c583a48aca2c0802c1a2c10232d60
Author: Jaewan Kim <jaewan@google.com>
Date: Tue Jan 07 14:16:22 2020
Don't notify session info via callbacks when the connection is made
This fixes the regression caused by my previous commit below
05c46e7d27 Fix MediaController crash with fwk MediaSession
Test had failed because onPlaybackStateChanged(),
onShuffleModeChanged(), onRepeatModeChanged(), and
onCaptioningEnabledChanged() are called to notify the session's
information when the connection is established.
Bug: 146467882, Bug: 142925848
Test: run version compat test
Change-Id: Iedb1aa52c96ee2c2f6a7c7a6f225155cecde6baa
M media2/session/src/main/java/androidx/media2/session/MediaControllerImplLegacy.java
https://android-review.googlesource.com/1195030
Branch: androidx-master-dev
commit 4295f15a153c583a48aca2c0802c1a2c10232d60
Author: Jaewan Kim <jaewan@google.com>
Date: Tue Jan 07 14:16:22 2020
Don't notify session info via callbacks when the connection is made
This fixes the regression caused by my previous commit below
05c46e7d27 Fix MediaController crash with fwk MediaSession
Test had failed because onPlaybackStateChanged(),
onShuffleModeChanged(), onRepeatModeChanged(), and
onCaptioningEnabledChanged() are called to notify the session's
information when the connection is established.
Bug: 146467882, Bug: 142925848
Test: run version compat test
Change-Id: Iedb1aa52c96ee2c2f6a7c7a6f225155cecde6baa
M media2/session/src/main/java/androidx/media2/session/MediaControllerImplLegacy.java
an...@google.com <an...@google.com> #7
jo...@gmail.com <jo...@gmail.com> #8
Will this make it to the next release?
gy...@google.com <gy...@google.com> #9
Yes, the issue will be fixed in media2-session 1.0.2.
Description
Code to connect:
if (sessionToken != null) {
mediaController = MediaController.Builder(activity)
.setSessionToken(sessionToken)
.setControllerCallback({ it.run() }, this)
.build()
}
Stacktrace:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean androidx.media2.session.SessionCommandGroup.equals(java.lang.Object)' on a null object reference
at androidx.media2.session.MediaControllerImplLegacy$ControllerCompatCallback.onPlaybackStateChanged(MediaControllerImplLegacy.java:1201)
at android.support.v4.media.session.MediaControllerCompat$Callback$MediaControllerCallbackApi21.onPlaybackStateChanged(MediaControllerCompat.java:917)
at android.media.session.MediaController$MessageHandler.handleMessage(MediaController.java:1174)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.HandlerThread.run(HandlerThread.java:67)