IPackageManager.aidl revision 843ef36f7b96cc19ea7d2996b7c8661b41ec3452
1/*
2**
3** Copyright 2007, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9**     http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18package android.content.pm;
19
20import android.content.ComponentName;
21import android.content.Intent;
22import android.content.IntentFilter;
23import android.content.pm.ActivityInfo;
24import android.content.pm.ApplicationInfo;
25import android.content.pm.IPackageInstallObserver;
26import android.content.pm.IPackageDeleteObserver;
27import android.content.pm.IPackageDataObserver;
28import android.content.pm.IPackageStatsObserver;
29import android.content.pm.InstrumentationInfo;
30import android.content.pm.PackageInfo;
31import android.content.pm.ProviderInfo;
32import android.content.pm.PermissionGroupInfo;
33import android.content.pm.PermissionInfo;
34import android.content.pm.ResolveInfo;
35import android.content.pm.ServiceInfo;
36import android.net.Uri;
37import android.app.PendingIntent;
38
39/**
40 *  See {@link PackageManager} for documentation on most of the APIs
41 *  here.
42 *
43 *  {@hide}
44 */
45interface IPackageManager {
46    PackageInfo getPackageInfo(String packageName, int flags);
47    int getPackageUid(String packageName);
48    int[] getPackageGids(String packageName);
49
50    PermissionInfo getPermissionInfo(String name, int flags);
51
52    List<PermissionInfo> queryPermissionsByGroup(String group, int flags);
53
54    PermissionGroupInfo getPermissionGroupInfo(String name, int flags);
55
56    List<PermissionGroupInfo> getAllPermissionGroups(int flags);
57
58    ApplicationInfo getApplicationInfo(String packageName, int flags);
59
60    ActivityInfo getActivityInfo(in ComponentName className, int flags);
61
62    ActivityInfo getReceiverInfo(in ComponentName className, int flags);
63
64    ServiceInfo getServiceInfo(in ComponentName className, int flags);
65
66    int checkPermission(String permName, String pkgName);
67
68    int checkUidPermission(String permName, int uid);
69
70    boolean addPermission(in PermissionInfo info);
71
72    void removePermission(String name);
73
74    int checkSignatures(String pkg1, String pkg2);
75
76    String[] getPackagesForUid(int uid);
77
78    String getNameForUid(int uid);
79
80    int getUidForSharedUser(String sharedUserName);
81
82    ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags);
83
84    List<ResolveInfo> queryIntentActivities(in Intent intent,
85            String resolvedType, int flags);
86
87    List<ResolveInfo> queryIntentActivityOptions(
88            in ComponentName caller, in Intent[] specifics,
89            in String[] specificTypes, in Intent intent,
90            String resolvedType, int flags);
91
92    List<ResolveInfo> queryIntentReceivers(in Intent intent,
93            String resolvedType, int flags);
94
95    ResolveInfo resolveService(in Intent intent,
96            String resolvedType, int flags);
97
98    List<ResolveInfo> queryIntentServices(in Intent intent,
99            String resolvedType, int flags);
100
101    List<PackageInfo> getInstalledPackages(int flags);
102
103    List<ApplicationInfo> getInstalledApplications(int flags);
104
105    /**
106     * Retrieve all applications that are marked as persistent.
107     *
108     * @return A List&lt;applicationInfo> containing one entry for each persistent
109     *         application.
110     */
111    List<ApplicationInfo> getPersistentApplications(int flags);
112
113    ProviderInfo resolveContentProvider(String name, int flags);
114
115    /**
116     * Retrieve sync information for all content providers.
117     *
118     * @param outNames Filled in with a list of the root names of the content
119     *                 providers that can sync.
120     * @param outInfo Filled in with a list of the ProviderInfo for each
121     *                name in 'outNames'.
122     */
123    void querySyncProviders(inout List<String> outNames,
124            inout List<ProviderInfo> outInfo);
125
126    List<ProviderInfo> queryContentProviders(
127            String processName, int uid, int flags);
128
129    InstrumentationInfo getInstrumentationInfo(
130            in ComponentName className, int flags);
131
132    List<InstrumentationInfo> queryInstrumentation(
133            String targetPackage, int flags);
134
135    /**
136     * Install a package.
137     *
138     * @param packageURI The location of the package file to install.
139     * @param observer a callback to use to notify when the package installation in finished.
140     * @param flags - possible values: {@link #FORWARD_LOCK_PACKAGE},
141     * {@link #REPLACE_EXISITING_PACKAGE}
142     * @param installerPackageName Optional package name of the application that is performing the
143     * installation. This identifies which market the package came from.
144     */
145    void installPackage(in Uri packageURI, IPackageInstallObserver observer, int flags,
146            in String installerPackageName);
147
148    /**
149     * Delete a package.
150     *
151     * @param packageName The fully qualified name of the package to delete.
152     * @param observer a callback to use to notify when the package deletion in finished.
153     * @param flags - possible values: {@link #DONT_DELETE_DATA}
154     */
155    void deletePackage(in String packageName, IPackageDeleteObserver observer, int flags);
156
157    String getInstallerPackageName(in String packageName);
158
159    void addPackageToPreferred(String packageName);
160
161    void removePackageFromPreferred(String packageName);
162
163    List<PackageInfo> getPreferredPackages(int flags);
164
165    void addPreferredActivity(in IntentFilter filter, int match,
166            in ComponentName[] set, in ComponentName activity);
167    void clearPackagePreferredActivities(String packageName);
168    int getPreferredActivities(out List<IntentFilter> outFilters,
169            out List<ComponentName> outActivities, String packageName);
170
171    /**
172     * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
173     */
174    void setComponentEnabledSetting(in ComponentName componentName,
175            in int newState, in int flags);
176
177    /**
178     * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.
179     */
180    int getComponentEnabledSetting(in ComponentName componentName);
181
182    /**
183     * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.
184     */
185    void setApplicationEnabledSetting(in String packageName, in int newState, int flags);
186
187    /**
188     * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.
189     */
190    int getApplicationEnabledSetting(in String packageName);
191
192    /**
193     * Free storage by deleting LRU sorted list of cache files across
194     * all applications. If the currently available free storage
195     * on the device is greater than or equal to the requested
196     * free storage, no cache files are cleared. If the currently
197     * available storage on the device is less than the requested
198     * free storage, some or all of the cache files across
199     * all applications are deleted (based on last accessed time)
200     * to increase the free storage space on the device to
201     * the requested value. There is no guarantee that clearing all
202     * the cache files from all applications will clear up
203     * enough storage to achieve the desired value.
204     * @param freeStorageSize The number of bytes of storage to be
205     * freed by the system. Say if freeStorageSize is XX,
206     * and the current free storage is YY,
207     * if XX is less than YY, just return. if not free XX-YY number
208     * of bytes if possible.
209     * @param observer call back used to notify when
210     * the operation is completed
211     */
212     void freeStorageAndNotify(in long freeStorageSize,
213             IPackageDataObserver observer);
214
215    /**
216     * Free storage by deleting LRU sorted list of cache files across
217     * all applications. If the currently available free storage
218     * on the device is greater than or equal to the requested
219     * free storage, no cache files are cleared. If the currently
220     * available storage on the device is less than the requested
221     * free storage, some or all of the cache files across
222     * all applications are deleted (based on last accessed time)
223     * to increase the free storage space on the device to
224     * the requested value. There is no guarantee that clearing all
225     * the cache files from all applications will clear up
226     * enough storage to achieve the desired value.
227     * @param freeStorageSize The number of bytes of storage to be
228     * freed by the system. Say if freeStorageSize is XX,
229     * and the current free storage is YY,
230     * if XX is less than YY, just return. if not free XX-YY number
231     * of bytes if possible.
232     * @param opFinishedIntent PendingIntent call back used to
233     * notify when the operation is completed.May be null
234     * to indicate that no call back is desired.
235     */
236     void freeStorage(in long freeStorageSize,
237             in PendingIntent opFinishedIntent);
238
239    /**
240     * Delete all the cache files in an applications cache directory
241     * @param packageName The package name of the application whose cache
242     * files need to be deleted
243     * @param observer a callback used to notify when the deletion is finished.
244     */
245    void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
246
247    /**
248     * Clear the user data directory of an application.
249     * @param packageName The package name of the application whose cache
250     * files need to be deleted
251     * @param observer a callback used to notify when the operation is completed.
252     */
253    void clearApplicationUserData(in String packageName, IPackageDataObserver observer);
254
255   /**
256     * Get package statistics including the code, data and cache size for
257     * an already installed package
258     * @param packageName The package name of the application
259     * @param observer a callback to use to notify when the asynchronous
260     * retrieval of information is complete.
261     */
262    void getPackageSizeInfo(in String packageName, IPackageStatsObserver observer);
263
264    /**
265     * Get a list of shared libraries that are available on the
266     * system.
267     */
268    String[] getSystemSharedLibraryNames();
269
270    void enterSafeMode();
271    boolean isSafeMode();
272    void systemReady();
273    boolean hasSystemUidErrors();
274}
275