IPackageManager.aidl revision a1cbb94dbc9a82d4eb3a47242fe161af21803858
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 * Free storage by deleting LRU sorted list of cache files across 214 * all applications. If the currently available free storage 215 * on the device is greater than or equal to the requested 216 * free storage, no cache files are cleared. If the currently 217 * available storage on the device is less than the requested 218 * free storage, some or all of the cache files across 219 * all applications are deleted (based on last accessed time) 220 * to increase the free storage space on the device to 221 * the requested value. There is no guarantee that clearing all 222 * the cache files from all applications will clear up 223 * enough storage to achieve the desired value. 224 * @param freeStorageSize The number of bytes of storage to be 225 * freed by the system. Say if freeStorageSize is XX, 226 * and the current free storage is YY, 227 * if XX is less than YY, just return. if not free XX-YY number 228 * of bytes if possible. 229 * @param observer call back used to notify when 230 * the operation is completed 231 */ 232 void freeStorageAndNotify(in long freeStorageSize, 233 IPackageDataObserver observer); 234 235 /** 236 * Free storage by deleting LRU sorted list of cache files across 237 * all applications. If the currently available free storage 238 * on the device is greater than or equal to the requested 239 * free storage, no cache files are cleared. If the currently 240 * available storage on the device is less than the requested 241 * free storage, some or all of the cache files across 242 * all applications are deleted (based on last accessed time) 243 * to increase the free storage space on the device to 244 * the requested value. There is no guarantee that clearing all 245 * the cache files from all applications will clear up 246 * enough storage to achieve the desired value. 247 * @param freeStorageSize The number of bytes of storage to be 248 * freed by the system. Say if freeStorageSize is XX, 249 * and the current free storage is YY, 250 * if XX is less than YY, just return. if not free XX-YY number 251 * of bytes if possible. 252 * @param pi IntentSender call back used to 253 * notify when the operation is completed.May be null 254 * to indicate that no call back is desired. 255 */ 256 void freeStorage(in long freeStorageSize, 257 in IntentSender pi); 258 259 /** 260 * Delete all the cache files in an applications cache directory 261 * @param packageName The package name of the application whose cache 262 * files need to be deleted 263 * @param observer a callback used to notify when the deletion is finished. 264 */ 265 void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer); 266 267 /** 268 * Clear the user data directory of an application. 269 * @param packageName The package name of the application whose cache 270 * files need to be deleted 271 * @param observer a callback used to notify when the operation is completed. 272 */ 273 void clearApplicationUserData(in String packageName, IPackageDataObserver observer); 274 275 /** 276 * Get package statistics including the code, data and cache size for 277 * an already installed package 278 * @param packageName The package name of the application 279 * @param observer a callback to use to notify when the asynchronous 280 * retrieval of information is complete. 281 */ 282 void getPackageSizeInfo(in String packageName, IPackageStatsObserver observer); 283 284 /** 285 * Get a list of shared libraries that are available on the 286 * system. 287 */ 288 String[] getSystemSharedLibraryNames(); 289 290 /** 291 * Get a list of features that are available on the 292 * system. 293 */ 294 FeatureInfo[] getSystemAvailableFeatures(); 295 296 boolean hasSystemFeature(String name); 297 298 void enterSafeMode(); 299 boolean isSafeMode(); 300 void systemReady(); 301 boolean hasSystemUidErrors(); 302 303 /** 304 * Ask the package manager to perform dex-opt (if needed) on the given 305 * package, if it already hasn't done mode. Only does this if running 306 * in the special development "no pre-dexopt" mode. 307 */ 308 boolean performDexOpt(String packageName); 309 310 /** 311 * Update status of external media on the package manager to scan and 312 * install packages installed on the external media. Like say the 313 * MountService uses this to call into the package manager to update 314 * status of sdcard. 315 */ 316 void updateExternalMediaStatus(boolean mounted, boolean reportStatus); 317 318 String nextPackageToClean(String lastPackage); 319 320 void movePackage(String packageName, IPackageMoveObserver observer, int flags); 321 322 boolean addPermissionAsync(in PermissionInfo info); 323 324 boolean setInstallLocation(int loc); 325 int getInstallLocation(); 326} 327