blob: e685e63ea1db3319aa67ef1674b6cc11e635e637 [file] [log] [blame]
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -07001/*
Winson Chung81f39eb2011-01-11 18:05:01 -08002 * Copyright (C) 2011 The Android Open Source Project
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -07003 *
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;
Winson Chung81f39eb2011-01-11 18:05:01 -080020import android.content.Intent;
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070021import android.appwidget.AppWidgetProviderInfo;
22import com.android.internal.appwidget.IAppWidgetHost;
Adam Cohene8724c82012-04-19 17:11:40 -070023import android.os.Bundle;
Winson Chung81f39eb2011-01-11 18:05:01 -080024import android.os.IBinder;
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070025import 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);
Amith Yamasanic566b432012-11-30 15:26:21 -080035 int[] startListeningAsUser(IAppWidgetHost host, String packageName, int hostId,
36 out List<RemoteViews> updatedViews, int userId);
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070037 void stopListening(int hostId);
Amith Yamasanic566b432012-11-30 15:26:21 -080038 void stopListeningAsUser(int hostId, int userId);
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070039 int allocateAppWidgetId(String packageName, int hostId);
40 void deleteAppWidgetId(int appWidgetId);
41 void deleteHost(int hostId);
42 void deleteAllHosts();
43 RemoteViews getAppWidgetViews(int appWidgetId);
Michael Jurka75b5cfb2012-11-15 18:22:47 -080044 int[] getAppWidgetIdsForHost(int hostId);
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070045
46 //
47 // for AppWidgetManager
48 //
49 void updateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views);
Adam Cohend2097eb2012-05-01 18:10:28 -070050 void updateAppWidgetOptions(int appWidgetId, in Bundle extras);
51 Bundle getAppWidgetOptions(int appWidgetId);
Adam Cohen2dd21972010-08-15 18:20:04 -070052 void partiallyUpdateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views);
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070053 void updateAppWidgetProvider(in ComponentName provider, in RemoteViews views);
Winson Chung6394c0e2010-08-16 10:14:56 -070054 void notifyAppWidgetViewDataChanged(in int[] appWidgetIds, int viewId);
Adam Cohend9e5af32012-11-28 16:34:57 -080055 List<AppWidgetProviderInfo> getInstalledProviders(int categoryFilter);
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070056 AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId);
Michael Jurka61a5b012012-04-13 10:39:45 -070057 boolean hasBindAppWidgetPermission(in String packageName);
58 void setBindAppWidgetPermission(in String packageName, in boolean permission);
Adam Cohen0aa2d422012-09-07 17:37:26 -070059 void bindAppWidgetId(int appWidgetId, in ComponentName provider, in Bundle options);
Michael Jurka61a5b012012-04-13 10:39:45 -070060 boolean bindAppWidgetIdIfAllowed(
Adam Cohen0aa2d422012-09-07 17:37:26 -070061 in String packageName, int appWidgetId, in ComponentName provider, in Bundle options);
Amith Yamasanic566b432012-11-30 15:26:21 -080062 void bindRemoteViewsService(int appWidgetId, in Intent intent, in IBinder connection, int userId);
63 void unbindRemoteViewsService(int appWidgetId, in Intent intent, int userId);
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070064 int[] getAppWidgetIds(in ComponentName provider);
65
66}
67