IPackageManager.aidl revision 54b6cfa9a9e5b861a9930af873580d6dc20f773c
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; 37 38/** 39 * See {@link PackageManager} for documentation on most of the APIs 40 * here. 41 * 42 * {@hide} 43 */ 44interface IPackageManager { 45 PackageInfo getPackageInfo(String packageName, int flags); 46 int getPackageUid(String packageName); 47 int[] getPackageGids(String packageName); 48 49 PermissionInfo getPermissionInfo(String name, int flags); 50 51 List<PermissionInfo> queryPermissionsByGroup(String group, int flags); 52 53 PermissionGroupInfo getPermissionGroupInfo(String name, int flags); 54 55 List<PermissionGroupInfo> getAllPermissionGroups(int flags); 56 57 ApplicationInfo getApplicationInfo(String packageName, int flags); 58 59 ActivityInfo getActivityInfo(in ComponentName className, int flags); 60 61 ActivityInfo getReceiverInfo(in ComponentName className, int flags); 62 63 ServiceInfo getServiceInfo(in ComponentName className, int flags); 64 65 int checkPermission(String permName, String pkgName); 66 67 int checkUidPermission(String permName, int uid); 68 69 boolean addPermission(in PermissionInfo info); 70 71 void removePermission(String name); 72 73 int checkSignatures(String pkg1, String pkg2); 74 75 String[] getPackagesForUid(int uid); 76 77 String getNameForUid(int uid); 78 79 ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags); 80 81 List<ResolveInfo> queryIntentActivities(in Intent intent, 82 String resolvedType, int flags); 83 84 List<ResolveInfo> queryIntentActivityOptions( 85 in ComponentName caller, in Intent[] specifics, 86 in String[] specificTypes, in Intent intent, 87 String resolvedType, int flags); 88 89 List<ResolveInfo> queryIntentReceivers(in Intent intent, 90 String resolvedType, int flags); 91 92 ResolveInfo resolveService(in Intent intent, 93 String resolvedType, int flags); 94 95 List<ResolveInfo> queryIntentServices(in Intent intent, 96 String resolvedType, int flags); 97 98 List<PackageInfo> getInstalledPackages(int flags); 99 100 List<ApplicationInfo> getInstalledApplications(int flags); 101 102 /** 103 * Retrieve all applications that are marked as persistent. 104 * 105 * @return A List<applicationInfo> containing one entry for each persistent 106 * application. 107 */ 108 List<ApplicationInfo> getPersistentApplications(int flags); 109 110 ProviderInfo resolveContentProvider(String name, int flags); 111 112 /** 113 * Retrieve sync information for all content providers. 114 * 115 * @param outNames Filled in with a list of the root names of the content 116 * providers that can sync. 117 * @param outInfo Filled in with a list of the ProviderInfo for each 118 * name in 'outNames'. 119 */ 120 void querySyncProviders(inout List<String> outNames, 121 inout List<ProviderInfo> outInfo); 122 123 List<ProviderInfo> queryContentProviders( 124 String processName, int uid, int flags); 125 126 InstrumentationInfo getInstrumentationInfo( 127 in ComponentName className, int flags); 128 129 List<InstrumentationInfo> queryInstrumentation( 130 String targetPackage, int flags); 131 132 /** 133 * Install a package. 134 * 135 * @param packageURI The location of the package file to install. 136 * @param observer a callback to use to notify when the package installation in finished. 137 * @param flags - possible values: {@link #FORWARD_LOCK_PACKAGE}, 138 * {@link #REPLACE_EXISITING_PACKAGE} 139 */ 140 void installPackage(in Uri packageURI, IPackageInstallObserver observer, int flags); 141 142 /** 143 * Delete a package. 144 * 145 * @param packageName The fully qualified name of the package to delete. 146 * @param observer a callback to use to notify when the package deletion in finished. 147 * @param flags - possible values: {@link #DONT_DELETE_DATA} 148 */ 149 void deletePackage(in String packageName, IPackageDeleteObserver observer, int flags); 150 151 void addPackageToPreferred(String packageName); 152 153 void removePackageFromPreferred(String packageName); 154 155 List<PackageInfo> getPreferredPackages(int flags); 156 157 void addPreferredActivity(in IntentFilter filter, int match, 158 in ComponentName[] set, in ComponentName activity); 159 void clearPackagePreferredActivities(String packageName); 160 int getPreferredActivities(out List<IntentFilter> outFilters, 161 out List<ComponentName> outActivities, String packageName); 162 163 /** 164 * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}. 165 */ 166 void setComponentEnabledSetting(in ComponentName componentName, 167 in int newState, in int flags); 168 169 /** 170 * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}. 171 */ 172 int getComponentEnabledSetting(in ComponentName componentName); 173 174 /** 175 * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}. 176 */ 177 void setApplicationEnabledSetting(in String packageName, in int newState, int flags); 178 179 /** 180 * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}. 181 */ 182 int getApplicationEnabledSetting(in String packageName); 183 184 /** 185 * Free storage by deleting LRU sorted list of cache files across all applications. 186 * If the currently available free storage on the device is greater than or equal to the 187 * requested free storage, no cache files are cleared. If the currently available storage on the 188 * device is less than the requested free storage, some or all of the cache files across 189 * all applications are deleted(based on last accessed time) to increase the free storage 190 * space on the device to the requested value. There is no gurantee that clearing all 191 * the cache files from all applications will clear up enough storage to achieve the desired 192 * value. 193 * @param freeStorageSize The number of bytes of storage to be 194 * freed by the system. Say if freeStorageSize is XX, 195 * and the current free storage is YY, 196 * if XX is less than YY, just return. if not free XX-YY number of 197 * bytes if possible. 198 * @param observer callback used to notify when the operation is completed 199 */ 200 void freeApplicationCache(in long freeStorageSize, IPackageDataObserver observer); 201 202 /** 203 * Delete all the cache files in an applications cache directory 204 * @param packageName The package name of the application whose cache 205 * files need to be deleted 206 * @param observer a callback used to notify when the deletion is finished. 207 */ 208 void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer); 209 210 /** 211 * Clear the user data directory of an application. 212 * @param packageName The package name of the application whose cache 213 * files need to be deleted 214 * @param observer a callback used to notify when the operation is completed. 215 */ 216 void clearApplicationUserData(in String packageName, IPackageDataObserver observer); 217 218 /** 219 * Get package statistics including the code, data and cache size for 220 * an already installed package 221 * @param packageName The package name of the application 222 * @param observer a callback to use to notify when the asynchronous 223 * retrieval of information is complete. 224 */ 225 void getPackageSizeInfo(in String packageName, IPackageStatsObserver observer); 226 227 void enterSafeMode(); 228 void systemReady(); 229 boolean hasSystemUidErrors(); 230} 231