Merge "Add null check for label when persisting provider info" into tm-dev am: c98cb446c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17760284 Change-Id: Ib5140222c3e6c5610c639f7a522c30df24412687 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -154,7 +154,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
||||
private static final String TAG = "AppWidgetServiceImpl";
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean DEBUG_PROVIDER_INFO_CACHE = true;
|
||||
static final boolean DEBUG_PROVIDER_INFO_CACHE = true;
|
||||
|
||||
private static final String OLD_KEYGUARD_HOST_PACKAGE = "android";
|
||||
private static final String NEW_KEYGUARD_HOST_PACKAGE = "com.android.keyguard";
|
||||
@@ -2001,6 +2001,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
||||
}
|
||||
}
|
||||
|
||||
@GuardedBy("mLock")
|
||||
private void scheduleNotifyProviderChangedLocked(Widget widget) {
|
||||
long requestId = UPDATE_COUNTER.incrementAndGet();
|
||||
if (widget != null) {
|
||||
@@ -2330,6 +2331,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
||||
sendBroadcastAsUser(intent, widget.provider.id.getProfile());
|
||||
}
|
||||
|
||||
@GuardedBy("mLock")
|
||||
private void registerForBroadcastsLocked(Provider provider, int[] appWidgetIds) {
|
||||
AppWidgetProviderInfo info = provider.getInfoLocked(mContext);
|
||||
if (info.updatePeriodMillis > 0) {
|
||||
@@ -3433,6 +3435,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
||||
*
|
||||
* @return whether any providers were updated
|
||||
*/
|
||||
@GuardedBy("mLock")
|
||||
private boolean updateProvidersForPackageLocked(String packageName, int userId,
|
||||
Set<ProviderId> removedProviders) {
|
||||
boolean providersUpdated = false;
|
||||
@@ -4218,6 +4221,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
||||
/**
|
||||
* Adds all pending updates in {@param outUpdates} keys by the update time.
|
||||
*/
|
||||
@GuardedBy("mLock")
|
||||
public void getPendingUpdatesForIdLocked(Context context, int appWidgetId,
|
||||
LongSparseArray<PendingHostUpdate> outUpdates) {
|
||||
long updateSequenceNo = lastWidgetUpdateSequenceNo;
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.appwidget.AppWidgetProviderInfo;
|
||||
import android.content.ComponentName;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Slog;
|
||||
import android.util.TypedXmlPullParser;
|
||||
import android.util.TypedXmlSerializer;
|
||||
|
||||
@@ -33,6 +34,8 @@ import java.util.Objects;
|
||||
*/
|
||||
public class AppWidgetXmlUtil {
|
||||
|
||||
private static final String TAG = "AppWidgetXmlUtil";
|
||||
|
||||
private static final String ATTR_MIN_WIDTH = "min_width";
|
||||
private static final String ATTR_MIN_HEIGHT = "min_height";
|
||||
private static final String ATTR_MIN_RESIZE_WIDTH = "min_resize_width";
|
||||
@@ -77,7 +80,11 @@ public class AppWidgetXmlUtil {
|
||||
if (info.configure != null) {
|
||||
out.attribute(null, ATTR_CONFIGURE, info.configure.flattenToShortString());
|
||||
}
|
||||
out.attribute(null, ATTR_LABEL, info.label);
|
||||
if (info.label != null) {
|
||||
out.attribute(null, ATTR_LABEL, info.label);
|
||||
} else if (AppWidgetServiceImpl.DEBUG_PROVIDER_INFO_CACHE) {
|
||||
Slog.e(TAG, "Label is empty in " + info.provider);
|
||||
}
|
||||
out.attributeInt(null, ATTR_ICON, info.icon);
|
||||
out.attributeInt(null, ATTR_PREVIEW_IMAGE, info.previewImage);
|
||||
out.attributeInt(null, ATTR_PREVIEW_LAYOUT, info.previewLayout);
|
||||
|
||||
Reference in New Issue
Block a user