| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 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.test.mock; |
| 18 | |
| Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 19 | import android.annotation.SystemApi; |
| Tony Mak | 46aabe5 | 2016-11-14 12:53:06 +0000 | [diff] [blame] | 20 | import android.app.IApplicationThread; |
| 21 | import android.app.IServiceConnection; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.ComponentName; |
| 23 | import android.content.ContentResolver; |
| 24 | import android.content.Context; |
| 25 | import android.content.Intent; |
| 26 | import android.content.IntentFilter; |
| 27 | import android.content.BroadcastReceiver; |
| Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 28 | import android.content.IntentSender; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | import android.content.ServiceConnection; |
| 30 | import android.content.SharedPreferences; |
| Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 31 | import android.content.pm.ApplicationInfo; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | import android.content.pm.PackageManager; |
| 33 | import android.content.res.AssetManager; |
| Dianne Hackborn | 756220b | 2012-08-14 16:45:30 -0700 | [diff] [blame] | 34 | import android.content.res.Configuration; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 35 | import android.content.res.Resources; |
| Vasu Nori | 74f170f | 2010-06-01 18:06:18 -0700 | [diff] [blame] | 36 | import android.database.DatabaseErrorHandler; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | import android.database.sqlite.SQLiteDatabase; |
| 38 | import android.graphics.Bitmap; |
| 39 | import android.graphics.drawable.Drawable; |
| 40 | import android.net.Uri; |
| 41 | import android.os.Bundle; |
| 42 | import android.os.Handler; |
| Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 43 | import android.os.IBinder; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | import android.os.Looper; |
| Dianne Hackborn | 79af1dd | 2012-08-16 16:42:52 -0700 | [diff] [blame] | 45 | import android.os.UserHandle; |
| Craig Mautner | 48d0d18 | 2013-06-11 07:53:06 -0700 | [diff] [blame] | 46 | import android.view.DisplayAdjustments; |
| Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 47 | import android.view.Display; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | |
| 49 | import java.io.File; |
| 50 | import java.io.FileInputStream; |
| 51 | import java.io.FileNotFoundException; |
| 52 | import java.io.FileOutputStream; |
| 53 | import java.io.IOException; |
| 54 | import java.io.InputStream; |
| 55 | |
| 56 | /** |
| Stephan Linzner | b51617f | 2016-01-27 18:09:50 -0800 | [diff] [blame] | 57 | * A mock {@link android.content.Context} class. All methods are non-functional and throw |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | * {@link java.lang.UnsupportedOperationException}. You can use this to inject other dependencies, |
| 59 | * mocks, or monitors into the classes you are testing. |
| 60 | */ |
| 61 | public class MockContext extends Context { |
| 62 | |
| 63 | @Override |
| 64 | public AssetManager getAssets() { |
| 65 | throw new UnsupportedOperationException(); |
| 66 | } |
| 67 | |
| 68 | @Override |
| 69 | public Resources getResources() { |
| 70 | throw new UnsupportedOperationException(); |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | public PackageManager getPackageManager() { |
| 75 | throw new UnsupportedOperationException(); |
| 76 | } |
| 77 | |
| 78 | @Override |
| 79 | public ContentResolver getContentResolver() { |
| 80 | throw new UnsupportedOperationException(); |
| 81 | } |
| 82 | |
| 83 | @Override |
| 84 | public Looper getMainLooper() { |
| 85 | throw new UnsupportedOperationException(); |
| 86 | } |
| Stephan Linzner | b51617f | 2016-01-27 18:09:50 -0800 | [diff] [blame] | 87 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 88 | @Override |
| 89 | public Context getApplicationContext() { |
| 90 | throw new UnsupportedOperationException(); |
| 91 | } |
| Stephan Linzner | b51617f | 2016-01-27 18:09:50 -0800 | [diff] [blame] | 92 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 93 | @Override |
| 94 | public void setTheme(int resid) { |
| 95 | throw new UnsupportedOperationException(); |
| 96 | } |
| 97 | |
| 98 | @Override |
| 99 | public Resources.Theme getTheme() { |
| 100 | throw new UnsupportedOperationException(); |
| 101 | } |
| 102 | |
| 103 | @Override |
| 104 | public ClassLoader getClassLoader() { |
| 105 | throw new UnsupportedOperationException(); |
| 106 | } |
| 107 | |
| 108 | @Override |
| 109 | public String getPackageName() { |
| 110 | throw new UnsupportedOperationException(); |
| 111 | } |
| 112 | |
| Dianne Hackborn | d8e1dbb | 2013-01-17 17:47:37 -0800 | [diff] [blame] | 113 | /** @hide */ |
| 114 | @Override |
| 115 | public String getBasePackageName() { |
| 116 | throw new UnsupportedOperationException(); |
| 117 | } |
| 118 | |
| Dianne Hackborn | 95d7853 | 2013-09-11 09:51:14 -0700 | [diff] [blame] | 119 | /** @hide */ |
| 120 | @Override |
| 121 | public String getOpPackageName() { |
| 122 | throw new UnsupportedOperationException(); |
| 123 | } |
| 124 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 125 | @Override |
| Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 126 | public ApplicationInfo getApplicationInfo() { |
| 127 | throw new UnsupportedOperationException(); |
| 128 | } |
| Stephan Linzner | b51617f | 2016-01-27 18:09:50 -0800 | [diff] [blame] | 129 | |
| Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 130 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 131 | public String getPackageResourcePath() { |
| 132 | throw new UnsupportedOperationException(); |
| 133 | } |
| 134 | |
| Joe Onorato | 23ecae3 | 2009-06-10 17:07:15 -0700 | [diff] [blame] | 135 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 136 | public String getPackageCodePath() { |
| 137 | throw new UnsupportedOperationException(); |
| 138 | } |
| 139 | |
| 140 | @Override |
| 141 | public SharedPreferences getSharedPreferences(String name, int mode) { |
| 142 | throw new UnsupportedOperationException(); |
| 143 | } |
| 144 | |
| Jeff Sharkey | 70168dd | 2016-03-30 21:47:16 -0600 | [diff] [blame] | 145 | /** @removed */ |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 146 | @Override |
| Jeff Sharkey | 8fc29cf | 2015-11-30 17:51:00 -0700 | [diff] [blame] | 147 | public SharedPreferences getSharedPreferences(File file, int mode) { |
| 148 | throw new UnsupportedOperationException(); |
| 149 | } |
| 150 | |
| 151 | @Override |
| Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 152 | public boolean moveSharedPreferencesFrom(Context sourceContext, String name) { |
| Jeff Sharkey | 35871f2 | 2016-01-29 17:13:29 -0700 | [diff] [blame] | 153 | throw new UnsupportedOperationException(); |
| 154 | } |
| 155 | |
| 156 | @Override |
| 157 | public boolean deleteSharedPreferences(String name) { |
| 158 | throw new UnsupportedOperationException(); |
| 159 | } |
| 160 | |
| 161 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 162 | public FileInputStream openFileInput(String name) throws FileNotFoundException { |
| 163 | throw new UnsupportedOperationException(); |
| 164 | } |
| 165 | |
| 166 | @Override |
| 167 | public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException { |
| 168 | throw new UnsupportedOperationException(); |
| 169 | } |
| 170 | |
| 171 | @Override |
| 172 | public boolean deleteFile(String name) { |
| 173 | throw new UnsupportedOperationException(); |
| 174 | } |
| 175 | |
| 176 | @Override |
| 177 | public File getFileStreamPath(String name) { |
| 178 | throw new UnsupportedOperationException(); |
| 179 | } |
| 180 | |
| Jeff Sharkey | 70168dd | 2016-03-30 21:47:16 -0600 | [diff] [blame] | 181 | /** @removed */ |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 182 | @Override |
| Jeff Sharkey | 6a6cdafa | 2015-12-07 19:25:19 -0700 | [diff] [blame] | 183 | public File getSharedPreferencesPath(String name) { |
| 184 | throw new UnsupportedOperationException(); |
| 185 | } |
| 186 | |
| 187 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 188 | public String[] fileList() { |
| 189 | throw new UnsupportedOperationException(); |
| 190 | } |
| 191 | |
| 192 | @Override |
| Jeff Sharkey | 2c1ba9a | 2016-02-17 15:29:38 -0700 | [diff] [blame] | 193 | public File getDataDir() { |
| 194 | throw new UnsupportedOperationException(); |
| 195 | } |
| 196 | |
| 197 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 198 | public File getFilesDir() { |
| 199 | throw new UnsupportedOperationException(); |
| 200 | } |
| 201 | |
| 202 | @Override |
| Christopher Tate | a7835b6 | 2014-07-11 17:25:57 -0700 | [diff] [blame] | 203 | public File getNoBackupFilesDir() { |
| 204 | throw new UnsupportedOperationException(); |
| 205 | } |
| 206 | |
| 207 | @Override |
| Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 208 | public File getExternalFilesDir(String type) { |
| 209 | throw new UnsupportedOperationException(); |
| 210 | } |
| 211 | |
| 212 | @Override |
| Dianne Hackborn | 805fd7e | 2011-01-16 18:30:29 -0800 | [diff] [blame] | 213 | public File getObbDir() { |
| 214 | throw new UnsupportedOperationException(); |
| 215 | } |
| Stephan Linzner | b51617f | 2016-01-27 18:09:50 -0800 | [diff] [blame] | 216 | |
| Dianne Hackborn | 805fd7e | 2011-01-16 18:30:29 -0800 | [diff] [blame] | 217 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 218 | public File getCacheDir() { |
| 219 | throw new UnsupportedOperationException(); |
| 220 | } |
| 221 | |
| 222 | @Override |
| Jeff Sharkey | 4ed745d | 2014-07-15 20:39:15 -0700 | [diff] [blame] | 223 | public File getCodeCacheDir() { |
| 224 | throw new UnsupportedOperationException(); |
| 225 | } |
| 226 | |
| 227 | @Override |
| Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 228 | public File getExternalCacheDir() { |
| 229 | throw new UnsupportedOperationException(); |
| 230 | } |
| 231 | |
| 232 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 233 | public File getDir(String name, int mode) { |
| 234 | throw new UnsupportedOperationException(); |
| 235 | } |
| 236 | |
| 237 | @Override |
| Stephan Linzner | b51617f | 2016-01-27 18:09:50 -0800 | [diff] [blame] | 238 | public SQLiteDatabase openOrCreateDatabase(String file, int mode, |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 239 | SQLiteDatabase.CursorFactory factory) { |
| 240 | throw new UnsupportedOperationException(); |
| 241 | } |
| 242 | |
| 243 | @Override |
| Vasu Nori | 74f170f | 2010-06-01 18:06:18 -0700 | [diff] [blame] | 244 | public SQLiteDatabase openOrCreateDatabase(String file, int mode, |
| 245 | SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) { |
| 246 | throw new UnsupportedOperationException(); |
| 247 | } |
| 248 | |
| 249 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 250 | public File getDatabasePath(String name) { |
| 251 | throw new UnsupportedOperationException(); |
| 252 | } |
| 253 | |
| 254 | @Override |
| 255 | public String[] databaseList() { |
| 256 | throw new UnsupportedOperationException(); |
| 257 | } |
| 258 | |
| 259 | @Override |
| Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 260 | public boolean moveDatabaseFrom(Context sourceContext, String name) { |
| Jeff Sharkey | 35871f2 | 2016-01-29 17:13:29 -0700 | [diff] [blame] | 261 | throw new UnsupportedOperationException(); |
| 262 | } |
| 263 | |
| 264 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 265 | public boolean deleteDatabase(String name) { |
| 266 | throw new UnsupportedOperationException(); |
| 267 | } |
| 268 | |
| 269 | @Override |
| 270 | public Drawable getWallpaper() { |
| 271 | throw new UnsupportedOperationException(); |
| 272 | } |
| 273 | |
| 274 | @Override |
| 275 | public Drawable peekWallpaper() { |
| 276 | throw new UnsupportedOperationException(); |
| 277 | } |
| 278 | |
| 279 | @Override |
| 280 | public int getWallpaperDesiredMinimumWidth() { |
| 281 | throw new UnsupportedOperationException(); |
| 282 | } |
| 283 | |
| 284 | @Override |
| 285 | public int getWallpaperDesiredMinimumHeight() { |
| 286 | throw new UnsupportedOperationException(); |
| 287 | } |
| 288 | |
| 289 | @Override |
| 290 | public void setWallpaper(Bitmap bitmap) throws IOException { |
| 291 | throw new UnsupportedOperationException(); |
| 292 | } |
| 293 | |
| 294 | @Override |
| 295 | public void setWallpaper(InputStream data) throws IOException { |
| 296 | throw new UnsupportedOperationException(); |
| 297 | } |
| 298 | |
| 299 | @Override |
| 300 | public void clearWallpaper() { |
| 301 | throw new UnsupportedOperationException(); |
| 302 | } |
| 303 | |
| 304 | @Override |
| 305 | public void startActivity(Intent intent) { |
| 306 | throw new UnsupportedOperationException(); |
| 307 | } |
| 308 | |
| 309 | @Override |
| Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 310 | public void startActivity(Intent intent, Bundle options) { |
| 311 | startActivity(intent); |
| 312 | } |
| 313 | |
| 314 | @Override |
| Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 315 | public void startActivities(Intent[] intents) { |
| 316 | throw new UnsupportedOperationException(); |
| 317 | } |
| 318 | |
| 319 | @Override |
| Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 320 | public void startActivities(Intent[] intents, Bundle options) { |
| 321 | startActivities(intents); |
| 322 | } |
| 323 | |
| 324 | @Override |
| Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 325 | public void startIntentSender(IntentSender intent, |
| 326 | Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) |
| 327 | throws IntentSender.SendIntentException { |
| 328 | throw new UnsupportedOperationException(); |
| 329 | } |
| Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 330 | |
| 331 | @Override |
| 332 | public void startIntentSender(IntentSender intent, |
| 333 | Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, |
| 334 | Bundle options) throws IntentSender.SendIntentException { |
| 335 | startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags); |
| 336 | } |
| Stephan Linzner | b51617f | 2016-01-27 18:09:50 -0800 | [diff] [blame] | 337 | |
| Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 338 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 339 | public void sendBroadcast(Intent intent) { |
| 340 | throw new UnsupportedOperationException(); |
| 341 | } |
| 342 | |
| Amith Yamasani | 67cf7d3 | 2012-02-16 14:31:23 -0800 | [diff] [blame] | 343 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 344 | public void sendBroadcast(Intent intent, String receiverPermission) { |
| 345 | throw new UnsupportedOperationException(); |
| 346 | } |
| 347 | |
| Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 348 | /** @hide */ |
| Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 349 | @Override |
| 350 | public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) { |
| 351 | throw new UnsupportedOperationException(); |
| 352 | } |
| 353 | |
| 354 | /** @hide */ |
| Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 355 | @SystemApi |
| 356 | @Override |
| 357 | public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) { |
| 358 | throw new UnsupportedOperationException(); |
| 359 | } |
| 360 | |
| 361 | /** @hide */ |
| Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 362 | @Override |
| 363 | public void sendBroadcast(Intent intent, String receiverPermission, int appOp) { |
| 364 | throw new UnsupportedOperationException(); |
| 365 | } |
| 366 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 367 | @Override |
| 368 | public void sendOrderedBroadcast(Intent intent, |
| 369 | String receiverPermission) { |
| 370 | throw new UnsupportedOperationException(); |
| 371 | } |
| 372 | |
| 373 | @Override |
| 374 | public void sendOrderedBroadcast(Intent intent, String receiverPermission, |
| 375 | BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, |
| 376 | Bundle initialExtras) { |
| 377 | throw new UnsupportedOperationException(); |
| 378 | } |
| 379 | |
| Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 380 | /** @hide */ |
| Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 381 | @SystemApi |
| 382 | @Override |
| 383 | public void sendOrderedBroadcast(Intent intent, String receiverPermission, |
| 384 | Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, |
| 385 | Bundle initialExtras) { |
| 386 | throw new UnsupportedOperationException(); |
| 387 | } |
| 388 | |
| 389 | /** @hide */ |
| Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 390 | @Override |
| 391 | public void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp, |
| 392 | BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, |
| 393 | Bundle initialExtras) { |
| 394 | throw new UnsupportedOperationException(); |
| 395 | } |
| 396 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 397 | @Override |
| Dianne Hackborn | 79af1dd | 2012-08-16 16:42:52 -0700 | [diff] [blame] | 398 | public void sendBroadcastAsUser(Intent intent, UserHandle user) { |
| Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 399 | throw new UnsupportedOperationException(); |
| 400 | } |
| 401 | |
| 402 | @Override |
| Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 403 | public void sendBroadcastAsUser(Intent intent, UserHandle user, |
| 404 | String receiverPermission) { |
| 405 | throw new UnsupportedOperationException(); |
| 406 | } |
| 407 | |
| Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 408 | /** @hide */ |
| Chad Brubaker | 52c8edc | 2016-07-25 14:30:26 -0700 | [diff] [blame] | 409 | @SystemApi |
| 410 | @Override |
| 411 | public void sendBroadcastAsUser(Intent intent, UserHandle user, |
| 412 | String receiverPermission, Bundle options) { |
| 413 | throw new UnsupportedOperationException(); |
| 414 | } |
| 415 | |
| 416 | /** @hide */ |
| Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 417 | @Override |
| 418 | public void sendBroadcastAsUser(Intent intent, UserHandle user, |
| 419 | String receiverPermission, int appOp) { |
| 420 | throw new UnsupportedOperationException(); |
| 421 | } |
| 422 | |
| Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 423 | @Override |
| Dianne Hackborn | 79af1dd | 2012-08-16 16:42:52 -0700 | [diff] [blame] | 424 | public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, |
| Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 425 | String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, |
| Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 426 | int initialCode, String initialData, Bundle initialExtras) { |
| 427 | throw new UnsupportedOperationException(); |
| 428 | } |
| 429 | |
| Amith Yamasani | 3cf7572 | 2014-05-16 12:37:29 -0700 | [diff] [blame] | 430 | /** @hide */ |
| Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 431 | @Override |
| Amith Yamasani | 3cf7572 | 2014-05-16 12:37:29 -0700 | [diff] [blame] | 432 | public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, |
| 433 | String receiverPermission, int appOp, BroadcastReceiver resultReceiver, |
| Dianne Hackborn | fd854ee | 2015-07-13 18:00:37 -0700 | [diff] [blame] | 434 | Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { |
| 435 | throw new UnsupportedOperationException(); |
| 436 | } |
| 437 | |
| 438 | /** @hide */ |
| 439 | @Override |
| 440 | public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, |
| 441 | String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver, |
| 442 | Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { |
| Amith Yamasani | 3cf7572 | 2014-05-16 12:37:29 -0700 | [diff] [blame] | 443 | throw new UnsupportedOperationException(); |
| 444 | } |
| 445 | |
| 446 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 447 | public void sendStickyBroadcast(Intent intent) { |
| 448 | throw new UnsupportedOperationException(); |
| 449 | } |
| 450 | |
| 451 | @Override |
| Dianne Hackborn | efa199f | 2009-09-19 12:03:15 -0700 | [diff] [blame] | 452 | public void sendStickyOrderedBroadcast(Intent intent, |
| 453 | BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, |
| 454 | Bundle initialExtras) { |
| 455 | throw new UnsupportedOperationException(); |
| 456 | } |
| 457 | |
| 458 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 459 | public void removeStickyBroadcast(Intent intent) { |
| 460 | throw new UnsupportedOperationException(); |
| 461 | } |
| 462 | |
| 463 | @Override |
| Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 464 | public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) { |
| 465 | throw new UnsupportedOperationException(); |
| 466 | } |
| 467 | |
| Dianne Hackborn | e0e413e | 2015-12-09 17:22:26 -0800 | [diff] [blame] | 468 | /** @hide */ |
| 469 | @Override |
| 470 | public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) { |
| 471 | throw new UnsupportedOperationException(); |
| 472 | } |
| 473 | |
| Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 474 | @Override |
| 475 | public void sendStickyOrderedBroadcastAsUser(Intent intent, |
| 476 | UserHandle user, BroadcastReceiver resultReceiver, |
| 477 | Handler scheduler, int initialCode, String initialData, |
| 478 | Bundle initialExtras) { |
| 479 | throw new UnsupportedOperationException(); |
| 480 | } |
| 481 | |
| 482 | @Override |
| 483 | public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) { |
| 484 | throw new UnsupportedOperationException(); |
| 485 | } |
| 486 | |
| 487 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 488 | public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) { |
| 489 | throw new UnsupportedOperationException(); |
| 490 | } |
| 491 | |
| 492 | @Override |
| 493 | public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, |
| 494 | String broadcastPermission, Handler scheduler) { |
| 495 | throw new UnsupportedOperationException(); |
| 496 | } |
| 497 | |
| Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 498 | /** @hide */ |
| 499 | @Override |
| 500 | public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user, |
| 501 | IntentFilter filter, String broadcastPermission, Handler scheduler) { |
| 502 | throw new UnsupportedOperationException(); |
| 503 | } |
| 504 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 505 | @Override |
| 506 | public void unregisterReceiver(BroadcastReceiver receiver) { |
| 507 | throw new UnsupportedOperationException(); |
| 508 | } |
| 509 | |
| 510 | @Override |
| 511 | public ComponentName startService(Intent service) { |
| 512 | throw new UnsupportedOperationException(); |
| 513 | } |
| 514 | |
| 515 | @Override |
| 516 | public boolean stopService(Intent service) { |
| 517 | throw new UnsupportedOperationException(); |
| 518 | } |
| 519 | |
| Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 520 | /** @hide */ |
| 521 | @Override |
| 522 | public ComponentName startServiceAsUser(Intent service, UserHandle user) { |
| 523 | throw new UnsupportedOperationException(); |
| 524 | } |
| 525 | |
| 526 | /** @hide */ |
| 527 | @Override |
| 528 | public boolean stopServiceAsUser(Intent service, UserHandle user) { |
| 529 | throw new UnsupportedOperationException(); |
| 530 | } |
| 531 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 532 | @Override |
| 533 | public boolean bindService(Intent service, ServiceConnection conn, int flags) { |
| 534 | throw new UnsupportedOperationException(); |
| 535 | } |
| 536 | |
| Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 537 | /** @hide */ |
| 538 | @Override |
| Amith Yamasani | 27b89e6 | 2013-01-16 12:30:11 -0800 | [diff] [blame] | 539 | public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags, |
| 540 | UserHandle user) { |
| Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 541 | throw new UnsupportedOperationException(); |
| 542 | } |
| 543 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 544 | @Override |
| 545 | public void unbindService(ServiceConnection conn) { |
| 546 | throw new UnsupportedOperationException(); |
| 547 | } |
| 548 | |
| 549 | @Override |
| 550 | public boolean startInstrumentation(ComponentName className, |
| 551 | String profileFile, Bundle arguments) { |
| 552 | throw new UnsupportedOperationException(); |
| 553 | } |
| 554 | |
| 555 | @Override |
| 556 | public Object getSystemService(String name) { |
| 557 | throw new UnsupportedOperationException(); |
| 558 | } |
| 559 | |
| 560 | @Override |
| Jeff Brown | 6e53931 | 2015-02-24 18:53:21 -0800 | [diff] [blame] | 561 | public String getSystemServiceName(Class<?> serviceClass) { |
| 562 | throw new UnsupportedOperationException(); |
| 563 | } |
| 564 | |
| 565 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 566 | public int checkPermission(String permission, int pid, int uid) { |
| 567 | throw new UnsupportedOperationException(); |
| 568 | } |
| 569 | |
| Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 570 | /** @hide */ |
| 571 | @Override |
| 572 | public int checkPermission(String permission, int pid, int uid, IBinder callerToken) { |
| 573 | return checkPermission(permission, pid, uid); |
| 574 | } |
| 575 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 576 | @Override |
| 577 | public int checkCallingPermission(String permission) { |
| 578 | throw new UnsupportedOperationException(); |
| 579 | } |
| 580 | |
| 581 | @Override |
| 582 | public int checkCallingOrSelfPermission(String permission) { |
| 583 | throw new UnsupportedOperationException(); |
| 584 | } |
| 585 | |
| 586 | @Override |
| Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 587 | public int checkSelfPermission(String permission) { |
| 588 | throw new UnsupportedOperationException(); |
| 589 | } |
| 590 | |
| 591 | @Override |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 592 | public void enforcePermission( |
| 593 | String permission, int pid, int uid, String message) { |
| 594 | throw new UnsupportedOperationException(); |
| 595 | } |
| 596 | |
| 597 | @Override |
| 598 | public void enforceCallingPermission(String permission, String message) { |
| 599 | throw new UnsupportedOperationException(); |
| 600 | } |
| 601 | |
| 602 | @Override |
| 603 | public void enforceCallingOrSelfPermission(String permission, String message) { |
| 604 | throw new UnsupportedOperationException(); |
| 605 | } |
| 606 | |
| 607 | @Override |
| 608 | public void grantUriPermission(String toPackage, Uri uri, int modeFlags) { |
| 609 | throw new UnsupportedOperationException(); |
| 610 | } |
| 611 | |
| 612 | @Override |
| 613 | public void revokeUriPermission(Uri uri, int modeFlags) { |
| 614 | throw new UnsupportedOperationException(); |
| 615 | } |
| 616 | |
| 617 | @Override |
| 618 | public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) { |
| 619 | throw new UnsupportedOperationException(); |
| 620 | } |
| 621 | |
| Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 622 | /** @hide */ |
| 623 | @Override |
| 624 | public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) { |
| 625 | return checkUriPermission(uri, pid, uid, modeFlags); |
| 626 | } |
| 627 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 628 | @Override |
| 629 | public int checkCallingUriPermission(Uri uri, int modeFlags) { |
| 630 | throw new UnsupportedOperationException(); |
| 631 | } |
| 632 | |
| 633 | @Override |
| 634 | public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) { |
| 635 | throw new UnsupportedOperationException(); |
| 636 | } |
| 637 | |
| 638 | @Override |
| 639 | public int checkUriPermission(Uri uri, String readPermission, |
| 640 | String writePermission, int pid, int uid, int modeFlags) { |
| 641 | throw new UnsupportedOperationException(); |
| 642 | } |
| 643 | |
| 644 | @Override |
| 645 | public void enforceUriPermission( |
| 646 | Uri uri, int pid, int uid, int modeFlags, String message) { |
| 647 | throw new UnsupportedOperationException(); |
| 648 | } |
| 649 | |
| 650 | @Override |
| 651 | public void enforceCallingUriPermission( |
| 652 | Uri uri, int modeFlags, String message) { |
| 653 | throw new UnsupportedOperationException(); |
| 654 | } |
| 655 | |
| 656 | @Override |
| 657 | public void enforceCallingOrSelfUriPermission( |
| 658 | Uri uri, int modeFlags, String message) { |
| 659 | throw new UnsupportedOperationException(); |
| 660 | } |
| 661 | |
| 662 | public void enforceUriPermission( |
| 663 | Uri uri, String readPermission, String writePermission, |
| 664 | int pid, int uid, int modeFlags, String message) { |
| 665 | throw new UnsupportedOperationException(); |
| 666 | } |
| 667 | |
| 668 | @Override |
| 669 | public Context createPackageContext(String packageName, int flags) |
| 670 | throws PackageManager.NameNotFoundException { |
| 671 | throw new UnsupportedOperationException(); |
| 672 | } |
| Romain Guy | 870e09f | 2009-07-06 16:35:25 -0700 | [diff] [blame] | 673 | |
| Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 674 | /** {@hide} */ |
| 675 | @Override |
| Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 676 | public Context createApplicationContext(ApplicationInfo application, int flags) |
| 677 | throws PackageManager.NameNotFoundException { |
| 678 | return null; |
| 679 | } |
| 680 | |
| 681 | /** {@hide} */ |
| 682 | @Override |
| Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 683 | public Context createPackageContextAsUser(String packageName, int flags, UserHandle user) |
| 684 | throws PackageManager.NameNotFoundException { |
| 685 | throw new UnsupportedOperationException(); |
| 686 | } |
| 687 | |
| Jim Miller | a75a883 | 2013-02-07 16:53:32 -0800 | [diff] [blame] | 688 | /** {@hide} */ |
| 689 | @Override |
| 690 | public int getUserId() { |
| 691 | throw new UnsupportedOperationException(); |
| 692 | } |
| 693 | |
| Romain Guy | 870e09f | 2009-07-06 16:35:25 -0700 | [diff] [blame] | 694 | @Override |
| Dianne Hackborn | 756220b | 2012-08-14 16:45:30 -0700 | [diff] [blame] | 695 | public Context createConfigurationContext(Configuration overrideConfiguration) { |
| 696 | throw new UnsupportedOperationException(); |
| 697 | } |
| 698 | |
| 699 | @Override |
| Jeff Brown | a492c3a | 2012-08-23 19:48:44 -0700 | [diff] [blame] | 700 | public Context createDisplayContext(Display display) { |
| 701 | throw new UnsupportedOperationException(); |
| 702 | } |
| 703 | |
| 704 | @Override |
| Romain Guy | 870e09f | 2009-07-06 16:35:25 -0700 | [diff] [blame] | 705 | public boolean isRestricted() { |
| Svetoslav | 976e8bd | 2014-07-16 15:12:03 -0700 | [diff] [blame] | 706 | throw new UnsupportedOperationException(); |
| Romain Guy | 870e09f | 2009-07-06 16:35:25 -0700 | [diff] [blame] | 707 | } |
| Jeff Brown | 98365d7 | 2012-08-19 20:30:52 -0700 | [diff] [blame] | 708 | |
| 709 | /** @hide */ |
| 710 | @Override |
| Craig Mautner | 48d0d18 | 2013-06-11 07:53:06 -0700 | [diff] [blame] | 711 | public DisplayAdjustments getDisplayAdjustments(int displayId) { |
| Jeff Brown | 98365d7 | 2012-08-19 20:30:52 -0700 | [diff] [blame] | 712 | throw new UnsupportedOperationException(); |
| 713 | } |
| Jeff Sharkey | 7f392de | 2013-08-11 17:42:17 -0700 | [diff] [blame] | 714 | |
| Adam Lesinski | 4ece3d6 | 2016-06-16 18:05:41 -0700 | [diff] [blame] | 715 | /** @hide */ |
| 716 | @Override |
| 717 | public Display getDisplay() { |
| 718 | throw new UnsupportedOperationException(); |
| 719 | } |
| 720 | |
| Jeff Sharkey | 7f392de | 2013-08-11 17:42:17 -0700 | [diff] [blame] | 721 | @Override |
| 722 | public File[] getExternalFilesDirs(String type) { |
| 723 | throw new UnsupportedOperationException(); |
| 724 | } |
| 725 | |
| 726 | @Override |
| 727 | public File[] getObbDirs() { |
| 728 | throw new UnsupportedOperationException(); |
| 729 | } |
| 730 | |
| 731 | @Override |
| 732 | public File[] getExternalCacheDirs() { |
| 733 | throw new UnsupportedOperationException(); |
| 734 | } |
| Jeff Sharkey | 2ee3c1e | 2014-05-30 15:38:35 -0700 | [diff] [blame] | 735 | |
| 736 | @Override |
| 737 | public File[] getExternalMediaDirs() { |
| 738 | throw new UnsupportedOperationException(); |
| 739 | } |
| Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 740 | |
| 741 | @Override |
| Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 742 | public Context createDeviceProtectedStorageContext() { |
| Jeff Sharkey | e13529a | 2015-12-09 14:15:27 -0700 | [diff] [blame] | 743 | throw new UnsupportedOperationException(); |
| 744 | } |
| 745 | |
| 746 | /** {@hide} */ |
| 747 | @SystemApi |
| 748 | @Override |
| Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 749 | public Context createCredentialProtectedStorageContext() { |
| Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 750 | throw new UnsupportedOperationException(); |
| 751 | } |
| 752 | |
| 753 | @Override |
| Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 754 | public boolean isDeviceProtectedStorage() { |
| Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 755 | throw new UnsupportedOperationException(); |
| 756 | } |
| 757 | |
| Jeff Sharkey | e13529a | 2015-12-09 14:15:27 -0700 | [diff] [blame] | 758 | /** {@hide} */ |
| 759 | @SystemApi |
| Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 760 | @Override |
| Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 761 | public boolean isCredentialProtectedStorage() { |
| Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 762 | throw new UnsupportedOperationException(); |
| 763 | } |
| Tony Mak | 46aabe5 | 2016-11-14 12:53:06 +0000 | [diff] [blame] | 764 | |
| 765 | /** {@hide} */ |
| 766 | @Override |
| 767 | public IBinder getActivityToken() { |
| 768 | throw new UnsupportedOperationException(); |
| 769 | } |
| 770 | |
| 771 | /** {@hide} */ |
| 772 | @Override |
| 773 | public IServiceConnection getServiceDispatcher(ServiceConnection conn, Handler handler, |
| 774 | int flags) { |
| 775 | throw new UnsupportedOperationException(); |
| 776 | } |
| 777 | |
| 778 | /** {@hide} */ |
| 779 | @Override |
| 780 | public IApplicationThread getIApplicationThread() { |
| 781 | throw new UnsupportedOperationException(); |
| 782 | } |
| Tony Mak | bf9928d | 2016-12-22 11:02:45 +0000 | [diff] [blame^] | 783 | |
| 784 | /** {@hide} */ |
| 785 | @Override |
| 786 | public Handler getMainThreadHandler() { |
| 787 | throw new UnsupportedOperationException(); |
| 788 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 789 | } |