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