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