GetInstalledProvidersForProfiles should never return null object.

b/21916365
b/19904873

Change-Id: I296cafd15a185ad91cb7491bd6d2466ac03cdfb7
This commit is contained in:
Hyunyoung Song
2015-06-18 12:59:51 -07:00
parent ccf6c68147
commit c070bab9ed

View File

@@ -1298,7 +1298,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
synchronized (mLock) {
ensureGroupStateLoadedLocked(userId);
ArrayList<AppWidgetProviderInfo> result = null;
ArrayList<AppWidgetProviderInfo> result = new ArrayList<AppWidgetProviderInfo>();
final int providerCount = mProviders.size();
for (int i = 0; i < providerCount; i++) {
@@ -1315,9 +1315,6 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
if (providerProfileId == profileId
&& mSecurityPolicy.isProviderInCallerOrInProfileAndWhitelListed(
provider.id.componentName.getPackageName(), providerProfileId)) {
if (result == null) {
result = new ArrayList<>();
}
result.add(cloneIfLocalBinder(info));
}
}