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 17package com.android.internal.appwidget; 18 19import android.content.ComponentName; 20import android.content.Intent; 21import android.appwidget.AppWidgetProviderInfo; 22import com.android.internal.appwidget.IAppWidgetHost; 23import android.os.Bundle; 24import android.os.IBinder; 25import android.widget.RemoteViews; 26 27/** {@hide} */ 28interface IAppWidgetService { 29 30 // 31 // for AppWidgetHost 32 // 33 int[] startListening(IAppWidgetHost host, String packageName, int hostId, 34 out List<RemoteViews> updatedViews, int userId); 35 void stopListening(int hostId, int userId); 36 int allocateAppWidgetId(String packageName, int hostId, int userId); 37 void deleteAppWidgetId(int appWidgetId, int userId); 38 void deleteHost(int hostId, int userId); 39 void deleteAllHosts(int userId); 40 RemoteViews getAppWidgetViews(int appWidgetId, int userId); 41 int[] getAppWidgetIdsForHost(int hostId, int userId); 42 43 // 44 // for AppWidgetManager 45 // 46 void updateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views, int userId); 47 void updateAppWidgetOptions(int appWidgetId, in Bundle extras, int userId); 48 Bundle getAppWidgetOptions(int appWidgetId, int userId); 49 void partiallyUpdateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views, int userId); 50 void updateAppWidgetProvider(in ComponentName provider, in RemoteViews views, int userId); 51 void notifyAppWidgetViewDataChanged(in int[] appWidgetIds, int viewId, int userId); 52 List<AppWidgetProviderInfo> getInstalledProviders(int categoryFilter, int userId); 53 AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId, int userId); 54 boolean hasBindAppWidgetPermission(in String packageName, int userId); 55 void setBindAppWidgetPermission(in String packageName, in boolean permission, int userId); 56 void bindAppWidgetId(int appWidgetId, in ComponentName provider, in Bundle options, int userId); 57 boolean bindAppWidgetIdIfAllowed(in String packageName, int appWidgetId, 58 in ComponentName provider, in Bundle options, int userId); 59 void bindRemoteViewsService(int appWidgetId, in Intent intent, in IBinder connection, int userId); 60 void unbindRemoteViewsService(int appWidgetId, in Intent intent, int userId); 61 int[] getAppWidgetIds(in ComponentName provider, int userId); 62 63} 64 65