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; |
Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 21 | import android.content.IntentSender; |
| 22 | import android.content.pm.ApplicationInfo; |
Hyunyoung Song | ccf6c68 | 2015-06-17 15:23:31 -0700 | [diff] [blame] | 23 | import android.content.pm.ParceledListSlice; |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 24 | import android.appwidget.AppWidgetProviderInfo; |
| 25 | import com.android.internal.appwidget.IAppWidgetHost; |
Adam Cohen | e8724c8 | 2012-04-19 17:11:40 -0700 | [diff] [blame] | 26 | import android.os.Bundle; |
Winson Chung | 81f39eb | 2011-01-11 18:05:01 -0800 | [diff] [blame] | 27 | import android.os.IBinder; |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 28 | import android.widget.RemoteViews; |
Sunny Goyal | e1273eb | 2017-10-18 00:17:20 -0700 | [diff] [blame] | 29 | import android.app.IApplicationThread; |
| 30 | import android.app.IServiceConnection; |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 31 | |
| 32 | /** {@hide} */ |
| 33 | interface IAppWidgetService { |
Jim Miller | a75a883 | 2013-02-07 16:53:32 -0800 | [diff] [blame] | 34 | |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 35 | // |
| 36 | // for AppWidgetHost |
| 37 | // |
Sunny Goyal | 2857f1c | 2016-03-31 11:27:13 -0700 | [diff] [blame] | 38 | ParceledListSlice startListening(IAppWidgetHost host, String callingPackage, int hostId, |
Sunny Goyal | 6d1b41d | 2016-05-11 18:22:20 -0700 | [diff] [blame] | 39 | in int[] appWidgetIds); |
Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 40 | void stopListening(String callingPackage, int hostId); |
| 41 | int allocateAppWidgetId(String callingPackage, int hostId); |
| 42 | void deleteAppWidgetId(String callingPackage, int appWidgetId); |
| 43 | void deleteHost(String packageName, int hostId); |
| 44 | void deleteAllHosts(); |
| 45 | RemoteViews getAppWidgetViews(String callingPackage, int appWidgetId); |
| 46 | int[] getAppWidgetIdsForHost(String callingPackage, int hostId); |
Svetoslav | 8e1d299 | 2014-08-08 12:48:06 -0700 | [diff] [blame] | 47 | IntentSender createAppWidgetConfigIntentSender(String callingPackage, int appWidgetId, |
| 48 | int intentFlags); |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 49 | |
| 50 | // |
| 51 | // for AppWidgetManager |
| 52 | // |
Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 53 | void updateAppWidgetIds(String callingPackage, in int[] appWidgetIds, in RemoteViews views); |
| 54 | void updateAppWidgetOptions(String callingPackage, int appWidgetId, in Bundle extras); |
| 55 | Bundle getAppWidgetOptions(String callingPackage, int appWidgetId); |
| 56 | void partiallyUpdateAppWidgetIds(String callingPackage, in int[] appWidgetIds, |
| 57 | in RemoteViews views); |
| 58 | void updateAppWidgetProvider(in ComponentName provider, in RemoteViews views); |
Sunny Goyal | 9080cf2 | 2017-12-06 17:35:58 -0800 | [diff] [blame] | 59 | void updateAppWidgetProviderInfo(in ComponentName provider, in String metadataKey); |
Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 60 | void notifyAppWidgetViewDataChanged(String packageName, in int[] appWidgetIds, int viewId); |
Tony Wickham | a41da04 | 2017-03-29 16:01:23 -0700 | [diff] [blame] | 61 | ParceledListSlice getInstalledProvidersForProfile(int categoryFilter, int profileId, |
| 62 | String packageName); |
Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 63 | AppWidgetProviderInfo getAppWidgetInfo(String callingPackage, int appWidgetId); |
Jim Miller | a75a883 | 2013-02-07 16:53:32 -0800 | [diff] [blame] | 64 | boolean hasBindAppWidgetPermission(in String packageName, int userId); |
Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 65 | void setBindAppWidgetPermission(in String packageName, int userId, in boolean permission); |
| 66 | boolean bindAppWidgetId(in String callingPackage, int appWidgetId, |
| 67 | int providerProfileId, in ComponentName providerComponent, in Bundle options); |
Sunny Goyal | e1273eb | 2017-10-18 00:17:20 -0700 | [diff] [blame] | 68 | boolean bindRemoteViewsService(String callingPackage, int appWidgetId, in Intent intent, |
| 69 | IApplicationThread caller, IBinder token, IServiceConnection connection, int flags); |
| 70 | |
Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 71 | int[] getAppWidgetIds(in ComponentName providerComponent); |
Amith Yamasani | e4a8da8 | 2015-04-30 17:32:25 -0700 | [diff] [blame] | 72 | boolean isBoundWidgetPackage(String packageName, int userId); |
Sunny Goyal | 87a563e | 2017-01-01 19:42:45 -0800 | [diff] [blame] | 73 | boolean requestPinAppWidget(String packageName, in ComponentName providerComponent, |
Sunny Goyal | 4ad6b57 | 2017-02-28 11:11:51 -0800 | [diff] [blame] | 74 | in Bundle extras, in IntentSender resultIntent); |
Sunny Goyal | 7f7372a | 2017-01-24 11:53:54 -0800 | [diff] [blame] | 75 | boolean isRequestPinAppWidgetSupported(); |
The Android Open Source Project | c39a6e0 | 2009-03-11 12:11:56 -0700 | [diff] [blame] | 76 | } |
| 77 | |