Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bac26a12 authored by Adam Cohen's avatar Adam Cohen
Browse files

Getting rid of the (hidden) oldName parameter for widgets

Change-Id: I191cf64ed045fd7cb53e106f337cbeab5a914336
parent 13ed7435
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -184,16 +184,6 @@ public class AppWidgetManager {
     */
    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<Context, WeakReference<AppWidgetManager>>();
    static IAppWidgetService sService;
+0 −11
Original line number Diff line number Diff line
@@ -137,17 +137,6 @@ public class AppWidgetProviderInfo implements Parcelable {
     */
    public int icon;

    /**
     * The previous name, if any, of the app widget receiver. If not supplied, it will be
     * ignored.
     *
     * <p>This field corresponds to the <code>&lt;meta-data /&gt;</code> with the name
     * <code>android.appwidget.oldName</code>.
     * 
     * @hide Pending API approval
     */
    public String oldName;

    /**
     * The view id of the AppWidget subview which should be auto-advanced by the widget's host.
     *
+1 −7
Original line number Diff line number Diff line
@@ -817,11 +817,10 @@ class AppWidgetService extends IAppWidgetService.Stub
    }

    Provider lookupProviderLocked(ComponentName provider) {
        final String className = provider.getClassName();
        final int N = mInstalledProviders.size();
        for (int i=0; i<N; i++) {
            Provider p = mInstalledProviders.get(i);
            if (p.info.provider.equals(provider) || className.equals(p.info.oldName)) {
            if (p.info.provider.equals(provider)) {
                return p;
            }
        }
@@ -1006,11 +1005,6 @@ class AppWidgetService extends IAppWidgetService.Stub

            p = new Provider();
            AppWidgetProviderInfo info = p.info = new AppWidgetProviderInfo();
            // If metaData was null, we would have returned earlier when getting
            // the parser No need to do the check here
            info.oldName = activityInfo.metaData.getString(
                    AppWidgetManager.META_DATA_APPWIDGET_OLD_NAME);

            info.provider = component;
            p.uid = activityInfo.applicationInfo.uid;