Merge "Add null check for label when persisting provider info" into tm-dev
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 String TAG = "AppWidgetServiceImpl";
|
||||||
|
|
||||||
private static final boolean DEBUG = false;
|
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 OLD_KEYGUARD_HOST_PACKAGE = "android";
|
||||||
private static final String NEW_KEYGUARD_HOST_PACKAGE = "com.android.keyguard";
|
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) {
|
private void scheduleNotifyProviderChangedLocked(Widget widget) {
|
||||||
long requestId = UPDATE_COUNTER.incrementAndGet();
|
long requestId = UPDATE_COUNTER.incrementAndGet();
|
||||||
if (widget != null) {
|
if (widget != null) {
|
||||||
@@ -2330,6 +2331,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
|||||||
sendBroadcastAsUser(intent, widget.provider.id.getProfile());
|
sendBroadcastAsUser(intent, widget.provider.id.getProfile());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GuardedBy("mLock")
|
||||||
private void registerForBroadcastsLocked(Provider provider, int[] appWidgetIds) {
|
private void registerForBroadcastsLocked(Provider provider, int[] appWidgetIds) {
|
||||||
AppWidgetProviderInfo info = provider.getInfoLocked(mContext);
|
AppWidgetProviderInfo info = provider.getInfoLocked(mContext);
|
||||||
if (info.updatePeriodMillis > 0) {
|
if (info.updatePeriodMillis > 0) {
|
||||||
@@ -3433,6 +3435,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
|||||||
*
|
*
|
||||||
* @return whether any providers were updated
|
* @return whether any providers were updated
|
||||||
*/
|
*/
|
||||||
|
@GuardedBy("mLock")
|
||||||
private boolean updateProvidersForPackageLocked(String packageName, int userId,
|
private boolean updateProvidersForPackageLocked(String packageName, int userId,
|
||||||
Set<ProviderId> removedProviders) {
|
Set<ProviderId> removedProviders) {
|
||||||
boolean providersUpdated = false;
|
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.
|
* Adds all pending updates in {@param outUpdates} keys by the update time.
|
||||||
*/
|
*/
|
||||||
|
@GuardedBy("mLock")
|
||||||
public void getPendingUpdatesForIdLocked(Context context, int appWidgetId,
|
public void getPendingUpdatesForIdLocked(Context context, int appWidgetId,
|
||||||
LongSparseArray<PendingHostUpdate> outUpdates) {
|
LongSparseArray<PendingHostUpdate> outUpdates) {
|
||||||
long updateSequenceNo = lastWidgetUpdateSequenceNo;
|
long updateSequenceNo = lastWidgetUpdateSequenceNo;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.appwidget.AppWidgetProviderInfo;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Slog;
|
||||||
import android.util.TypedXmlPullParser;
|
import android.util.TypedXmlPullParser;
|
||||||
import android.util.TypedXmlSerializer;
|
import android.util.TypedXmlSerializer;
|
||||||
|
|
||||||
@@ -33,6 +34,8 @@ import java.util.Objects;
|
|||||||
*/
|
*/
|
||||||
public class AppWidgetXmlUtil {
|
public class AppWidgetXmlUtil {
|
||||||
|
|
||||||
|
private static final String TAG = "AppWidgetXmlUtil";
|
||||||
|
|
||||||
private static final String ATTR_MIN_WIDTH = "min_width";
|
private static final String ATTR_MIN_WIDTH = "min_width";
|
||||||
private static final String ATTR_MIN_HEIGHT = "min_height";
|
private static final String ATTR_MIN_HEIGHT = "min_height";
|
||||||
private static final String ATTR_MIN_RESIZE_WIDTH = "min_resize_width";
|
private static final String ATTR_MIN_RESIZE_WIDTH = "min_resize_width";
|
||||||
@@ -77,7 +80,11 @@ public class AppWidgetXmlUtil {
|
|||||||
if (info.configure != null) {
|
if (info.configure != null) {
|
||||||
out.attribute(null, ATTR_CONFIGURE, info.configure.flattenToShortString());
|
out.attribute(null, ATTR_CONFIGURE, info.configure.flattenToShortString());
|
||||||
}
|
}
|
||||||
|
if (info.label != null) {
|
||||||
out.attribute(null, ATTR_LABEL, info.label);
|
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_ICON, info.icon);
|
||||||
out.attributeInt(null, ATTR_PREVIEW_IMAGE, info.previewImage);
|
out.attributeInt(null, ATTR_PREVIEW_IMAGE, info.previewImage);
|
||||||
out.attributeInt(null, ATTR_PREVIEW_LAYOUT, info.previewLayout);
|
out.attributeInt(null, ATTR_PREVIEW_LAYOUT, info.previewLayout);
|
||||||
|
|||||||
Reference in New Issue
Block a user