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