The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 1 | /* |
Winson Chung | 81f39eb | 2011-01-11 18:05:01 -0800 | [diff] [blame] | 2 | * Copyright (C) 2011 The Android Open Source Project |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 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; |
Winson Chung | 81f39eb | 2011-01-11 18:05:01 -0800 | [diff] [blame] | 20 | import android.content.Intent; |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 21 | import android.appwidget.AppWidgetProviderInfo; |
| 22 | import com.android.internal.appwidget.IAppWidgetHost; |
Adam Cohen | e8724c8 | 2012-04-19 17:11:40 -0700 | [diff] [blame] | 23 | import android.os.Bundle; |
Winson Chung | 81f39eb | 2011-01-11 18:05:01 -0800 | [diff] [blame] | 24 | import android.os.IBinder; |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 25 | import android.widget.RemoteViews; |
| 26 | |
| 27 | /** {@hide} */ |
| 28 | interface IAppWidgetService { |
| 29 | |
| 30 | // |
| 31 | // for AppWidgetHost |
| 32 | // |
| 33 | int[] startListening(IAppWidgetHost host, String packageName, int hostId, |
| 34 | out List<RemoteViews> updatedViews); |
| 35 | void stopListening(int hostId); |
| 36 | int allocateAppWidgetId(String packageName, int hostId); |
| 37 | void deleteAppWidgetId(int appWidgetId); |
| 38 | void deleteHost(int hostId); |
| 39 | void deleteAllHosts(); |
| 40 | RemoteViews getAppWidgetViews(int appWidgetId); |
| 41 | |
| 42 | // |
| 43 | // for AppWidgetManager |
| 44 | // |
| 45 | void updateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views); |
Adam Cohen | d2097eb | 2012-05-01 18:10:28 -0700 | [diff] [blame] | 46 | void updateAppWidgetOptions(int appWidgetId, in Bundle extras); |
| 47 | Bundle getAppWidgetOptions(int appWidgetId); |
Adam Cohen | 2dd2197 | 2010-08-15 18:20:04 -0700 | [diff] [blame] | 48 | void partiallyUpdateAppWidgetIds(in int[] appWidgetIds, in RemoteViews views); |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 49 | void updateAppWidgetProvider(in ComponentName provider, in RemoteViews views); |
Winson Chung | 6394c0e | 2010-08-16 10:14:56 -0700 | [diff] [blame] | 50 | void notifyAppWidgetViewDataChanged(in int[] appWidgetIds, int viewId); |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 51 | List<AppWidgetProviderInfo> getInstalledProviders(); |
| 52 | AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId); |
Michael Jurka | 61a5b01 | 2012-04-13 10:39:45 -0700 | [diff] [blame] | 53 | boolean hasBindAppWidgetPermission(in String packageName); |
| 54 | void setBindAppWidgetPermission(in String packageName, in boolean permission); |
Adam Cohen | 0aa2d42 | 2012-09-07 17:37:26 -0700 | [diff] [blame] | 55 | void bindAppWidgetId(int appWidgetId, in ComponentName provider, in Bundle options); |
Michael Jurka | 61a5b01 | 2012-04-13 10:39:45 -0700 | [diff] [blame] | 56 | boolean bindAppWidgetIdIfAllowed( |
Adam Cohen | 0aa2d42 | 2012-09-07 17:37:26 -0700 | [diff] [blame] | 57 | in String packageName, int appWidgetId, in ComponentName provider, in Bundle options); |
Winson Chung | 81f39eb | 2011-01-11 18:05:01 -0800 | [diff] [blame] | 58 | void bindRemoteViewsService(int appWidgetId, in Intent intent, in IBinder connection); |
| 59 | void unbindRemoteViewsService(int appWidgetId, in Intent intent); |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 60 | int[] getAppWidgetIds(in ComponentName provider); |
| 61 | |
| 62 | } |
| 63 | |