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

Commit b840c05b authored by Sam Mortimer's avatar Sam Mortimer Committed by Michael Bestas
Browse files

Keyguard: Set WIDGET_CATEGORY_KEYGUARD when AppWidgetHostView is created

Allows the default lockscreen widget to inherit the keyguard widget
host category.  Without this, only widgets added through
KeyguardActivityLauncher are assigned the correct
OPTION_APPWIDGET_HOST_CATEGORY.

Change-Id: Ic97818d85ca5f00da0ce43bb36006d66a6935363
parent 470406db
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.media.RemoteControlClient;
import android.os.Bundle;
import android.os.Looper;
import android.os.Parcel;
import android.os.Parcelable;
@@ -1177,6 +1178,10 @@ public class KeyguardHostView extends KeyguardViewBase {
        AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appId);
        if (appWidgetInfo != null) {
            AppWidgetHostView view = mAppWidgetHost.createView(mContext, appId, appWidgetInfo);
            Bundle options = new Bundle();
            options.putInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY,
                AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD);
            view.updateAppWidgetOptions(options);
            addWidget(view, pageIndex);
            return true;
        } else {