merge from open-source master

Change-Id: I992e2a407b1d8f7f29cb7153d4c2e3945e60b57a
This commit is contained in:
The Android Open Source Project
2010-07-12 15:26:21 -07:00

View File

@@ -22,7 +22,6 @@ import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import android.widget.RemoteViews;
@@ -149,7 +148,7 @@ public class AppWidgetManager {
* instances as possible.</td>
* </tr>
* </table>
*
*
* @see AppWidgetProvider#onUpdate AppWidgetProvider.onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
*/
public static final String ACTION_APPWIDGET_UPDATE = "android.appwidget.action.APPWIDGET_UPDATE";
@@ -163,7 +162,7 @@ public class AppWidgetManager {
/**
* Sent when an instance of an AppWidget is removed from the last host.
*
*
* @see AppWidgetProvider#onEnabled AppWidgetProvider.onEnabled(Context context)
*/
public static final String ACTION_APPWIDGET_DISABLED = "android.appwidget.action.APPWIDGET_DISABLED";
@@ -172,7 +171,7 @@ public class AppWidgetManager {
* Sent when an instance of an AppWidget is added to a host for the first time.
* This broadcast is sent at boot time if there is a AppWidgetHost installed with
* an instance for this provider.
*
*
* @see AppWidgetProvider#onEnabled AppWidgetProvider.onEnabled(Context context)
*/
public static final String ACTION_APPWIDGET_ENABLED = "android.appwidget.action.APPWIDGET_ENABLED";
@@ -183,20 +182,21 @@ public class AppWidgetManager {
* @see AppWidgetProviderInfo
*/
public static final String META_DATA_APPWIDGET_PROVIDER = "android.appwidget.provider";
/**
* Field for the manifest meta-data tag used to indicate any previous name for the
* app widget receiver.
*
* @see AppWidgetProviderInfo
*
*
* @hide Pending API approval
*/
public static final String META_DATA_APPWIDGET_OLD_NAME = "android.appwidget.oldName";
static WeakHashMap<Context, WeakReference<AppWidgetManager>> sManagerCache = new WeakHashMap();
static WeakHashMap<Context, WeakReference<AppWidgetManager>> sManagerCache =
new WeakHashMap<Context, WeakReference<AppWidgetManager>>();
static IAppWidgetService sService;
Context mContext;
private DisplayMetrics mDisplayMetrics;
@@ -219,7 +219,7 @@ public class AppWidgetManager {
}
if (result == null) {
result = new AppWidgetManager(context);
sManagerCache.put(context, new WeakReference(result));
sManagerCache.put(context, new WeakReference<AppWidgetManager>(result));
}
return result;
}
@@ -310,7 +310,7 @@ public class AppWidgetManager {
AppWidgetProviderInfo info = sService.getAppWidgetInfo(appWidgetId);
if (info != null) {
// Converting complex to dp.
info.minWidth =
info.minWidth =
TypedValue.complexToDimensionPixelSize(info.minWidth, mDisplayMetrics);
info.minHeight =
TypedValue.complexToDimensionPixelSize(info.minHeight, mDisplayMetrics);
@@ -344,7 +344,7 @@ public class AppWidgetManager {
/**
* Get the list of appWidgetIds that have been bound to the given AppWidget
* provider.
*
*
* @param provider The {@link android.content.BroadcastReceiver} that is the
* AppWidget provider to find appWidgetIds for.
*/