| 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.content.pm.ParceledListSlice; |
| 24 |
import android.appwidget.AppWidgetProviderInfo; |
| 25 |
import com.android.internal.appwidget.IAppWidgetHost; |
| 26 |
import android.os.Bundle; |
| 27 |
import android.os.IBinder; |
| 28 |
import android.widget.RemoteViews; |
| 29 |
import android.app.IApplicationThread; |
| 30 |
import android.app.IServiceConnection; |
| 31 |
|
| 32 |
/** {@hide} */ |
| 33 |
interface IAppWidgetService { |
| 34 |
|
| 35 |
// |
| 36 |
// for AppWidgetHost |
| 37 |
// |
| 38 |
ParceledListSlice startListening(IAppWidgetHost host, String callingPackage, int hostId, |
| 39 |
in int[] appWidgetIds); |
| 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 |
@UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) |
| 46 |
RemoteViews getAppWidgetViews(String callingPackage, int appWidgetId); |
| 47 |
int[] getAppWidgetIdsForHost(String callingPackage, int hostId); |
| 48 |
void setAppWidgetHidden(in String callingPackage, int hostId); |
| 49 |
IntentSender createAppWidgetConfigIntentSender(String callingPackage, int appWidgetId, |
| 50 |
int intentFlags); |
| 51 |
|
| 52 |
// |
| 53 |
// for AppWidgetManager |
| 54 |
// |
| 55 |
void updateAppWidgetIds(String callingPackage, in int[] appWidgetIds, in RemoteViews views); |
| 56 |
void updateAppWidgetOptions(String callingPackage, int appWidgetId, in Bundle extras); |
| 57 |
Bundle getAppWidgetOptions(String callingPackage, int appWidgetId); |
| 58 |
void partiallyUpdateAppWidgetIds(String callingPackage, in int[] appWidgetIds, |
| 59 |
in RemoteViews views); |
| 60 |
void updateAppWidgetProvider(in ComponentName provider, in RemoteViews views); |
| 61 |
void updateAppWidgetProviderInfo(in ComponentName provider, in String metadataKey); |
| 62 |
void notifyAppWidgetViewDataChanged(String packageName, in int[] appWidgetIds, int viewId); |
| 63 |
ParceledListSlice getInstalledProvidersForProfile(int categoryFilter, int profileId, |
| 64 |
String packageName); |
| 65 |
AppWidgetProviderInfo getAppWidgetInfo(String callingPackage, int appWidgetId); |
| 66 |
boolean hasBindAppWidgetPermission(in String packageName, int userId); |
| 67 |
void setBindAppWidgetPermission(in String packageName, int userId, in boolean permission); |
| 68 |
@UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) |
| 69 |
boolean bindAppWidgetId(in String callingPackage, int appWidgetId, |
| 70 |
int providerProfileId, in ComponentName providerComponent, in Bundle options); |
| 71 |
@UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) |
| 72 |
boolean bindRemoteViewsService(String callingPackage, int appWidgetId, in Intent intent, |
| 73 |
IApplicationThread caller, IBinder token, IServiceConnection connection, int flags); |
| 74 |
void notifyProviderInheritance(in ComponentName[] componentNames); |
| 75 |
|
| 76 |
@UnsupportedAppUsage |
| 77 |
int[] getAppWidgetIds(in ComponentName providerComponent); |
| 78 |
boolean isBoundWidgetPackage(String packageName, int userId); |
| 79 |
boolean requestPinAppWidget(String packageName, in ComponentName providerComponent, |
| 80 |
in Bundle extras, in IntentSender resultIntent); |
| 81 |
boolean isRequestPinAppWidgetSupported(); |
| 82 |
oneway void noteAppWidgetTapped(in String callingPackage, in int appWidgetId); |
| 83 |
} |
| 84 |
|