Added null check while fetching the context URI resource
This CL aims at adding a null check before we convert the fetched URI character sequence to string format. Bug: b/257012915 Test: Tested by building and flashing on local, and seeing everything works okay as expected before for 3P livewallpapers. Change-Id: Id90367ee16d479591e524d7c2c5774ec3c483628
This commit is contained in:
@@ -292,12 +292,12 @@ public final class WallpaperInfo implements Parcelable {
|
||||
packageName = mService.serviceInfo.packageName;
|
||||
applicationInfo = mService.serviceInfo.applicationInfo;
|
||||
}
|
||||
String contextUriString = pm.getText(
|
||||
packageName, mContextUriResource, applicationInfo).toString();
|
||||
if (contextUriString == null) {
|
||||
CharSequence contextUriCharSequence = pm.getText(
|
||||
packageName, mContextUriResource, applicationInfo);
|
||||
if (contextUriCharSequence == null) {
|
||||
return null;
|
||||
}
|
||||
return Uri.parse(contextUriString);
|
||||
return Uri.parse(contextUriCharSequence.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user