The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.content; |
| 18 | |
Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 19 | import android.app.Activity; |
| 20 | import android.app.ActivityManagerNative; |
| 21 | import android.app.LoadedApk; |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 22 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | import android.content.pm.PackageManager; |
| 24 | import android.content.res.AssetManager; |
Dianne Hackborn | 756220b | 2012-08-14 16:45:30 -0700 | [diff] [blame] | 25 | import android.content.res.Configuration; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | import android.content.res.Resources; |
Vasu Nori | 74f170f | 2010-06-01 18:06:18 -0700 | [diff] [blame] | 27 | import android.database.DatabaseErrorHandler; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | import android.database.sqlite.SQLiteDatabase; |
| 29 | import android.database.sqlite.SQLiteDatabase.CursorFactory; |
| 30 | import android.graphics.Bitmap; |
| 31 | import android.graphics.drawable.Drawable; |
| 32 | import android.net.Uri; |
| 33 | import android.os.Bundle; |
| 34 | import android.os.Handler; |
| 35 | import android.os.Looper; |
Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 36 | import android.os.RemoteException; |
Dianne Hackborn | 79af1dd | 2012-08-16 16:42:52 -0700 | [diff] [blame] | 37 | import android.os.UserHandle; |
Craig Mautner | 48d0d18 | 2013-06-11 07:53:06 -0700 | [diff] [blame] | 38 | import android.view.DisplayAdjustments; |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 39 | import android.view.Display; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 | |
| 41 | import java.io.File; |
| 42 | import java.io.FileInputStream; |
| 43 | import java.io.FileNotFoundException; |
| 44 | import java.io.FileOutputStream; |
| 45 | import java.io.IOException; |
| 46 | import java.io.InputStream; |
| 47 | |
| 48 | /** |
| 49 | * Proxying implementation of Context that simply delegates all of its calls to |
| 50 | * another Context. Can be subclassed to modify behavior without changing |
| 51 | * the original Context. |
| 52 | */ |
| 53 | public class ContextWrapper extends Context { |
| 54 | Context mBase; |
| 55 | |
| 56 | public ContextWrapper(Context base) { |
| 57 | mBase = base; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Set the base context for this ContextWrapper. All calls will then be |
| 62 | * delegated to the base context. Throws |
| 63 | * IllegalStateException if a base context has already been set. |
| 64 | * |
| 65 | * @param base The new base context for this wrapper. |
| 66 | */ |
| 67 | protected void attachBaseContext(Context base) { |
| 68 | if (mBase != null) { |
| 69 | throw new IllegalStateException("Base context already set"); |
| 70 | } |
| 71 | mBase = base; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * @return the base context as set by the constructor or setBaseContext |
| 76 | */ |
| 77 | public Context getBaseContext() { |
| 78 | return mBase; |
| 79 | } |
| 80 | |
| 81 | @Override |
| 82 | public AssetManager getAssets() { |
| 83 | return mBase.getAssets(); |
| 84 | } |
| 85 | |
| 86 | @Override |
| 87 | public Resources getResources() |
| 88 | { |
| 89 | return mBase.getResources(); |
| 90 | } |
| 91 | |
| 92 | @Override |
| 93 | public PackageManager getPackageManager() { |
| 94 | return mBase.getPackageManager(); |
| 95 | } |
| 96 | |
| 97 | @Override |
| 98 | public ContentResolver getContentResolver() { |
| 99 | return mBase.getContentResolver(); |
| 100 | } |
| 101 | |
| 102 | @Override |
| 103 | public Looper getMainLooper() { |
| 104 | return mBase.getMainLooper(); |
| 105 | } |
| 106 | |
| 107 | @Override |
| 108 | public Context getApplicationContext() { |
| 109 | return mBase.getApplicationContext(); |
| 110 | } |
| 111 | |
| 112 | @Override |
| 113 | public void setTheme(int resid) { |
| 114 | mBase.setTheme(resid); |
| 115 | } |
| 116 | |
Dianne Hackborn | 247fe74 | 2011-01-08 17:25:57 -0800 | [diff] [blame] | 117 | /** @hide */ |
| 118 | @Override |
| 119 | public int getThemeResId() { |
| 120 | return mBase.getThemeResId(); |
| 121 | } |
| 122 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 123 | @Override |
| 124 | public Resources.Theme getTheme() { |
| 125 | return mBase.getTheme(); |
| 126 | } |
| 127 | |
| 128 | @Override |
| 129 | public ClassLoader getClassLoader() { |
| 130 | return mBase.getClassLoader(); |
| 131 | } |
| 132 | |
| 133 | @Override |
| 134 | public String getPackageName() { |
| 135 | return mBase.getPackageName(); |
| 136 | } |
| 137 | |
Dianne Hackborn | d8e1dbb | 2013-01-17 17:47:37 -0800 | [diff] [blame] | 138 | /** @hide */ |
| 139 | @Override |
| 140 | public String getBasePackageName() { |
| 141 | return mBase.getBasePackageName(); |
| 142 | } |
| 143 | |
Dianne Hackborn | 95d7853 | 2013-09-11 09:51:14 -0700 | [diff] [blame] | 144 | /** @hide */ |
| 145 | @Override |
| 146 | public String getOpPackageName() { |
| 147 | return mBase.getOpPackageName(); |
| 148 | } |
| 149 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 150 | @Override |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 151 | public ApplicationInfo getApplicationInfo() { |
| 152 | return mBase.getApplicationInfo(); |
| 153 | } |
| 154 | |
| 155 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 156 | public String getPackageResourcePath() { |
| 157 | return mBase.getPackageResourcePath(); |
| 158 | } |
| 159 | |
| 160 | @Override |
| 161 | public String getPackageCodePath() { |
| 162 | return mBase.getPackageCodePath(); |
| 163 | } |
| 164 | |
Dianne Hackborn | 7f20543 | 2009-07-28 00:13:47 -0700 | [diff] [blame] | 165 | /** @hide */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 166 | @Override |
Joe Onorato | 23ecae3 | 2009-06-10 17:07:15 -0700 | [diff] [blame] | 167 | public File getSharedPrefsFile(String name) { |
| 168 | return mBase.getSharedPrefsFile(name); |
| 169 | } |
| 170 | |
| 171 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 172 | public SharedPreferences getSharedPreferences(String name, int mode) { |
| 173 | return mBase.getSharedPreferences(name, mode); |
| 174 | } |
| 175 | |
| 176 | @Override |
| 177 | public FileInputStream openFileInput(String name) |
| 178 | throws FileNotFoundException { |
| 179 | return mBase.openFileInput(name); |
| 180 | } |
| 181 | |
| 182 | @Override |
| 183 | public FileOutputStream openFileOutput(String name, int mode) |
| 184 | throws FileNotFoundException { |
| 185 | return mBase.openFileOutput(name, mode); |
| 186 | } |
| 187 | |
| 188 | @Override |
| 189 | public boolean deleteFile(String name) { |
| 190 | return mBase.deleteFile(name); |
| 191 | } |
| 192 | |
| 193 | @Override |
| 194 | public File getFileStreamPath(String name) { |
| 195 | return mBase.getFileStreamPath(name); |
| 196 | } |
| 197 | |
| 198 | @Override |
| 199 | public String[] fileList() { |
| 200 | return mBase.fileList(); |
| 201 | } |
| 202 | |
| 203 | @Override |
| 204 | public File getFilesDir() { |
| 205 | return mBase.getFilesDir(); |
| 206 | } |
| 207 | |
| 208 | @Override |
Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 209 | public File getExternalFilesDir(String type) { |
| 210 | return mBase.getExternalFilesDir(type); |
| 211 | } |
Jeff Sharkey | 1abdb71 | 2013-08-11 16:28:14 -0700 | [diff] [blame] | 212 | |
| 213 | @Override |
| 214 | public File[] getExternalFilesDirs(String type) { |
| 215 | return mBase.getExternalFilesDirs(type); |
| 216 | } |
| 217 | |
Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 218 | @Override |
Dianne Hackborn | 805fd7e | 2011-01-16 18:30:29 -0800 | [diff] [blame] | 219 | public File getObbDir() { |
| 220 | return mBase.getObbDir(); |
| 221 | } |
Jeff Sharkey | 1abdb71 | 2013-08-11 16:28:14 -0700 | [diff] [blame] | 222 | |
| 223 | @Override |
| 224 | public File[] getObbDirs() { |
| 225 | return mBase.getObbDirs(); |
| 226 | } |
| 227 | |
Dianne Hackborn | 805fd7e | 2011-01-16 18:30:29 -0800 | [diff] [blame] | 228 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 229 | public File getCacheDir() { |
| 230 | return mBase.getCacheDir(); |
| 231 | } |
| 232 | |
| 233 | @Override |
Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 234 | public File getExternalCacheDir() { |
| 235 | return mBase.getExternalCacheDir(); |
| 236 | } |
| 237 | |
| 238 | @Override |
Jeff Sharkey | 1abdb71 | 2013-08-11 16:28:14 -0700 | [diff] [blame] | 239 | public File[] getExternalCacheDirs() { |
| 240 | return mBase.getExternalCacheDirs(); |
| 241 | } |
| 242 | |
| 243 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 244 | public File getDir(String name, int mode) { |
| 245 | return mBase.getDir(name, mode); |
| 246 | } |
| 247 | |
| 248 | @Override |
| 249 | public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory) { |
| 250 | return mBase.openOrCreateDatabase(name, mode, factory); |
| 251 | } |
| 252 | |
| 253 | @Override |
Vasu Nori | 74f170f | 2010-06-01 18:06:18 -0700 | [diff] [blame] | 254 | public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory, |
| 255 | DatabaseErrorHandler errorHandler) { |
| 256 | return mBase.openOrCreateDatabase(name, mode, factory, errorHandler); |
| 257 | } |
| 258 | |
| 259 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 260 | public boolean deleteDatabase(String name) { |
| 261 | return mBase.deleteDatabase(name); |
| 262 | } |
| 263 | |
| 264 | @Override |
| 265 | public File getDatabasePath(String name) { |
| 266 | return mBase.getDatabasePath(name); |
| 267 | } |
| 268 | |
| 269 | @Override |
| 270 | public String[] databaseList() { |
| 271 | return mBase.databaseList(); |
| 272 | } |
| 273 | |
| 274 | @Override |
| 275 | public Drawable getWallpaper() { |
| 276 | return mBase.getWallpaper(); |
| 277 | } |
| 278 | |
| 279 | @Override |
| 280 | public Drawable peekWallpaper() { |
| 281 | return mBase.peekWallpaper(); |
| 282 | } |
| 283 | |
| 284 | @Override |
| 285 | public int getWallpaperDesiredMinimumWidth() { |
| 286 | return mBase.getWallpaperDesiredMinimumWidth(); |
| 287 | } |
| 288 | |
| 289 | @Override |
| 290 | public int getWallpaperDesiredMinimumHeight() { |
| 291 | return mBase.getWallpaperDesiredMinimumHeight(); |
| 292 | } |
| 293 | |
| 294 | @Override |
| 295 | public void setWallpaper(Bitmap bitmap) throws IOException { |
| 296 | mBase.setWallpaper(bitmap); |
| 297 | } |
| 298 | |
| 299 | @Override |
| 300 | public void setWallpaper(InputStream data) throws IOException { |
| 301 | mBase.setWallpaper(data); |
| 302 | } |
| 303 | |
| 304 | @Override |
| 305 | public void clearWallpaper() throws IOException { |
| 306 | mBase.clearWallpaper(); |
| 307 | } |
| 308 | |
| 309 | @Override |
| 310 | public void startActivity(Intent intent) { |
| 311 | mBase.startActivity(intent); |
| 312 | } |
| 313 | |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 314 | /** @hide */ |
| 315 | @Override |
Dianne Hackborn | 79af1dd | 2012-08-16 16:42:52 -0700 | [diff] [blame] | 316 | public void startActivityAsUser(Intent intent, UserHandle user) { |
| 317 | mBase.startActivityAsUser(intent, user); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 318 | } |
| 319 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 320 | @Override |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 321 | public void startActivity(Intent intent, Bundle options) { |
| 322 | mBase.startActivity(intent, options); |
| 323 | } |
| 324 | |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 325 | /** @hide */ |
| 326 | @Override |
Dianne Hackborn | 79af1dd | 2012-08-16 16:42:52 -0700 | [diff] [blame] | 327 | public void startActivityAsUser(Intent intent, Bundle options, UserHandle user) { |
| 328 | mBase.startActivityAsUser(intent, options, user); |
Amith Yamasani | 258848d | 2012-08-10 17:06:33 -0700 | [diff] [blame] | 329 | } |
| 330 | |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 331 | @Override |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 332 | public void startActivities(Intent[] intents) { |
| 333 | mBase.startActivities(intents); |
| 334 | } |
| 335 | |
| 336 | @Override |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 337 | public void startActivities(Intent[] intents, Bundle options) { |
| 338 | mBase.startActivities(intents, options); |
| 339 | } |
| 340 | |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 341 | /** @hide */ |
| 342 | @Override |
| 343 | public void startActivitiesAsUser(Intent[] intents, Bundle options, UserHandle userHandle) { |
| 344 | mBase.startActivitiesAsUser(intents, options, userHandle); |
| 345 | } |
| 346 | |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 347 | @Override |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 348 | public void startIntentSender(IntentSender intent, |
| 349 | Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) |
| 350 | throws IntentSender.SendIntentException { |
| 351 | mBase.startIntentSender(intent, fillInIntent, flagsMask, |
| 352 | flagsValues, extraFlags); |
| 353 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 354 | |
| 355 | @Override |
| 356 | public void startIntentSender(IntentSender intent, |
| 357 | Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, |
| 358 | Bundle options) throws IntentSender.SendIntentException { |
| 359 | mBase.startIntentSender(intent, fillInIntent, flagsMask, |
| 360 | flagsValues, extraFlags, options); |
| 361 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 362 | |
| 363 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 364 | public void sendBroadcast(Intent intent) { |
| 365 | mBase.sendBroadcast(intent); |
| 366 | } |
| 367 | |
Amith Yamasani | 67cf7d3 | 2012-02-16 14:31:23 -0800 | [diff] [blame] | 368 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 369 | public void sendBroadcast(Intent intent, String receiverPermission) { |
| 370 | mBase.sendBroadcast(intent, receiverPermission); |
| 371 | } |
| 372 | |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 373 | /** @hide */ |
| 374 | @Override |
| 375 | public void sendBroadcast(Intent intent, String receiverPermission, int appOp) { |
| 376 | mBase.sendBroadcast(intent, receiverPermission, appOp); |
| 377 | } |
| 378 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 379 | @Override |
| 380 | public void sendOrderedBroadcast(Intent intent, |
| 381 | String receiverPermission) { |
| 382 | mBase.sendOrderedBroadcast(intent, receiverPermission); |
| 383 | } |
| 384 | |
| 385 | @Override |
| 386 | public void sendOrderedBroadcast( |
| 387 | Intent intent, String receiverPermission, BroadcastReceiver resultReceiver, |
| 388 | Handler scheduler, int initialCode, String initialData, |
| 389 | Bundle initialExtras) { |
| 390 | mBase.sendOrderedBroadcast(intent, receiverPermission, |
| 391 | resultReceiver, scheduler, initialCode, |
| 392 | initialData, initialExtras); |
| 393 | } |
| 394 | |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 395 | /** @hide */ |
| 396 | @Override |
| 397 | public void sendOrderedBroadcast( |
| 398 | Intent intent, String receiverPermission, int appOp, BroadcastReceiver resultReceiver, |
| 399 | Handler scheduler, int initialCode, String initialData, |
| 400 | Bundle initialExtras) { |
| 401 | mBase.sendOrderedBroadcast(intent, receiverPermission, appOp, |
| 402 | resultReceiver, scheduler, initialCode, |
| 403 | initialData, initialExtras); |
| 404 | } |
| 405 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 406 | @Override |
Dianne Hackborn | 79af1dd | 2012-08-16 16:42:52 -0700 | [diff] [blame] | 407 | public void sendBroadcastAsUser(Intent intent, UserHandle user) { |
| 408 | mBase.sendBroadcastAsUser(intent, user); |
Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 409 | } |
| 410 | |
| 411 | @Override |
Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 412 | public void sendBroadcastAsUser(Intent intent, UserHandle user, |
| 413 | String receiverPermission) { |
| 414 | mBase.sendBroadcastAsUser(intent, user, receiverPermission); |
| 415 | } |
| 416 | |
| 417 | @Override |
Dianne Hackborn | 79af1dd | 2012-08-16 16:42:52 -0700 | [diff] [blame] | 418 | public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, |
Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 419 | String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, |
Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 420 | int initialCode, String initialData, Bundle initialExtras) { |
Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 421 | mBase.sendOrderedBroadcastAsUser(intent, user, receiverPermission, resultReceiver, |
Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 422 | scheduler, initialCode, initialData, initialExtras); |
| 423 | } |
| 424 | |
| 425 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 426 | public void sendStickyBroadcast(Intent intent) { |
| 427 | mBase.sendStickyBroadcast(intent); |
| 428 | } |
| 429 | |
| 430 | @Override |
Dianne Hackborn | efa199f | 2009-09-19 12:03:15 -0700 | [diff] [blame] | 431 | public void sendStickyOrderedBroadcast( |
| 432 | Intent intent, BroadcastReceiver resultReceiver, |
| 433 | Handler scheduler, int initialCode, String initialData, |
| 434 | Bundle initialExtras) { |
| 435 | mBase.sendStickyOrderedBroadcast(intent, |
| 436 | resultReceiver, scheduler, initialCode, |
| 437 | initialData, initialExtras); |
| 438 | } |
| 439 | |
| 440 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 441 | public void removeStickyBroadcast(Intent intent) { |
| 442 | mBase.removeStickyBroadcast(intent); |
| 443 | } |
| 444 | |
| 445 | @Override |
Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 446 | public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) { |
| 447 | mBase.sendStickyBroadcastAsUser(intent, user); |
| 448 | } |
| 449 | |
| 450 | @Override |
| 451 | public void sendStickyOrderedBroadcastAsUser(Intent intent, |
| 452 | UserHandle user, BroadcastReceiver resultReceiver, |
| 453 | Handler scheduler, int initialCode, String initialData, |
| 454 | Bundle initialExtras) { |
| 455 | mBase.sendStickyOrderedBroadcastAsUser(intent, user, resultReceiver, |
| 456 | scheduler, initialCode, initialData, initialExtras); |
| 457 | } |
| 458 | |
| 459 | @Override |
| 460 | public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) { |
| 461 | mBase.removeStickyBroadcastAsUser(intent, user); |
| 462 | } |
| 463 | |
| 464 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 465 | public Intent registerReceiver( |
| 466 | BroadcastReceiver receiver, IntentFilter filter) { |
| 467 | return mBase.registerReceiver(receiver, filter); |
| 468 | } |
| 469 | |
| 470 | @Override |
| 471 | public Intent registerReceiver( |
| 472 | BroadcastReceiver receiver, IntentFilter filter, |
| 473 | String broadcastPermission, Handler scheduler) { |
| 474 | return mBase.registerReceiver(receiver, filter, broadcastPermission, |
| 475 | scheduler); |
| 476 | } |
| 477 | |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 478 | /** @hide */ |
| 479 | @Override |
| 480 | public Intent registerReceiverAsUser( |
| 481 | BroadcastReceiver receiver, UserHandle user, IntentFilter filter, |
| 482 | String broadcastPermission, Handler scheduler) { |
| 483 | return mBase.registerReceiverAsUser(receiver, user, filter, broadcastPermission, |
| 484 | scheduler); |
| 485 | } |
| 486 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 487 | @Override |
| 488 | public void unregisterReceiver(BroadcastReceiver receiver) { |
| 489 | mBase.unregisterReceiver(receiver); |
| 490 | } |
| 491 | |
| 492 | @Override |
| 493 | public ComponentName startService(Intent service) { |
| 494 | return mBase.startService(service); |
| 495 | } |
| 496 | |
| 497 | @Override |
| 498 | public boolean stopService(Intent name) { |
| 499 | return mBase.stopService(name); |
| 500 | } |
| 501 | |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 502 | /** @hide */ |
| 503 | @Override |
| 504 | public ComponentName startServiceAsUser(Intent service, UserHandle user) { |
| 505 | return mBase.startServiceAsUser(service, user); |
| 506 | } |
| 507 | |
| 508 | /** @hide */ |
| 509 | @Override |
| 510 | public boolean stopServiceAsUser(Intent name, UserHandle user) { |
| 511 | return mBase.stopServiceAsUser(name, user); |
| 512 | } |
| 513 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 514 | @Override |
| 515 | public boolean bindService(Intent service, ServiceConnection conn, |
| 516 | int flags) { |
| 517 | return mBase.bindService(service, conn, flags); |
| 518 | } |
| 519 | |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 520 | /** @hide */ |
| 521 | @Override |
Amith Yamasani | 27b89e6 | 2013-01-16 12:30:11 -0800 | [diff] [blame] | 522 | public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags, |
| 523 | UserHandle user) { |
| 524 | return mBase.bindServiceAsUser(service, conn, flags, user); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 525 | } |
| 526 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 527 | @Override |
| 528 | public void unbindService(ServiceConnection conn) { |
| 529 | mBase.unbindService(conn); |
| 530 | } |
| 531 | |
| 532 | @Override |
| 533 | public boolean startInstrumentation(ComponentName className, |
| 534 | String profileFile, Bundle arguments) { |
| 535 | return mBase.startInstrumentation(className, profileFile, arguments); |
| 536 | } |
| 537 | |
| 538 | @Override |
| 539 | public Object getSystemService(String name) { |
| 540 | return mBase.getSystemService(name); |
| 541 | } |
| 542 | |
| 543 | @Override |
| 544 | public int checkPermission(String permission, int pid, int uid) { |
| 545 | return mBase.checkPermission(permission, pid, uid); |
| 546 | } |
| 547 | |
| 548 | @Override |
| 549 | public int checkCallingPermission(String permission) { |
| 550 | return mBase.checkCallingPermission(permission); |
| 551 | } |
| 552 | |
| 553 | @Override |
| 554 | public int checkCallingOrSelfPermission(String permission) { |
| 555 | return mBase.checkCallingOrSelfPermission(permission); |
| 556 | } |
| 557 | |
| 558 | @Override |
| 559 | public void enforcePermission( |
| 560 | String permission, int pid, int uid, String message) { |
| 561 | mBase.enforcePermission(permission, pid, uid, message); |
| 562 | } |
| 563 | |
| 564 | @Override |
| 565 | public void enforceCallingPermission(String permission, String message) { |
| 566 | mBase.enforceCallingPermission(permission, message); |
| 567 | } |
| 568 | |
| 569 | @Override |
| 570 | public void enforceCallingOrSelfPermission( |
| 571 | String permission, String message) { |
| 572 | mBase.enforceCallingOrSelfPermission(permission, message); |
| 573 | } |
| 574 | |
| 575 | @Override |
| 576 | public void grantUriPermission(String toPackage, Uri uri, int modeFlags) { |
| 577 | mBase.grantUriPermission(toPackage, uri, modeFlags); |
| 578 | } |
| 579 | |
| 580 | @Override |
| 581 | public void revokeUriPermission(Uri uri, int modeFlags) { |
| 582 | mBase.revokeUriPermission(uri, modeFlags); |
| 583 | } |
| 584 | |
| 585 | @Override |
| 586 | public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) { |
| 587 | return mBase.checkUriPermission(uri, pid, uid, modeFlags); |
| 588 | } |
| 589 | |
| 590 | @Override |
| 591 | public int checkCallingUriPermission(Uri uri, int modeFlags) { |
| 592 | return mBase.checkCallingUriPermission(uri, modeFlags); |
| 593 | } |
| 594 | |
| 595 | @Override |
| 596 | public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) { |
| 597 | return mBase.checkCallingOrSelfUriPermission(uri, modeFlags); |
| 598 | } |
| 599 | |
| 600 | @Override |
| 601 | public int checkUriPermission(Uri uri, String readPermission, |
| 602 | String writePermission, int pid, int uid, int modeFlags) { |
| 603 | return mBase.checkUriPermission(uri, readPermission, writePermission, |
| 604 | pid, uid, modeFlags); |
| 605 | } |
| 606 | |
| 607 | @Override |
| 608 | public void enforceUriPermission( |
| 609 | Uri uri, int pid, int uid, int modeFlags, String message) { |
| 610 | mBase.enforceUriPermission(uri, pid, uid, modeFlags, message); |
| 611 | } |
| 612 | |
| 613 | @Override |
| 614 | public void enforceCallingUriPermission( |
| 615 | Uri uri, int modeFlags, String message) { |
| 616 | mBase.enforceCallingUriPermission(uri, modeFlags, message); |
| 617 | } |
| 618 | |
| 619 | @Override |
| 620 | public void enforceCallingOrSelfUriPermission( |
| 621 | Uri uri, int modeFlags, String message) { |
| 622 | mBase.enforceCallingOrSelfUriPermission(uri, modeFlags, message); |
| 623 | } |
| 624 | |
| 625 | @Override |
| 626 | public void enforceUriPermission( |
| 627 | Uri uri, String readPermission, String writePermission, |
| 628 | int pid, int uid, int modeFlags, String message) { |
| 629 | mBase.enforceUriPermission( |
| 630 | uri, readPermission, writePermission, pid, uid, modeFlags, |
| 631 | message); |
| 632 | } |
| 633 | |
| 634 | @Override |
| 635 | public Context createPackageContext(String packageName, int flags) |
| 636 | throws PackageManager.NameNotFoundException { |
| 637 | return mBase.createPackageContext(packageName, flags); |
| 638 | } |
Romain Guy | 870e09f | 2009-07-06 16:35:25 -0700 | [diff] [blame] | 639 | |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 640 | /** @hide */ |
| 641 | @Override |
| 642 | public Context createPackageContextAsUser(String packageName, int flags, UserHandle user) |
| 643 | throws PackageManager.NameNotFoundException { |
| 644 | return mBase.createPackageContextAsUser(packageName, flags, user); |
| 645 | } |
| 646 | |
Jim Miller | a75a883 | 2013-02-07 16:53:32 -0800 | [diff] [blame] | 647 | /** @hide */ |
| 648 | @Override |
| 649 | public int getUserId() { |
| 650 | return mBase.getUserId(); |
| 651 | } |
| 652 | |
Romain Guy | 870e09f | 2009-07-06 16:35:25 -0700 | [diff] [blame] | 653 | @Override |
Dianne Hackborn | 756220b | 2012-08-14 16:45:30 -0700 | [diff] [blame] | 654 | public Context createConfigurationContext(Configuration overrideConfiguration) { |
| 655 | return mBase.createConfigurationContext(overrideConfiguration); |
| 656 | } |
| 657 | |
| 658 | @Override |
Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 659 | public Context createDisplayContext(Display display) { |
| 660 | return mBase.createDisplayContext(display); |
| 661 | } |
| 662 | |
| 663 | @Override |
Romain Guy | 870e09f | 2009-07-06 16:35:25 -0700 | [diff] [blame] | 664 | public boolean isRestricted() { |
| 665 | return mBase.isRestricted(); |
| 666 | } |
Jeff Brown | 98365d7 | 2012-08-19 20:30:52 -0700 | [diff] [blame] | 667 | |
| 668 | /** @hide */ |
| 669 | @Override |
Craig Mautner | 48d0d18 | 2013-06-11 07:53:06 -0700 | [diff] [blame] | 670 | public DisplayAdjustments getDisplayAdjustments(int displayId) { |
| 671 | return mBase.getDisplayAdjustments(displayId); |
Jeff Brown | 98365d7 | 2012-08-19 20:30:52 -0700 | [diff] [blame] | 672 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 673 | } |