1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.internal.appwidget; 18 19 import android.content.ComponentName; 20 import android.content.Intent; 21 import android.appwidget.AppWidgetProviderInfo; 22 import com.android.internal.appwidget.IAppWidgetHost; 23 import android.os.Bundle; 24 import android.os.IBinder; 25 import android.widget.RemoteViews; 26 27 /** {@hide} */ 28 interface IAppWidgetService { 29 30 // 31 // for AppWidgetHost 32 // startListening(IAppWidgetHost host, String packageName, int hostId, out List<RemoteViews> updatedViews)33 int[] startListening(IAppWidgetHost host, String packageName, int hostId, 34 out List<RemoteViews> updatedViews); startListeningAsUser(IAppWidgetHost host, String packageName, int hostId, out List<RemoteViews> updatedViews, int userId)35 int[] startListeningAsUser(IAppWidgetHost host, String packageName, int hostId, 36 out List<RemoteViews> updatedViews, int userId); stopListening(int hostId)37 void stopListening(int hostId); stopListeningAsUser(int hostId, int userId)38 void stopListeningAsUser(int hostId, int userId); allocateAppWidgetId(String packageName, int hostId)39 int allocateAppWidgetId(String packageName, int hostId); deleteAppWidgetId(int appWidgetId)40 void deleteAppWidgetId(int appWidgetId); deleteHost(int hostId)41 void deleteHost(int hostId); deleteAllHosts()42 void deleteAllHosts(); getAppWidgetViews(int appWidgetId)43 RemoteViews getAppWidgetViews(int appWidgetId); getAppWidgetIdsForHost(int hostId)44 int[] getAppWidgetIdsForHost(int hostId); 45 46 // 47 // for AppWidgetManager 48 // updateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views)49 void updateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views); updateAppWidgetOptions(int appWidgetId, in Bundle extras)50 void updateAppWidgetOptions(int appWidgetId, in Bundle extras); getAppWidgetOptions(int appWidgetId)51 Bundle getAppWidgetOptions(int appWidgetId); partiallyUpdateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views)52 void partiallyUpdateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views); updateAppWidgetProvider(in ComponentName provider, in RemoteViews views)53 void updateAppWidgetProvider(in ComponentName provider, in RemoteViews views); notifyAppWidgetViewDataChanged(in int[] appWidgetIds, int viewId)54 void notifyAppWidgetViewDataChanged(in int[] appWidgetIds, int viewId); getInstalledProviders(int categoryFilter)55 List<AppWidgetProviderInfo> getInstalledProviders(int categoryFilter); getAppWidgetInfo(int appWidgetId)56 AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId); hasBindAppWidgetPermission(in String packageName)57 boolean hasBindAppWidgetPermission(in String packageName); setBindAppWidgetPermission(in String packageName, in boolean permission)58 void setBindAppWidgetPermission(in String packageName, in boolean permission); bindAppWidgetId(int appWidgetId, in ComponentName provider, in Bundle options)59 void bindAppWidgetId(int appWidgetId, in ComponentName provider, in Bundle options); bindAppWidgetIdIfAllowed( in String packageName, int appWidgetId, in ComponentName provider, in Bundle options)60 boolean bindAppWidgetIdIfAllowed( 61 in String packageName, int appWidgetId, in ComponentName provider, in Bundle options); bindRemoteViewsService(int appWidgetId, in Intent intent, in IBinder connection, int userId)62 void bindRemoteViewsService(int appWidgetId, in Intent intent, in IBinder connection, int userId); unbindRemoteViewsService(int appWidgetId, in Intent intent, int userId)63 void unbindRemoteViewsService(int appWidgetId, in Intent intent, int userId); getAppWidgetIds(in ComponentName provider)64 int[] getAppWidgetIds(in ComponentName provider); 65 66 } 67 68