IPackageManager.aidl revision 6c4d904851772313930f800ac7c323cf90c709bb
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.FeatureInfo;
26import android.content.pm.IPackageInstallObserver;
27import android.content.pm.IPackageDeleteObserver;
28import android.content.pm.IPackageDataObserver;
29import android.content.pm.IPackageMoveObserver;
30import android.content.pm.IPackageStatsObserver;
31import android.content.pm.InstrumentationInfo;
32import android.content.pm.PackageInfo;
33import android.content.pm.ProviderInfo;
34import android.content.pm.PermissionGroupInfo;
35import android.content.pm.PermissionInfo;
36import android.content.pm.ResolveInfo;
37import android.content.pm.ServiceInfo;
38import android.net.Uri;
39import android.content.IntentSender;
40
41/**
42 *  See {@link PackageManager} for documentation on most of the APIs
43 *  here.
44 *
45 *  {@hide}
46 */
47interface IPackageManager {
48    PackageInfo getPackageInfo(String packageName, int flags);
49    int getPackageUid(String packageName);
50    int[] getPackageGids(String packageName);
51
52    String[] currentToCanonicalPackageNames(in String[] names);
53    String[] canonicalToCurrentPackageNames(in String[] names);
54
55    PermissionInfo getPermissionInfo(String name, int flags);
56
57    List<PermissionInfo> queryPermissionsByGroup(String group, int flags);
58
59    PermissionGroupInfo getPermissionGroupInfo(String name, int flags);
60
61    List<PermissionGroupInfo> getAllPermissionGroups(int flags);
62
63    ApplicationInfo getApplicationInfo(String packageName, int flags);
64
65    ActivityInfo getActivityInfo(in ComponentName className, int flags);
66
67    ActivityInfo getReceiverInfo(in ComponentName className, int flags);
68
69    ServiceInfo getServiceInfo(in ComponentName className, int flags);
70
71    ProviderInfo getProviderInfo(in ComponentName className, int flags);
72
73    int checkPermission(String permName, String pkgName);
74
75    int checkUidPermission(String permName, int uid);
76
77    boolean addPermission(in PermissionInfo info);
78
79    void removePermission(String name);
80
81    boolean isProtectedBroadcast(String actionName);
82
83    int checkSignatures(String pkg1, String pkg2);
84
85    int checkUidSignatures(int uid1, int uid2);
86
87    String[] getPackagesForUid(int uid);
88
89    String getNameForUid(int uid);
90
91    int getUidForSharedUser(String sharedUserName);
92
93    ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags);
94
95    List<ResolveInfo> queryIntentActivities(in Intent intent,
96            String resolvedType, int flags);
97
98    List<ResolveInfo> queryIntentActivityOptions(
99            in ComponentName caller, in Intent[] specifics,
100            in String[] specificTypes, in Intent intent,
101            String resolvedType, int flags);
102
103    List<ResolveInfo> queryIntentReceivers(in Intent intent,
104            String resolvedType, int flags);
105
106    ResolveInfo resolveService(in Intent intent,
107            String resolvedType, int flags);
108
109    List<ResolveInfo> queryIntentServices(in Intent intent,
110            String resolvedType, int flags);
111
112    List<PackageInfo> getInstalledPackages(int flags);
113
114    List<ApplicationInfo> getInstalledApplications(int flags);
115
116    /**
117     * Retrieve all applications that are marked as persistent.
118     *
119     * @return A List&lt;applicationInfo> containing one entry for each persistent
120     *         application.
121     */
122    List<ApplicationInfo> getPersistentApplications(int flags);
123
124    ProviderInfo resolveContentProvider(String name, int flags);
125
126    /**
127     * Retrieve sync information for all content providers.
128     *
129     * @param outNames Filled in with a list of the root names of the content
130     *                 providers that can sync.
131     * @param outInfo Filled in with a list of the ProviderInfo for each
132     *                name in 'outNames'.
133     */
134    void querySyncProviders(inout List<String> outNames,
135            inout List<ProviderInfo> outInfo);
136
137    List<ProviderInfo> queryContentProviders(
138            String processName, int uid, int flags);
139
140    InstrumentationInfo getInstrumentationInfo(
141            in ComponentName className, int flags);
142
143    List<InstrumentationInfo> queryInstrumentation(
144            String targetPackage, int flags);
145
146    /**
147     * Install a package.
148     *
149     * @param packageURI The location of the package file to install.
150     * @param observer a callback to use to notify when the package installation in finished.
151     * @param flags - possible values: {@link #FORWARD_LOCK_PACKAGE},
152     * {@link #REPLACE_EXISITING_PACKAGE}
153     * @param installerPackageName Optional package name of the application that is performing the
154     * installation. This identifies which market the package came from.
155     */
156    void installPackage(in Uri packageURI, IPackageInstallObserver observer, int flags,
157            in String installerPackageName);
158
159    void finishPackageInstall(int token);
160
161    /**
162     * Delete a package.
163     *
164     * @param packageName The fully qualified name of the package to delete.
165     * @param observer a callback to use to notify when the package deletion in finished.
166     * @param flags - possible values: {@link #DONT_DELETE_DATA}
167     */
168    void deletePackage(in String packageName, IPackageDeleteObserver observer, int flags);
169
170    String getInstallerPackageName(in String packageName);
171
172    void addPackageToPreferred(String packageName);
173
174    void removePackageFromPreferred(String packageName);
175
176    List<PackageInfo> getPreferredPackages(int flags);
177
178    void addPreferredActivity(in IntentFilter filter, int match,
179            in ComponentName[] set, in ComponentName activity);
180
181    void replacePreferredActivity(in IntentFilter filter, int match,
182            in ComponentName[] set, in ComponentName activity);
183
184    void clearPackagePreferredActivities(String packageName);
185
186    int getPreferredActivities(out List<IntentFilter> outFilters,
187            out List<ComponentName> outActivities, String packageName);
188
189    /**
190     * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
191     */
192    void setComponentEnabledSetting(in ComponentName componentName,
193            in int newState, in int flags);
194
195    /**
196     * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.
197     */
198    int getComponentEnabledSetting(in ComponentName componentName);
199
200    /**
201     * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.
202     */
203    void setApplicationEnabledSetting(in String packageName, in int newState, int flags);
204
205    /**
206     * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.
207     */
208    int getApplicationEnabledSetting(in String packageName);
209
210    /**
211     * Free storage by deleting LRU sorted list of cache files across
212     * all applications. If the currently available free storage
213     * on the device is greater than or equal to the requested
214     * free storage, no cache files are cleared. If the currently
215     * available storage on the device is less than the requested
216     * free storage, some or all of the cache files across
217     * all applications are deleted (based on last accessed time)
218     * to increase the free storage space on the device to
219     * the requested value. There is no guarantee that clearing all
220     * the cache files from all applications will clear up
221     * enough storage to achieve the desired value.
222     * @param freeStorageSize The number of bytes of storage to be
223     * freed by the system. Say if freeStorageSize is XX,
224     * and the current free storage is YY,
225     * if XX is less than YY, just return. if not free XX-YY number
226     * of bytes if possible.
227     * @param observer call back used to notify when
228     * the operation is completed
229     */
230     void freeStorageAndNotify(in long freeStorageSize,
231             IPackageDataObserver observer);
232
233    /**
234     * Free storage by deleting LRU sorted list of cache files across
235     * all applications. If the currently available free storage
236     * on the device is greater than or equal to the requested
237     * free storage, no cache files are cleared. If the currently
238     * available storage on the device is less than the requested
239     * free storage, some or all of the cache files across
240     * all applications are deleted (based on last accessed time)
241     * to increase the free storage space on the device to
242     * the requested value. There is no guarantee that clearing all
243     * the cache files from all applications will clear up
244     * enough storage to achieve the desired value.
245     * @param freeStorageSize The number of bytes of storage to be
246     * freed by the system. Say if freeStorageSize is XX,
247     * and the current free storage is YY,
248     * if XX is less than YY, just return. if not free XX-YY number
249     * of bytes if possible.
250     * @param pi IntentSender call back used to
251     * notify when the operation is completed.May be null
252     * to indicate that no call back is desired.
253     */
254     void freeStorage(in long freeStorageSize,
255             in IntentSender pi);
256
257    /**
258     * Delete all the cache files in an applications cache directory
259     * @param packageName The package name of the application whose cache
260     * files need to be deleted
261     * @param observer a callback used to notify when the deletion is finished.
262     */
263    void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
264
265    /**
266     * Clear the user data directory of an application.
267     * @param packageName The package name of the application whose cache
268     * files need to be deleted
269     * @param observer a callback used to notify when the operation is completed.
270     */
271    void clearApplicationUserData(in String packageName, IPackageDataObserver observer);
272
273   /**
274     * Get package statistics including the code, data and cache size for
275     * an already installed package
276     * @param packageName The package name of the application
277     * @param observer a callback to use to notify when the asynchronous
278     * retrieval of information is complete.
279     */
280    void getPackageSizeInfo(in String packageName, IPackageStatsObserver observer);
281
282    /**
283     * Get a list of shared libraries that are available on the
284     * system.
285     */
286    String[] getSystemSharedLibraryNames();
287
288    /**
289     * Get a list of features that are available on the
290     * system.
291     */
292    FeatureInfo[] getSystemAvailableFeatures();
293
294    boolean hasSystemFeature(String name);
295
296    void enterSafeMode();
297    boolean isSafeMode();
298    void systemReady();
299    boolean hasSystemUidErrors();
300
301    /**
302     * Ask the package manager to perform dex-opt (if needed) on the given
303     * package, if it already hasn't done mode.  Only does this if running
304     * in the special development "no pre-dexopt" mode.
305     */
306    boolean performDexOpt(String packageName);
307
308    /**
309     * Update status of external media on the package manager to scan and
310     * install packages installed on the external media. Like say the
311     * MountService uses this to call into the package manager to update
312     * status of sdcard.
313     */
314    void updateExternalMediaStatus(boolean mounted, boolean reportStatus);
315
316    String nextPackageToClean(String lastPackage);
317
318    void movePackage(String packageName, IPackageMoveObserver observer, int flags);
319
320    boolean addPermissionAsync(in PermissionInfo info);
321
322    boolean setInstallLocation(int loc);
323    int getInstallLocation();
324
325    void setPackageObbPaths(in String packageName, in String[] paths);
326    String[] getPackageObbPaths(in String packageName);
327}
328