Add smartspace custom widget

Flag: SMARTSPACE_AS_A_WIDGET
Test: no test
Bug: 200721106
Change-Id: I4ae4ff72ff7267bab0b5a928f3f78b47f7cfbc1f
This commit is contained in:
fbaron
2023-08-03 17:03:59 -07:00
committed by Federico Baron
parent e6747e4caa
commit 30d9e3fb06
12 changed files with 147 additions and 106 deletions

View File

@@ -17,6 +17,8 @@
package com.android.systemui.plugins;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import com.android.systemui.plugins.annotations.ProvidesInterface;
@@ -29,43 +31,21 @@ public interface CustomWidgetPlugin extends Plugin {
String ACTION = "com.android.systemui.action.PLUGIN_CUSTOM_WIDGET";
int VERSION = 1;
/**
* The label to display to the user in the AppWidget picker.
*/
String getLabel();
/**
* The default width of the widget when added to a host, in dp. The widget will get
* at least this width, and will often be given more, depending on the host.
*/
int getSpanX();
/**
* The default height of the widget when added to a host, in dp. The widget will get
* at least this height, and will often be given more, depending on the host.
*/
int getSpanY();
/**
* Minimum width (in dp) which the widget can be resized to. This field has no effect if it
* is greater than minWidth or if horizontal resizing isn't enabled.
*/
int getMinSpanX();
/**
* Minimum height (in dp) which the widget can be resized to. This field has no effect if it
* is greater than minHeight or if vertical resizing isn't enabled.
*/
int getMinSpanY();
/**
* The rules by which a widget can be resized.
*/
int getResizeMode();
/**
* Notify the plugin that container of the widget has been rendered, where the custom widget
* can be attached to.
*/
void onViewCreated(AppWidgetHostView parent);
/**
* Get the UUID for the custom widget.
*/
String getId();
/**
* Used to modify a widgets' info.
*/
default void updateWidgetInfo(AppWidgetProviderInfo info, Context context) {
}
}