Merge "Prevent crash when flattening ComponentKey to string with invalid user." into ub-launcher3-burnaby
This commit is contained in:
@@ -64,8 +64,11 @@ public class ComponentKey {
|
|||||||
* Encodes a component key as a string of the form [flattenedComponentString#userId].
|
* Encodes a component key as a string of the form [flattenedComponentString#userId].
|
||||||
*/
|
*/
|
||||||
public String flattenToString(Context context) {
|
public String flattenToString(Context context) {
|
||||||
return componentName.flattenToString() + "#" +
|
String flattened = componentName.flattenToString();
|
||||||
UserManagerCompat.getInstance(context).getSerialNumberForUser(user);
|
if (user != null) {
|
||||||
|
flattened += "#" + UserManagerCompat.getInstance(context).getSerialNumberForUser(user);
|
||||||
|
}
|
||||||
|
return flattened;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user