Skip to content

Commit

Permalink
Merge "Resolve NPE on widget.provider.id" into rvc-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sfufagoogle authored and Android (Google) Code Review committed May 13, 2020
2 parents ec5ab8b + bc28ebb commit f5de7b0
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static android.content.Context.KEYGUARD_SERVICE;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;

import static com.android.server.pm.PackageManagerService.PLATFORM_PACKAGE_NAME;

import android.annotation.UserIdInt;
Expand Down Expand Up @@ -101,7 +100,6 @@
import android.view.Display;
import android.view.View;
import android.widget.RemoteViews;

import com.android.internal.R;
import com.android.internal.app.SuspendedAppActivity;
import com.android.internal.app.UnlaunchableAppActivity;
Expand All @@ -116,11 +114,6 @@
import com.android.server.LocalServices;
import com.android.server.WidgetBackupProvider;
import com.android.server.policy.IconUtilities;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
Expand All @@ -142,6 +135,9 @@
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;

class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBackupProvider,
OnCrossProfileWidgetProvidersChangeListener {
Expand Down Expand Up @@ -4887,7 +4883,7 @@ public ArraySet<String> getHostedWidgetPackages(int uid) {
final int widgetCount = mWidgets.size();
for (int i = 0; i < widgetCount; i++) {
final Widget widget = mWidgets.get(i);
if (widget.host.id.uid == uid) {
if (widget.host.id.uid == uid && widget.provider != null) {
if (widgetPackages == null) {
widgetPackages = new ArraySet<>();
}
Expand Down

0 comments on commit f5de7b0

Please sign in to comment.