blob: 5656b6bdc3813e1db0f94c1bf93e240a1ff9b01a [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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;
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -070038import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039
40/**
41 * See {@link PackageManager} for documentation on most of the APIs
42 * here.
43 *
44 * {@hide}
45 */
46interface IPackageManager {
47 PackageInfo getPackageInfo(String packageName, int flags);
48 int getPackageUid(String packageName);
49 int[] getPackageGids(String packageName);
50
51 PermissionInfo getPermissionInfo(String name, int flags);
52
53 List<PermissionInfo> queryPermissionsByGroup(String group, int flags);
54
55 PermissionGroupInfo getPermissionGroupInfo(String name, int flags);
56
57 List<PermissionGroupInfo> getAllPermissionGroups(int flags);
58
59 ApplicationInfo getApplicationInfo(String packageName, int flags);
60
61 ActivityInfo getActivityInfo(in ComponentName className, int flags);
62
63 ActivityInfo getReceiverInfo(in ComponentName className, int flags);
64
65 ServiceInfo getServiceInfo(in ComponentName className, int flags);
66
67 int checkPermission(String permName, String pkgName);
68
69 int checkUidPermission(String permName, int uid);
70
71 boolean addPermission(in PermissionInfo info);
72
73 void removePermission(String name);
74
75 int checkSignatures(String pkg1, String pkg2);
76
77 String[] getPackagesForUid(int uid);
78
79 String getNameForUid(int uid);
80
81 int getUidForSharedUser(String sharedUserName);
82
83 ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags);
84
85 List<ResolveInfo> queryIntentActivities(in Intent intent,
86 String resolvedType, int flags);
87
88 List<ResolveInfo> queryIntentActivityOptions(
89 in ComponentName caller, in Intent[] specifics,
90 in String[] specificTypes, in Intent intent,
91 String resolvedType, int flags);
92
93 List<ResolveInfo> queryIntentReceivers(in Intent intent,
94 String resolvedType, int flags);
95
96 ResolveInfo resolveService(in Intent intent,
97 String resolvedType, int flags);
98
99 List<ResolveInfo> queryIntentServices(in Intent intent,
100 String resolvedType, int flags);
101
102 List<PackageInfo> getInstalledPackages(int flags);
103
104 List<ApplicationInfo> getInstalledApplications(int flags);
105
106 /**
107 * Retrieve all applications that are marked as persistent.
108 *
109 * @return A List&lt;applicationInfo> containing one entry for each persistent
110 * application.
111 */
112 List<ApplicationInfo> getPersistentApplications(int flags);
113
114 ProviderInfo resolveContentProvider(String name, int flags);
115
116 /**
117 * Retrieve sync information for all content providers.
118 *
119 * @param outNames Filled in with a list of the root names of the content
120 * providers that can sync.
121 * @param outInfo Filled in with a list of the ProviderInfo for each
122 * name in 'outNames'.
123 */
124 void querySyncProviders(inout List<String> outNames,
125 inout List<ProviderInfo> outInfo);
126
127 List<ProviderInfo> queryContentProviders(
128 String processName, int uid, int flags);
129
130 InstrumentationInfo getInstrumentationInfo(
131 in ComponentName className, int flags);
132
133 List<InstrumentationInfo> queryInstrumentation(
134 String targetPackage, int flags);
135
136 /**
137 * Install a package.
138 *
139 * @param packageURI The location of the package file to install.
140 * @param observer a callback to use to notify when the package installation in finished.
141 * @param flags - possible values: {@link #FORWARD_LOCK_PACKAGE},
142 * {@link #REPLACE_EXISITING_PACKAGE}
Jacek Surazskic64322c2009-04-28 15:26:38 +0200143 * @param installerPackageName Optional package name of the application that is performing the
144 * installation. This identifies which market the package came from.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800145 */
Jacek Surazskic64322c2009-04-28 15:26:38 +0200146 void installPackage(in Uri packageURI, IPackageInstallObserver observer, int flags,
147 in String installerPackageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800148
149 /**
150 * Delete a package.
151 *
152 * @param packageName The fully qualified name of the package to delete.
153 * @param observer a callback to use to notify when the package deletion in finished.
154 * @param flags - possible values: {@link #DONT_DELETE_DATA}
155 */
156 void deletePackage(in String packageName, IPackageDeleteObserver observer, int flags);
157
Jacek Surazskic64322c2009-04-28 15:26:38 +0200158 String getInstallerPackageName(in String packageName);
159
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800160 void addPackageToPreferred(String packageName);
161
162 void removePackageFromPreferred(String packageName);
163
164 List<PackageInfo> getPreferredPackages(int flags);
165
166 void addPreferredActivity(in IntentFilter filter, int match,
167 in ComponentName[] set, in ComponentName activity);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100168
169 void replacePreferredActivity(in IntentFilter filter, int match,
170 in ComponentName[] set, in ComponentName activity);
171
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800172 void clearPackagePreferredActivities(String packageName);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100173
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800174 int getPreferredActivities(out List<IntentFilter> outFilters,
175 out List<ComponentName> outActivities, String packageName);
176
177 /**
178 * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
179 */
180 void setComponentEnabledSetting(in ComponentName componentName,
181 in int newState, in int flags);
182
183 /**
184 * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.
185 */
186 int getComponentEnabledSetting(in ComponentName componentName);
187
188 /**
189 * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.
190 */
191 void setApplicationEnabledSetting(in String packageName, in int newState, int flags);
192
193 /**
194 * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.
195 */
196 int getApplicationEnabledSetting(in String packageName);
197
198 /**
199 * Free storage by deleting LRU sorted list of cache files across
200 * all applications. If the currently available free storage
201 * on the device is greater than or equal to the requested
202 * free storage, no cache files are cleared. If the currently
203 * available storage on the device is less than the requested
204 * free storage, some or all of the cache files across
205 * all applications are deleted (based on last accessed time)
206 * to increase the free storage space on the device to
207 * the requested value. There is no guarantee that clearing all
208 * the cache files from all applications will clear up
209 * enough storage to achieve the desired value.
210 * @param freeStorageSize The number of bytes of storage to be
211 * freed by the system. Say if freeStorageSize is XX,
212 * and the current free storage is YY,
213 * if XX is less than YY, just return. if not free XX-YY number
214 * of bytes if possible.
215 * @param observer call back used to notify when
216 * the operation is completed
217 */
218 void freeStorageAndNotify(in long freeStorageSize,
219 IPackageDataObserver observer);
220
221 /**
222 * Free storage by deleting LRU sorted list of cache files across
223 * all applications. If the currently available free storage
224 * on the device is greater than or equal to the requested
225 * free storage, no cache files are cleared. If the currently
226 * available storage on the device is less than the requested
227 * free storage, some or all of the cache files across
228 * all applications are deleted (based on last accessed time)
229 * to increase the free storage space on the device to
230 * the requested value. There is no guarantee that clearing all
231 * the cache files from all applications will clear up
232 * enough storage to achieve the desired value.
233 * @param freeStorageSize The number of bytes of storage to be
234 * freed by the system. Say if freeStorageSize is XX,
235 * and the current free storage is YY,
236 * if XX is less than YY, just return. if not free XX-YY number
237 * of bytes if possible.
238 * @param opFinishedIntent PendingIntent call back used to
239 * notify when the operation is completed.May be null
240 * to indicate that no call back is desired.
241 */
242 void freeStorage(in long freeStorageSize,
243 in PendingIntent opFinishedIntent);
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700244
245 /**
246 * Free storage by deleting LRU sorted list of cache files across
247 * all applications. If the currently available free storage
248 * on the device is greater than or equal to the requested
249 * free storage, no cache files are cleared. If the currently
250 * available storage on the device is less than the requested
251 * free storage, some or all of the cache files across
252 * all applications are deleted (based on last accessed time)
253 * to increase the free storage space on the device to
254 * the requested value. There is no guarantee that clearing all
255 * the cache files from all applications will clear up
256 * enough storage to achieve the desired value.
257 * @param freeStorageSize The number of bytes of storage to be
258 * freed by the system. Say if freeStorageSize is XX,
259 * and the current free storage is YY,
260 * if XX is less than YY, just return. if not free XX-YY number
261 * of bytes if possible.
262 * @param pi IntentSender call back used to
263 * notify when the operation is completed.May be null
264 * to indicate that no call back is desired.
265 */
266 void freeStorageWithIntent(in long freeStorageSize,
267 in IntentSender pi);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800268
269 /**
270 * Delete all the cache files in an applications cache directory
271 * @param packageName The package name of the application whose cache
272 * files need to be deleted
273 * @param observer a callback used to notify when the deletion is finished.
274 */
275 void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
276
277 /**
278 * Clear the user data directory of an application.
279 * @param packageName The package name of the application whose cache
280 * files need to be deleted
281 * @param observer a callback used to notify when the operation is completed.
282 */
283 void clearApplicationUserData(in String packageName, IPackageDataObserver observer);
284
285 /**
286 * Get package statistics including the code, data and cache size for
287 * an already installed package
288 * @param packageName The package name of the application
289 * @param observer a callback to use to notify when the asynchronous
290 * retrieval of information is complete.
291 */
292 void getPackageSizeInfo(in String packageName, IPackageStatsObserver observer);
293
294 /**
295 * Get a list of shared libraries that are available on the
296 * system.
297 */
298 String[] getSystemSharedLibraryNames();
299
300 void enterSafeMode();
301 boolean isSafeMode();
302 void systemReady();
303 boolean hasSystemUidErrors();
304}