Fix logic for storing MediaButtonReceiver
Currently, MediaButtonReceiverHolder stores the
ComponentName.toString() value and tries to unflatten it with
ComponentName.unflattenFromString(String).
This causes restoring a stored MediaButtonReceiver to fail.
This CL changes it MediaButtonRecieverHolder store
ComponentName.flattenToString() value instead.
Bug: 169246173
Test: 1. Play music on YT Music.
2. Reboot phone.
3. Send media key event (PLAY)
Change-Id: I33449c0affd7f79e5988e7709cbbe45218766bf8
This commit is contained in:
@@ -259,7 +259,7 @@ final class MediaButtonReceiverHolder {
|
||||
return "";
|
||||
}
|
||||
return String.join(COMPONENT_NAME_USER_ID_DELIM,
|
||||
mComponentName.toString(),
|
||||
mComponentName.flattenToString(),
|
||||
String.valueOf(mUserId),
|
||||
String.valueOf(mComponentType));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user