IPackageManager.aidl revision e7f972122db87dc54e41ed1a6e417534d43bca3a
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<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 void setInstallerPackageName(in String targetPackage, in String installerPackageName); 162 163 /** 164 * Delete a package. 165 * 166 * @param packageName The fully qualified name of the package to delete. 167 * @param observer a callback to use to notify when the package deletion in finished. 168 * @param flags - possible values: {@link #DONT_DELETE_DATA} 169 */ 170 void deletePackage(in String packageName, IPackageDeleteObserver observer, int flags); 171 172 String getInstallerPackageName(in String packageName); 173 174 void addPackageToPreferred(String packageName); 175 176 void removePackageFromPreferred(String packageName); 177 178 List<PackageInfo> getPreferredPackages(int flags); 179 180 void addPreferredActivity(in IntentFilter filter, int match, 181 in ComponentName[] set, in ComponentName activity); 182 183 void replacePreferredActivity(in IntentFilter filter, int match, 184 in ComponentName[] set, in ComponentName activity); 185 186 void clearPackagePreferredActivities(String packageName); 187 188 int getPreferredActivities(out List<IntentFilter> outFilters, 189 out List<ComponentName> outActivities, String packageName); 190 191 /** 192 * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}. 193 */ 194 void setComponentEnabledSetting(in ComponentName componentName, 195 in int newState, in int flags); 196 197 /** 198 * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}. 199 */ 200 int getComponentEnabledSetting(in ComponentName componentName); 201 202 /** 203 * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}. 204 */ 205 void setApplicationEnabledSetting(in String packageName, in int newState, int flags); 206 207 /** 208 * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}. 209 */ 210 int getApplicationEnabledSetting(in String packageName); 211 212 /** 213 * Set whether the given package should be considered stopped, making 214 * it not visible to implicit intents that filter out stopped packages. 215 */ 216 void setPackageStoppedState(String packageName, boolean stopped); 217 218 /** 219 * Free storage by deleting LRU sorted list of cache files across 220 * all applications. If the currently available free storage 221 * on the device is greater than or equal to the requested 222 * free storage, no cache files are cleared. If the currently 223 * available storage on the device is less than the requested 224 * free storage, some or all of the cache files across 225 * all applications are deleted (based on last accessed time) 226 * to increase the free storage space on the device to 227 * the requested value. There is no guarantee that clearing all 228 * the cache files from all applications will clear up 229 * enough storage to achieve the desired value. 230 * @param freeStorageSize The number of bytes of storage to be 231 * freed by the system. Say if freeStorageSize is XX, 232 * and the current free storage is YY, 233 * if XX is less than YY, just return. if not free XX-YY number 234 * of bytes if possible. 235 * @param observer call back used to notify when 236 * the operation is completed 237 */ 238 void freeStorageAndNotify(in long freeStorageSize, 239 IPackageDataObserver observer); 240 241 /** 242 * Free storage by deleting LRU sorted list of cache files across 243 * all applications. If the currently available free storage 244 * on the device is greater than or equal to the requested 245 * free storage, no cache files are cleared. If the currently 246 * available storage on the device is less than the requested 247 * free storage, some or all of the cache files across 248 * all applications are deleted (based on last accessed time) 249 * to increase the free storage space on the device to 250 * the requested value. There is no guarantee that clearing all 251 * the cache files from all applications will clear up 252 * enough storage to achieve the desired value. 253 * @param freeStorageSize The number of bytes of storage to be 254 * freed by the system. Say if freeStorageSize is XX, 255 * and the current free storage is YY, 256 * if XX is less than YY, just return. if not free XX-YY number 257 * of bytes if possible. 258 * @param pi IntentSender call back used to 259 * notify when the operation is completed.May be null 260 * to indicate that no call back is desired. 261 */ 262 void freeStorage(in long freeStorageSize, 263 in IntentSender pi); 264 265 /** 266 * Delete all the cache files in an applications cache directory 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 deletion is finished. 270 */ 271 void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer); 272 273 /** 274 * Clear the user data directory of an application. 275 * @param packageName The package name of the application whose cache 276 * files need to be deleted 277 * @param observer a callback used to notify when the operation is completed. 278 */ 279 void clearApplicationUserData(in String packageName, IPackageDataObserver observer); 280 281 /** 282 * Get package statistics including the code, data and cache size for 283 * an already installed package 284 * @param packageName The package name of the application 285 * @param observer a callback to use to notify when the asynchronous 286 * retrieval of information is complete. 287 */ 288 void getPackageSizeInfo(in String packageName, IPackageStatsObserver observer); 289 290 /** 291 * Get a list of shared libraries that are available on the 292 * system. 293 */ 294 String[] getSystemSharedLibraryNames(); 295 296 /** 297 * Get a list of features that are available on the 298 * system. 299 */ 300 FeatureInfo[] getSystemAvailableFeatures(); 301 302 boolean hasSystemFeature(String name); 303 304 void enterSafeMode(); 305 boolean isSafeMode(); 306 void systemReady(); 307 boolean hasSystemUidErrors(); 308 309 /** 310 * Ask the package manager to perform dex-opt (if needed) on the given 311 * package, if it already hasn't done mode. Only does this if running 312 * in the special development "no pre-dexopt" mode. 313 */ 314 boolean performDexOpt(String packageName); 315 316 /** 317 * Update status of external media on the package manager to scan and 318 * install packages installed on the external media. Like say the 319 * MountService uses this to call into the package manager to update 320 * status of sdcard. 321 */ 322 void updateExternalMediaStatus(boolean mounted, boolean reportStatus); 323 324 String nextPackageToClean(String lastPackage); 325 326 void movePackage(String packageName, IPackageMoveObserver observer, int flags); 327 328 boolean addPermissionAsync(in PermissionInfo info); 329 330 boolean setInstallLocation(int loc); 331 int getInstallLocation(); 332} 333