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