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