blob: f9bf3736422bfe1c62a86c4d98104d04cf5f9d46 [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;
Svetoslav976e8bd2014-07-16 15:12:03 -070021import android.content.IntentSender;
22import android.content.pm.ApplicationInfo;
Hyunyoung Songccf6c682015-06-17 15:23:31 -070023import android.content.pm.ParceledListSlice;
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070024import android.appwidget.AppWidgetProviderInfo;
25import com.android.internal.appwidget.IAppWidgetHost;
Adam Cohene8724c82012-04-19 17:11:40 -070026import android.os.Bundle;
Winson Chung81f39eb2011-01-11 18:05:01 -080027import android.os.IBinder;
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070028import android.widget.RemoteViews;
Sunny Goyale1273eb2017-10-18 00:17:20 -070029import android.app.IApplicationThread;
30import android.app.IServiceConnection;
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070031
32/** {@hide} */
33interface IAppWidgetService {
Jim Millera75a8832013-02-07 16:53:32 -080034
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070035 //
36 // for AppWidgetHost
37 //
Sunny Goyal2857f1c2016-03-31 11:27:13 -070038 ParceledListSlice startListening(IAppWidgetHost host, String callingPackage, int hostId,
Sunny Goyal6d1b41d2016-05-11 18:22:20 -070039 in int[] appWidgetIds);
Svetoslav976e8bd2014-07-16 15:12:03 -070040 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);
Svetoslav8e1d2992014-08-08 12:48:06 -070047 IntentSender createAppWidgetConfigIntentSender(String callingPackage, int appWidgetId,
48 int intentFlags);
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070049
50 //
51 // for AppWidgetManager
52 //
Svetoslav976e8bd2014-07-16 15:12:03 -070053 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 Goyal9080cf22017-12-06 17:35:58 -080059 void updateAppWidgetProviderInfo(in ComponentName provider, in String metadataKey);
Svetoslav976e8bd2014-07-16 15:12:03 -070060 void notifyAppWidgetViewDataChanged(String packageName, in int[] appWidgetIds, int viewId);
Tony Wickhama41da042017-03-29 16:01:23 -070061 ParceledListSlice getInstalledProvidersForProfile(int categoryFilter, int profileId,
62 String packageName);
Svetoslav976e8bd2014-07-16 15:12:03 -070063 AppWidgetProviderInfo getAppWidgetInfo(String callingPackage, int appWidgetId);
Jim Millera75a8832013-02-07 16:53:32 -080064 boolean hasBindAppWidgetPermission(in String packageName, int userId);
Svetoslav976e8bd2014-07-16 15:12:03 -070065 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 Goyale1273eb2017-10-18 00:17:20 -070068 boolean bindRemoteViewsService(String callingPackage, int appWidgetId, in Intent intent,
69 IApplicationThread caller, IBinder token, IServiceConnection connection, int flags);
70
Svetoslav976e8bd2014-07-16 15:12:03 -070071 int[] getAppWidgetIds(in ComponentName providerComponent);
Amith Yamasanie4a8da82015-04-30 17:32:25 -070072 boolean isBoundWidgetPackage(String packageName, int userId);
Sunny Goyal87a563e2017-01-01 19:42:45 -080073 boolean requestPinAppWidget(String packageName, in ComponentName providerComponent,
Sunny Goyal4ad6b572017-02-28 11:11:51 -080074 in Bundle extras, in IntentSender resultIntent);
Sunny Goyal7f7372a2017-01-24 11:53:54 -080075 boolean isRequestPinAppWidgetSupported();
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -070076}
77