IPackageManager.aidl revision 54a26bc85f4fe972e929e42b986c65a710a229b3
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.content.IntentSender;
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    boolean isProtectedBroadcast(String actionName);
75
76    int checkSignatures(String pkg1, String pkg2);
77
78    String[] getPackagesForUid(int uid);
79
80    String getNameForUid(int uid);
81
82    int getUidForSharedUser(String sharedUserName);
83
84    ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags);
85
86    List<ResolveInfo> queryIntentActivities(in Intent intent,
87            String resolvedType, int flags);
88
89    List<ResolveInfo> queryIntentActivityOptions(
90            in ComponentName caller, in Intent[] specifics,
91            in String[] specificTypes, in Intent intent,
92            String resolvedType, int flags);
93
94    List<ResolveInfo> queryIntentReceivers(in Intent intent,
95            String resolvedType, int flags);
96
97    ResolveInfo resolveService(in Intent intent,
98            String resolvedType, int flags);
99
100    List<ResolveInfo> queryIntentServices(in Intent intent,
101            String resolvedType, int flags);
102
103    List<PackageInfo> getInstalledPackages(int flags);
104
105    List<ApplicationInfo> getInstalledApplications(int flags);
106
107    /**
108     * Retrieve all applications that are marked as persistent.
109     *
110     * @return A List&lt;applicationInfo> containing one entry for each persistent
111     *         application.
112     */
113    List<ApplicationInfo> getPersistentApplications(int flags);
114
115    ProviderInfo resolveContentProvider(String name, int flags);
116
117    /**
118     * Retrieve sync information for all content providers.
119     *
120     * @param outNames Filled in with a list of the root names of the content
121     *                 providers that can sync.
122     * @param outInfo Filled in with a list of the ProviderInfo for each
123     *                name in 'outNames'.
124     * @deprecated
125     */
126    void querySyncProviders(inout List<String> outNames,
127            inout List<ProviderInfo> outInfo);
128
129    List<ProviderInfo> queryContentProviders(
130            String processName, int uid, int flags);
131
132    InstrumentationInfo getInstrumentationInfo(
133            in ComponentName className, int flags);
134
135    List<InstrumentationInfo> queryInstrumentation(
136            String targetPackage, int flags);
137
138    /**
139     * Install a package.
140     *
141     * @param packageURI The location of the package file to install.
142     * @param observer a callback to use to notify when the package installation in finished.
143     * @param flags - possible values: {@link #FORWARD_LOCK_PACKAGE},
144     * {@link #REPLACE_EXISITING_PACKAGE}
145     * @param installerPackageName Optional package name of the application that is performing the
146     * installation. This identifies which market the package came from.
147     */
148    void installPackage(in Uri packageURI, IPackageInstallObserver observer, int flags,
149            in String installerPackageName);
150
151    /**
152     * Delete a package.
153     *
154     * @param packageName The fully qualified name of the package to delete.
155     * @param observer a callback to use to notify when the package deletion in finished.
156     * @param flags - possible values: {@link #DONT_DELETE_DATA}
157     */
158    void deletePackage(in String packageName, IPackageDeleteObserver observer, int flags);
159
160    String getInstallerPackageName(in String packageName);
161
162    void addPackageToPreferred(String packageName);
163
164    void removePackageFromPreferred(String packageName);
165
166    List<PackageInfo> getPreferredPackages(int flags);
167
168    void addPreferredActivity(in IntentFilter filter, int match,
169            in ComponentName[] set, in ComponentName activity);
170
171    void replacePreferredActivity(in IntentFilter filter, int match,
172            in ComponentName[] set, in ComponentName activity);
173
174    void clearPackagePreferredActivities(String packageName);
175
176    int getPreferredActivities(out List<IntentFilter> outFilters,
177            out List<ComponentName> outActivities, String packageName);
178
179    /**
180     * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
181     */
182    void setComponentEnabledSetting(in ComponentName componentName,
183            in int newState, in int flags);
184
185    /**
186     * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.
187     */
188    int getComponentEnabledSetting(in ComponentName componentName);
189
190    /**
191     * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.
192     */
193    void setApplicationEnabledSetting(in String packageName, in int newState, int flags);
194
195    /**
196     * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.
197     */
198    int getApplicationEnabledSetting(in String packageName);
199
200    /**
201     * Free storage by deleting LRU sorted list of cache files across
202     * all applications. If the currently available free storage
203     * on the device is greater than or equal to the requested
204     * free storage, no cache files are cleared. If the currently
205     * available storage on the device is less than the requested
206     * free storage, some or all of the cache files across
207     * all applications are deleted (based on last accessed time)
208     * to increase the free storage space on the device to
209     * the requested value. There is no guarantee that clearing all
210     * the cache files from all applications will clear up
211     * enough storage to achieve the desired value.
212     * @param freeStorageSize The number of bytes of storage to be
213     * freed by the system. Say if freeStorageSize is XX,
214     * and the current free storage is YY,
215     * if XX is less than YY, just return. if not free XX-YY number
216     * of bytes if possible.
217     * @param observer call back used to notify when
218     * the operation is completed
219     */
220     void freeStorageAndNotify(in long freeStorageSize,
221             IPackageDataObserver observer);
222
223    /**
224     * Free storage by deleting LRU sorted list of cache files across
225     * all applications. If the currently available free storage
226     * on the device is greater than or equal to the requested
227     * free storage, no cache files are cleared. If the currently
228     * available storage on the device is less than the requested
229     * free storage, some or all of the cache files across
230     * all applications are deleted (based on last accessed time)
231     * to increase the free storage space on the device to
232     * the requested value. There is no guarantee that clearing all
233     * the cache files from all applications will clear up
234     * enough storage to achieve the desired value.
235     * @param freeStorageSize The number of bytes of storage to be
236     * freed by the system. Say if freeStorageSize is XX,
237     * and the current free storage is YY,
238     * if XX is less than YY, just return. if not free XX-YY number
239     * of bytes if possible.
240     * @param pi IntentSender call back used to
241     * notify when the operation is completed.May be null
242     * to indicate that no call back is desired.
243     */
244     void freeStorage(in long freeStorageSize,
245             in IntentSender pi);
246
247    /**
248     * Delete all the cache files in an applications cache directory
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 deletion is finished.
252     */
253    void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
254
255    /**
256     * Clear the user data directory of an application.
257     * @param packageName The package name of the application whose cache
258     * files need to be deleted
259     * @param observer a callback used to notify when the operation is completed.
260     */
261    void clearApplicationUserData(in String packageName, IPackageDataObserver observer);
262
263   /**
264     * Get package statistics including the code, data and cache size for
265     * an already installed package
266     * @param packageName The package name of the application
267     * @param observer a callback to use to notify when the asynchronous
268     * retrieval of information is complete.
269     */
270    void getPackageSizeInfo(in String packageName, IPackageStatsObserver observer);
271
272    /**
273     * Get a list of shared libraries that are available on the
274     * system.
275     */
276    String[] getSystemSharedLibraryNames();
277
278    void enterSafeMode();
279    boolean isSafeMode();
280    void systemReady();
281    boolean hasSystemUidErrors();
282
283    /**
284     * Ask the package manager to perform dex-opt (if needed) on the given
285     * package, if it already hasn't done mode.  Only does this if running
286     * in the special development "no pre-dexopt" mode.
287     */
288    boolean performDexOpt(String packageName);
289}
290