Home | History | Annotate | Download | only in content
      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 
     19 import android.annotation.SystemApi;
     20 import android.content.pm.ApplicationInfo;
     21 import android.content.pm.PackageManager;
     22 import android.content.res.AssetManager;
     23 import android.content.res.Configuration;
     24 import android.content.res.Resources;
     25 import android.database.DatabaseErrorHandler;
     26 import android.database.sqlite.SQLiteDatabase;
     27 import android.database.sqlite.SQLiteDatabase.CursorFactory;
     28 import android.graphics.Bitmap;
     29 import android.graphics.drawable.Drawable;
     30 import android.net.Uri;
     31 import android.os.Bundle;
     32 import android.os.Handler;
     33 import android.os.IBinder;
     34 import android.os.Looper;
     35 import android.os.UserHandle;
     36 import android.view.Display;
     37 import android.view.DisplayAdjustments;
     38 
     39 import java.io.File;
     40 import java.io.FileInputStream;
     41 import java.io.FileNotFoundException;
     42 import java.io.FileOutputStream;
     43 import java.io.IOException;
     44 import java.io.InputStream;
     45 
     46 /**
     47  * Proxying implementation of Context that simply delegates all of its calls to
     48  * another Context.  Can be subclassed to modify behavior without changing
     49  * the original Context.
     50  */
     51 public class ContextWrapper extends Context {
     52     Context mBase;
     53 
     54     public ContextWrapper(Context base) {
     55         mBase = base;
     56     }
     57 
     58     /**
     59      * Set the base context for this ContextWrapper.  All calls will then be
     60      * delegated to the base context.  Throws
     61      * IllegalStateException if a base context has already been set.
     62      *
     63      * @param base The new base context for this wrapper.
     64      */
     65     protected void attachBaseContext(Context base) {
     66         if (mBase != null) {
     67             throw new IllegalStateException("Base context already set");
     68         }
     69         mBase = base;
     70     }
     71 
     72     /**
     73      * @return the base context as set by the constructor or setBaseContext
     74      */
     75     public Context getBaseContext() {
     76         return mBase;
     77     }
     78 
     79     @Override
     80     public AssetManager getAssets() {
     81         return mBase.getAssets();
     82     }
     83 
     84     @Override
     85     public Resources getResources() {
     86         return mBase.getResources();
     87     }
     88 
     89     @Override
     90     public PackageManager getPackageManager() {
     91         return mBase.getPackageManager();
     92     }
     93 
     94     @Override
     95     public ContentResolver getContentResolver() {
     96         return mBase.getContentResolver();
     97     }
     98 
     99     @Override
    100     public Looper getMainLooper() {
    101         return mBase.getMainLooper();
    102     }
    103 
    104     @Override
    105     public Context getApplicationContext() {
    106         return mBase.getApplicationContext();
    107     }
    108 
    109     @Override
    110     public void setTheme(int resid) {
    111         mBase.setTheme(resid);
    112     }
    113 
    114     /** @hide */
    115     @Override
    116     public int getThemeResId() {
    117         return mBase.getThemeResId();
    118     }
    119 
    120     @Override
    121     public Resources.Theme getTheme() {
    122         return mBase.getTheme();
    123     }
    124 
    125     @Override
    126     public ClassLoader getClassLoader() {
    127         return mBase.getClassLoader();
    128     }
    129 
    130     @Override
    131     public String getPackageName() {
    132         return mBase.getPackageName();
    133     }
    134 
    135     /** @hide */
    136     @Override
    137     public String getBasePackageName() {
    138         return mBase.getBasePackageName();
    139     }
    140 
    141     /** @hide */
    142     @Override
    143     public String getOpPackageName() {
    144         return mBase.getOpPackageName();
    145     }
    146 
    147     @Override
    148     public ApplicationInfo getApplicationInfo() {
    149         return mBase.getApplicationInfo();
    150     }
    151 
    152     @Override
    153     public String getPackageResourcePath() {
    154         return mBase.getPackageResourcePath();
    155     }
    156 
    157     @Override
    158     public String getPackageCodePath() {
    159         return mBase.getPackageCodePath();
    160     }
    161 
    162     @Override
    163     public SharedPreferences getSharedPreferences(String name, int mode) {
    164         return mBase.getSharedPreferences(name, mode);
    165     }
    166 
    167     /** @removed */
    168     @Override
    169     public SharedPreferences getSharedPreferences(File file, int mode) {
    170         return mBase.getSharedPreferences(file, mode);
    171     }
    172 
    173     @Override
    174     public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
    175         return mBase.moveSharedPreferencesFrom(sourceContext, name);
    176     }
    177 
    178     @Override
    179     public boolean deleteSharedPreferences(String name) {
    180         return mBase.deleteSharedPreferences(name);
    181     }
    182 
    183     @Override
    184     public FileInputStream openFileInput(String name)
    185         throws FileNotFoundException {
    186         return mBase.openFileInput(name);
    187     }
    188 
    189     @Override
    190     public FileOutputStream openFileOutput(String name, int mode)
    191         throws FileNotFoundException {
    192         return mBase.openFileOutput(name, mode);
    193     }
    194 
    195     @Override
    196     public boolean deleteFile(String name) {
    197         return mBase.deleteFile(name);
    198     }
    199 
    200     @Override
    201     public File getFileStreamPath(String name) {
    202         return mBase.getFileStreamPath(name);
    203     }
    204 
    205     /** @removed */
    206     @Override
    207     public File getSharedPreferencesPath(String name) {
    208         return mBase.getSharedPreferencesPath(name);
    209     }
    210 
    211     @Override
    212     public String[] fileList() {
    213         return mBase.fileList();
    214     }
    215 
    216     @Override
    217     public File getDataDir() {
    218         return mBase.getDataDir();
    219     }
    220 
    221     @Override
    222     public File getFilesDir() {
    223         return mBase.getFilesDir();
    224     }
    225 
    226     @Override
    227     public File getNoBackupFilesDir() {
    228         return mBase.getNoBackupFilesDir();
    229     }
    230 
    231     @Override
    232     public File getExternalFilesDir(String type) {
    233         return mBase.getExternalFilesDir(type);
    234     }
    235 
    236     @Override
    237     public File[] getExternalFilesDirs(String type) {
    238         return mBase.getExternalFilesDirs(type);
    239     }
    240 
    241     @Override
    242     public File getObbDir() {
    243         return mBase.getObbDir();
    244     }
    245 
    246     @Override
    247     public File[] getObbDirs() {
    248         return mBase.getObbDirs();
    249     }
    250 
    251     @Override
    252     public File getCacheDir() {
    253         return mBase.getCacheDir();
    254     }
    255 
    256     @Override
    257     public File getCodeCacheDir() {
    258         return mBase.getCodeCacheDir();
    259     }
    260 
    261     @Override
    262     public File getExternalCacheDir() {
    263         return mBase.getExternalCacheDir();
    264     }
    265 
    266     @Override
    267     public File[] getExternalCacheDirs() {
    268         return mBase.getExternalCacheDirs();
    269     }
    270 
    271     @Override
    272     public File[] getExternalMediaDirs() {
    273         return mBase.getExternalMediaDirs();
    274     }
    275 
    276     @Override
    277     public File getDir(String name, int mode) {
    278         return mBase.getDir(name, mode);
    279     }
    280 
    281     @Override
    282     public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory) {
    283         return mBase.openOrCreateDatabase(name, mode, factory);
    284     }
    285 
    286     @Override
    287     public SQLiteDatabase openOrCreateDatabase(String name, int mode, CursorFactory factory,
    288             DatabaseErrorHandler errorHandler) {
    289         return mBase.openOrCreateDatabase(name, mode, factory, errorHandler);
    290     }
    291 
    292     @Override
    293     public boolean moveDatabaseFrom(Context sourceContext, String name) {
    294         return mBase.moveDatabaseFrom(sourceContext, name);
    295     }
    296 
    297     @Override
    298     public boolean deleteDatabase(String name) {
    299         return mBase.deleteDatabase(name);
    300     }
    301 
    302     @Override
    303     public File getDatabasePath(String name) {
    304         return mBase.getDatabasePath(name);
    305     }
    306 
    307     @Override
    308     public String[] databaseList() {
    309         return mBase.databaseList();
    310     }
    311 
    312     @Override
    313     @Deprecated
    314     public Drawable getWallpaper() {
    315         return mBase.getWallpaper();
    316     }
    317 
    318     @Override
    319     @Deprecated
    320     public Drawable peekWallpaper() {
    321         return mBase.peekWallpaper();
    322     }
    323 
    324     @Override
    325     @Deprecated
    326     public int getWallpaperDesiredMinimumWidth() {
    327         return mBase.getWallpaperDesiredMinimumWidth();
    328     }
    329 
    330     @Override
    331     @Deprecated
    332     public int getWallpaperDesiredMinimumHeight() {
    333         return mBase.getWallpaperDesiredMinimumHeight();
    334     }
    335 
    336     @Override
    337     @Deprecated
    338     public void setWallpaper(Bitmap bitmap) throws IOException {
    339         mBase.setWallpaper(bitmap);
    340     }
    341 
    342     @Override
    343     @Deprecated
    344     public void setWallpaper(InputStream data) throws IOException {
    345         mBase.setWallpaper(data);
    346     }
    347 
    348     @Override
    349     @Deprecated
    350     public void clearWallpaper() throws IOException {
    351         mBase.clearWallpaper();
    352     }
    353 
    354     @Override
    355     public void startActivity(Intent intent) {
    356         mBase.startActivity(intent);
    357     }
    358 
    359     /** @hide */
    360     @Override
    361     public void startActivityAsUser(Intent intent, UserHandle user) {
    362         mBase.startActivityAsUser(intent, user);
    363     }
    364 
    365     /** @hide **/
    366     public void startActivityForResult(
    367             String who, Intent intent, int requestCode, Bundle options) {
    368         mBase.startActivityForResult(who, intent, requestCode, options);
    369     }
    370 
    371     /** @hide **/
    372     public boolean canStartActivityForResult() {
    373         return mBase.canStartActivityForResult();
    374     }
    375 
    376     @Override
    377     public void startActivity(Intent intent, Bundle options) {
    378         mBase.startActivity(intent, options);
    379     }
    380 
    381     /** @hide */
    382     @Override
    383     public void startActivityAsUser(Intent intent, Bundle options, UserHandle user) {
    384         mBase.startActivityAsUser(intent, options, user);
    385     }
    386 
    387     @Override
    388     public void startActivities(Intent[] intents) {
    389         mBase.startActivities(intents);
    390     }
    391 
    392     @Override
    393     public void startActivities(Intent[] intents, Bundle options) {
    394         mBase.startActivities(intents, options);
    395     }
    396 
    397     /** @hide */
    398     @Override
    399     public void startActivitiesAsUser(Intent[] intents, Bundle options, UserHandle userHandle) {
    400         mBase.startActivitiesAsUser(intents, options, userHandle);
    401     }
    402 
    403     @Override
    404     public void startIntentSender(IntentSender intent,
    405             Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
    406             throws IntentSender.SendIntentException {
    407         mBase.startIntentSender(intent, fillInIntent, flagsMask,
    408                 flagsValues, extraFlags);
    409     }
    410 
    411     @Override
    412     public void startIntentSender(IntentSender intent,
    413             Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags,
    414             Bundle options) throws IntentSender.SendIntentException {
    415         mBase.startIntentSender(intent, fillInIntent, flagsMask,
    416                 flagsValues, extraFlags, options);
    417     }
    418 
    419     @Override
    420     public void sendBroadcast(Intent intent) {
    421         mBase.sendBroadcast(intent);
    422     }
    423 
    424     @Override
    425     public void sendBroadcast(Intent intent, String receiverPermission) {
    426         mBase.sendBroadcast(intent, receiverPermission);
    427     }
    428 
    429     /** @hide */
    430     @Override
    431     public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) {
    432         mBase.sendBroadcastMultiplePermissions(intent, receiverPermissions);
    433     }
    434 
    435     /** @hide */
    436     @SystemApi
    437     @Override
    438     public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) {
    439         mBase.sendBroadcast(intent, receiverPermission, options);
    440     }
    441 
    442     /** @hide */
    443     @Override
    444     public void sendBroadcast(Intent intent, String receiverPermission, int appOp) {
    445         mBase.sendBroadcast(intent, receiverPermission, appOp);
    446     }
    447 
    448     @Override
    449     public void sendOrderedBroadcast(Intent intent,
    450             String receiverPermission) {
    451         mBase.sendOrderedBroadcast(intent, receiverPermission);
    452     }
    453 
    454     @Override
    455     public void sendOrderedBroadcast(
    456         Intent intent, String receiverPermission, BroadcastReceiver resultReceiver,
    457         Handler scheduler, int initialCode, String initialData,
    458         Bundle initialExtras) {
    459         mBase.sendOrderedBroadcast(intent, receiverPermission,
    460                 resultReceiver, scheduler, initialCode,
    461                 initialData, initialExtras);
    462     }
    463 
    464     /** @hide */
    465     @SystemApi
    466     @Override
    467     public void sendOrderedBroadcast(
    468             Intent intent, String receiverPermission, Bundle options, BroadcastReceiver resultReceiver,
    469             Handler scheduler, int initialCode, String initialData,
    470             Bundle initialExtras) {
    471         mBase.sendOrderedBroadcast(intent, receiverPermission,
    472                 options, resultReceiver, scheduler, initialCode,
    473                 initialData, initialExtras);
    474     }
    475 
    476     /** @hide */
    477     @Override
    478     public void sendOrderedBroadcast(
    479         Intent intent, String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
    480         Handler scheduler, int initialCode, String initialData,
    481         Bundle initialExtras) {
    482         mBase.sendOrderedBroadcast(intent, receiverPermission, appOp,
    483                 resultReceiver, scheduler, initialCode,
    484                 initialData, initialExtras);
    485     }
    486 
    487     @Override
    488     public void sendBroadcastAsUser(Intent intent, UserHandle user) {
    489         mBase.sendBroadcastAsUser(intent, user);
    490     }
    491 
    492     @Override
    493     public void sendBroadcastAsUser(Intent intent, UserHandle user,
    494             String receiverPermission) {
    495         mBase.sendBroadcastAsUser(intent, user, receiverPermission);
    496     }
    497 
    498     /** @hide */
    499     @Override
    500     public void sendBroadcastAsUser(Intent intent, UserHandle user,
    501             String receiverPermission, int appOp) {
    502         mBase.sendBroadcastAsUser(intent, user, receiverPermission, appOp);
    503     }
    504 
    505     @Override
    506     public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
    507             String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
    508             int initialCode, String initialData, Bundle initialExtras) {
    509         mBase.sendOrderedBroadcastAsUser(intent, user, receiverPermission, resultReceiver,
    510                 scheduler, initialCode, initialData, initialExtras);
    511     }
    512 
    513     /** @hide */
    514     @Override
    515     public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
    516             String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
    517             Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
    518         mBase.sendOrderedBroadcastAsUser(intent, user, receiverPermission, appOp, resultReceiver,
    519                 scheduler, initialCode, initialData, initialExtras);
    520     }
    521 
    522     /** @hide */
    523     @Override
    524     public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
    525             String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
    526             Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
    527         mBase.sendOrderedBroadcastAsUser(intent, user, receiverPermission, appOp, options,
    528                 resultReceiver, scheduler, initialCode, initialData, initialExtras);
    529     }
    530 
    531     @Override
    532     @Deprecated
    533     public void sendStickyBroadcast(Intent intent) {
    534         mBase.sendStickyBroadcast(intent);
    535     }
    536 
    537     @Override
    538     @Deprecated
    539     public void sendStickyOrderedBroadcast(
    540         Intent intent, BroadcastReceiver resultReceiver,
    541         Handler scheduler, int initialCode, String initialData,
    542         Bundle initialExtras) {
    543         mBase.sendStickyOrderedBroadcast(intent,
    544                 resultReceiver, scheduler, initialCode,
    545                 initialData, initialExtras);
    546     }
    547 
    548     @Override
    549     @Deprecated
    550     public void removeStickyBroadcast(Intent intent) {
    551         mBase.removeStickyBroadcast(intent);
    552     }
    553 
    554     @Override
    555     @Deprecated
    556     public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
    557         mBase.sendStickyBroadcastAsUser(intent, user);
    558     }
    559 
    560     /** @hide */
    561     @Override
    562     @Deprecated
    563     public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
    564         mBase.sendStickyBroadcastAsUser(intent, user, options);
    565     }
    566 
    567     @Override
    568     @Deprecated
    569     public void sendStickyOrderedBroadcastAsUser(Intent intent,
    570             UserHandle user, BroadcastReceiver resultReceiver,
    571             Handler scheduler, int initialCode, String initialData,
    572             Bundle initialExtras) {
    573         mBase.sendStickyOrderedBroadcastAsUser(intent, user, resultReceiver,
    574                 scheduler, initialCode, initialData, initialExtras);
    575     }
    576 
    577     @Override
    578     @Deprecated
    579     public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
    580         mBase.removeStickyBroadcastAsUser(intent, user);
    581     }
    582 
    583     @Override
    584     public Intent registerReceiver(
    585         BroadcastReceiver receiver, IntentFilter filter) {
    586         return mBase.registerReceiver(receiver, filter);
    587     }
    588 
    589     @Override
    590     public Intent registerReceiver(
    591         BroadcastReceiver receiver, IntentFilter filter,
    592         String broadcastPermission, Handler scheduler) {
    593         return mBase.registerReceiver(receiver, filter, broadcastPermission,
    594                 scheduler);
    595     }
    596 
    597     /** @hide */
    598     @Override
    599     public Intent registerReceiverAsUser(
    600         BroadcastReceiver receiver, UserHandle user, IntentFilter filter,
    601         String broadcastPermission, Handler scheduler) {
    602         return mBase.registerReceiverAsUser(receiver, user, filter, broadcastPermission,
    603                 scheduler);
    604     }
    605 
    606     @Override
    607     public void unregisterReceiver(BroadcastReceiver receiver) {
    608         mBase.unregisterReceiver(receiver);
    609     }
    610 
    611     @Override
    612     public ComponentName startService(Intent service) {
    613         return mBase.startService(service);
    614     }
    615 
    616     @Override
    617     public boolean stopService(Intent name) {
    618         return mBase.stopService(name);
    619     }
    620 
    621     /** @hide */
    622     @Override
    623     public ComponentName startServiceAsUser(Intent service, UserHandle user) {
    624         return mBase.startServiceAsUser(service, user);
    625     }
    626 
    627     /** @hide */
    628     @Override
    629     public boolean stopServiceAsUser(Intent name, UserHandle user) {
    630         return mBase.stopServiceAsUser(name, user);
    631     }
    632 
    633     @Override
    634     public boolean bindService(Intent service, ServiceConnection conn,
    635             int flags) {
    636         return mBase.bindService(service, conn, flags);
    637     }
    638 
    639     /** @hide */
    640     @Override
    641     public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
    642             UserHandle user) {
    643         return mBase.bindServiceAsUser(service, conn, flags, user);
    644     }
    645 
    646     @Override
    647     public void unbindService(ServiceConnection conn) {
    648         mBase.unbindService(conn);
    649     }
    650 
    651     @Override
    652     public boolean startInstrumentation(ComponentName className,
    653             String profileFile, Bundle arguments) {
    654         return mBase.startInstrumentation(className, profileFile, arguments);
    655     }
    656 
    657     @Override
    658     public Object getSystemService(String name) {
    659         return mBase.getSystemService(name);
    660     }
    661 
    662     @Override
    663     public String getSystemServiceName(Class<?> serviceClass) {
    664         return mBase.getSystemServiceName(serviceClass);
    665     }
    666 
    667     @Override
    668     public int checkPermission(String permission, int pid, int uid) {
    669         return mBase.checkPermission(permission, pid, uid);
    670     }
    671 
    672     /** @hide */
    673     @Override
    674     public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
    675         return mBase.checkPermission(permission, pid, uid, callerToken);
    676     }
    677 
    678     @Override
    679     public int checkCallingPermission(String permission) {
    680         return mBase.checkCallingPermission(permission);
    681     }
    682 
    683     @Override
    684     public int checkCallingOrSelfPermission(String permission) {
    685         return mBase.checkCallingOrSelfPermission(permission);
    686     }
    687 
    688     @Override
    689     public int checkSelfPermission(String permission) {
    690        return mBase.checkSelfPermission(permission);
    691     }
    692 
    693     @Override
    694     public void enforcePermission(
    695             String permission, int pid, int uid, String message) {
    696         mBase.enforcePermission(permission, pid, uid, message);
    697     }
    698 
    699     @Override
    700     public void enforceCallingPermission(String permission, String message) {
    701         mBase.enforceCallingPermission(permission, message);
    702     }
    703 
    704     @Override
    705     public void enforceCallingOrSelfPermission(
    706             String permission, String message) {
    707         mBase.enforceCallingOrSelfPermission(permission, message);
    708     }
    709 
    710     @Override
    711     public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
    712         mBase.grantUriPermission(toPackage, uri, modeFlags);
    713     }
    714 
    715     @Override
    716     public void revokeUriPermission(Uri uri, int modeFlags) {
    717         mBase.revokeUriPermission(uri, modeFlags);
    718     }
    719 
    720     @Override
    721     public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
    722         return mBase.checkUriPermission(uri, pid, uid, modeFlags);
    723     }
    724 
    725     /** @hide */
    726     @Override
    727     public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
    728         return mBase.checkUriPermission(uri, pid, uid, modeFlags, callerToken);
    729     }
    730 
    731     @Override
    732     public int checkCallingUriPermission(Uri uri, int modeFlags) {
    733         return mBase.checkCallingUriPermission(uri, modeFlags);
    734     }
    735 
    736     @Override
    737     public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
    738         return mBase.checkCallingOrSelfUriPermission(uri, modeFlags);
    739     }
    740 
    741     @Override
    742     public int checkUriPermission(Uri uri, String readPermission,
    743             String writePermission, int pid, int uid, int modeFlags) {
    744         return mBase.checkUriPermission(uri, readPermission, writePermission,
    745                 pid, uid, modeFlags);
    746     }
    747 
    748     @Override
    749     public void enforceUriPermission(
    750             Uri uri, int pid, int uid, int modeFlags, String message) {
    751         mBase.enforceUriPermission(uri, pid, uid, modeFlags, message);
    752     }
    753 
    754     @Override
    755     public void enforceCallingUriPermission(
    756             Uri uri, int modeFlags, String message) {
    757         mBase.enforceCallingUriPermission(uri, modeFlags, message);
    758     }
    759 
    760     @Override
    761     public void enforceCallingOrSelfUriPermission(
    762             Uri uri, int modeFlags, String message) {
    763         mBase.enforceCallingOrSelfUriPermission(uri, modeFlags, message);
    764     }
    765 
    766     @Override
    767     public void enforceUriPermission(
    768             Uri uri, String readPermission, String writePermission,
    769             int pid, int uid, int modeFlags, String message) {
    770         mBase.enforceUriPermission(
    771                 uri, readPermission, writePermission, pid, uid, modeFlags,
    772                 message);
    773     }
    774 
    775     @Override
    776     public Context createPackageContext(String packageName, int flags)
    777         throws PackageManager.NameNotFoundException {
    778         return mBase.createPackageContext(packageName, flags);
    779     }
    780 
    781     /** @hide */
    782     @Override
    783     public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
    784             throws PackageManager.NameNotFoundException {
    785         return mBase.createPackageContextAsUser(packageName, flags, user);
    786     }
    787 
    788     /** @hide */
    789     @Override
    790     public Context createApplicationContext(ApplicationInfo application,
    791             int flags) throws PackageManager.NameNotFoundException {
    792         return mBase.createApplicationContext(application, flags);
    793     }
    794 
    795     /** @hide */
    796     @Override
    797     public int getUserId() {
    798         return mBase.getUserId();
    799     }
    800 
    801     @Override
    802     public Context createConfigurationContext(Configuration overrideConfiguration) {
    803         return mBase.createConfigurationContext(overrideConfiguration);
    804     }
    805 
    806     @Override
    807     public Context createDisplayContext(Display display) {
    808         return mBase.createDisplayContext(display);
    809     }
    810 
    811     @Override
    812     public boolean isRestricted() {
    813         return mBase.isRestricted();
    814     }
    815 
    816     /** @hide */
    817     @Override
    818     public DisplayAdjustments getDisplayAdjustments(int displayId) {
    819         return mBase.getDisplayAdjustments(displayId);
    820     }
    821 
    822     /**
    823      * @hide
    824      */
    825     @Override
    826     public Display getDisplay() {
    827         return mBase.getDisplay();
    828     }
    829 
    830     @Override
    831     public Context createDeviceProtectedStorageContext() {
    832         return mBase.createDeviceProtectedStorageContext();
    833     }
    834 
    835     /** {@hide} */
    836     @SystemApi
    837     @Override
    838     public Context createCredentialProtectedStorageContext() {
    839         return mBase.createCredentialProtectedStorageContext();
    840     }
    841 
    842     @Override
    843     public boolean isDeviceProtectedStorage() {
    844         return mBase.isDeviceProtectedStorage();
    845     }
    846 
    847     /** {@hide} */
    848     @SystemApi
    849     @Override
    850     public boolean isCredentialProtectedStorage() {
    851         return mBase.isCredentialProtectedStorage();
    852     }
    853 }
    854