blob: 0208c3a0a0de1fa6eaa49c58427a3f4f93529a8f [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
17package android.test.mock;
18
Dianne Hackborna750a632015-06-16 17:18:23 -070019import android.annotation.SystemApi;
Tony Mak46aabe52016-11-14 12:53:06 +000020import android.app.IApplicationThread;
21import android.app.IServiceConnection;
Jeff Sharkey8439ac02017-12-12 17:26:23 -070022import android.content.BroadcastReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.ComponentName;
24import android.content.ContentResolver;
25import android.content.Context;
26import android.content.Intent;
27import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070028import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.ServiceConnection;
30import android.content.SharedPreferences;
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -070031import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032import android.content.pm.PackageManager;
33import android.content.res.AssetManager;
Dianne Hackborn756220b2012-08-14 16:45:30 -070034import android.content.res.Configuration;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.content.res.Resources;
Vasu Nori74f170f2010-06-01 18:06:18 -070036import android.database.DatabaseErrorHandler;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037import android.database.sqlite.SQLiteDatabase;
38import android.graphics.Bitmap;
39import android.graphics.drawable.Drawable;
40import android.net.Uri;
41import android.os.Bundle;
42import android.os.Handler;
Dianne Hackbornff170242014-11-19 10:59:01 -080043import android.os.IBinder;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import android.os.Looper;
Dianne Hackborn79af1dd2012-08-16 16:42:52 -070045import android.os.UserHandle;
Jeff Browna492c3a2012-08-23 19:48:44 -070046import android.view.Display;
Jeff Sharkey8439ac02017-12-12 17:26:23 -070047import android.view.DisplayAdjustments;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048
49import java.io.File;
50import java.io.FileInputStream;
51import java.io.FileNotFoundException;
52import java.io.FileOutputStream;
53import java.io.IOException;
54import java.io.InputStream;
Jeff Sharkey8439ac02017-12-12 17:26:23 -070055import java.util.concurrent.Executor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
57/**
Stephan Linznerb51617f2016-01-27 18:09:50 -080058 * A mock {@link android.content.Context} class. All methods are non-functional and throw
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080059 * {@link java.lang.UnsupportedOperationException}. You can use this to inject other dependencies,
60 * mocks, or monitors into the classes you are testing.
61 */
62public class MockContext extends Context {
63
64 @Override
65 public AssetManager getAssets() {
66 throw new UnsupportedOperationException();
67 }
68
69 @Override
70 public Resources getResources() {
71 throw new UnsupportedOperationException();
72 }
73
74 @Override
75 public PackageManager getPackageManager() {
76 throw new UnsupportedOperationException();
77 }
78
79 @Override
80 public ContentResolver getContentResolver() {
81 throw new UnsupportedOperationException();
82 }
83
84 @Override
85 public Looper getMainLooper() {
86 throw new UnsupportedOperationException();
87 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080088
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080089 @Override
Jeff Sharkey8439ac02017-12-12 17:26:23 -070090 public Executor getMainExecutor() {
91 throw new UnsupportedOperationException();
92 }
93
94 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095 public Context getApplicationContext() {
96 throw new UnsupportedOperationException();
97 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080098
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080099 @Override
100 public void setTheme(int resid) {
101 throw new UnsupportedOperationException();
102 }
103
104 @Override
105 public Resources.Theme getTheme() {
106 throw new UnsupportedOperationException();
107 }
108
109 @Override
110 public ClassLoader getClassLoader() {
111 throw new UnsupportedOperationException();
112 }
113
114 @Override
115 public String getPackageName() {
116 throw new UnsupportedOperationException();
117 }
118
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800119 /** @hide */
120 @Override
121 public String getBasePackageName() {
122 throw new UnsupportedOperationException();
123 }
124
Dianne Hackborn95d78532013-09-11 09:51:14 -0700125 /** @hide */
126 @Override
127 public String getOpPackageName() {
128 throw new UnsupportedOperationException();
129 }
130
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800131 @Override
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700132 public ApplicationInfo getApplicationInfo() {
133 throw new UnsupportedOperationException();
134 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800135
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700136 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 public String getPackageResourcePath() {
138 throw new UnsupportedOperationException();
139 }
140
Joe Onorato23ecae32009-06-10 17:07:15 -0700141 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 public String getPackageCodePath() {
143 throw new UnsupportedOperationException();
144 }
145
146 @Override
147 public SharedPreferences getSharedPreferences(String name, int mode) {
148 throw new UnsupportedOperationException();
149 }
150
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600151 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800152 @Override
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700153 public SharedPreferences getSharedPreferences(File file, int mode) {
154 throw new UnsupportedOperationException();
155 }
156
Christopher Tatefe2368c2017-05-17 15:42:35 -0700157 /** @hide */
158 @Override
159 public void reloadSharedPreferences() {
160 throw new UnsupportedOperationException();
161 }
162
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700163 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600164 public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700165 throw new UnsupportedOperationException();
166 }
167
168 @Override
169 public boolean deleteSharedPreferences(String name) {
170 throw new UnsupportedOperationException();
171 }
172
173 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800174 public FileInputStream openFileInput(String name) throws FileNotFoundException {
175 throw new UnsupportedOperationException();
176 }
177
178 @Override
179 public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException {
180 throw new UnsupportedOperationException();
181 }
182
183 @Override
184 public boolean deleteFile(String name) {
185 throw new UnsupportedOperationException();
186 }
187
188 @Override
189 public File getFileStreamPath(String name) {
190 throw new UnsupportedOperationException();
191 }
192
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600193 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800194 @Override
Jeff Sharkey6a6cdaf2015-12-07 19:25:19 -0700195 public File getSharedPreferencesPath(String name) {
196 throw new UnsupportedOperationException();
197 }
198
199 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800200 public String[] fileList() {
201 throw new UnsupportedOperationException();
202 }
203
204 @Override
Jeff Sharkey2c1ba9a2016-02-17 15:29:38 -0700205 public File getDataDir() {
206 throw new UnsupportedOperationException();
207 }
208
209 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800210 public File getFilesDir() {
211 throw new UnsupportedOperationException();
212 }
213
214 @Override
Christopher Tatea7835b62014-07-11 17:25:57 -0700215 public File getNoBackupFilesDir() {
216 throw new UnsupportedOperationException();
217 }
218
219 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800220 public File getExternalFilesDir(String type) {
221 throw new UnsupportedOperationException();
222 }
223
224 @Override
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800225 public File getObbDir() {
226 throw new UnsupportedOperationException();
227 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800228
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800229 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800230 public File getCacheDir() {
231 throw new UnsupportedOperationException();
232 }
233
234 @Override
Jeff Sharkey4ed745d2014-07-15 20:39:15 -0700235 public File getCodeCacheDir() {
236 throw new UnsupportedOperationException();
237 }
238
239 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800240 public File getExternalCacheDir() {
241 throw new UnsupportedOperationException();
242 }
243
244 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 public File getDir(String name, int mode) {
246 throw new UnsupportedOperationException();
247 }
248
249 @Override
Stephan Linznerb51617f2016-01-27 18:09:50 -0800250 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800251 SQLiteDatabase.CursorFactory factory) {
252 throw new UnsupportedOperationException();
253 }
254
255 @Override
Vasu Nori74f170f2010-06-01 18:06:18 -0700256 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
257 SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) {
258 throw new UnsupportedOperationException();
259 }
260
261 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800262 public File getDatabasePath(String name) {
263 throw new UnsupportedOperationException();
264 }
265
266 @Override
267 public String[] databaseList() {
268 throw new UnsupportedOperationException();
269 }
270
271 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600272 public boolean moveDatabaseFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700273 throw new UnsupportedOperationException();
274 }
275
276 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800277 public boolean deleteDatabase(String name) {
278 throw new UnsupportedOperationException();
279 }
280
281 @Override
282 public Drawable getWallpaper() {
283 throw new UnsupportedOperationException();
284 }
285
286 @Override
287 public Drawable peekWallpaper() {
288 throw new UnsupportedOperationException();
289 }
290
291 @Override
292 public int getWallpaperDesiredMinimumWidth() {
293 throw new UnsupportedOperationException();
294 }
295
296 @Override
297 public int getWallpaperDesiredMinimumHeight() {
298 throw new UnsupportedOperationException();
299 }
300
301 @Override
302 public void setWallpaper(Bitmap bitmap) throws IOException {
303 throw new UnsupportedOperationException();
304 }
305
306 @Override
307 public void setWallpaper(InputStream data) throws IOException {
308 throw new UnsupportedOperationException();
309 }
310
311 @Override
312 public void clearWallpaper() {
313 throw new UnsupportedOperationException();
314 }
315
316 @Override
317 public void startActivity(Intent intent) {
318 throw new UnsupportedOperationException();
319 }
320
321 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700322 public void startActivity(Intent intent, Bundle options) {
323 startActivity(intent);
324 }
325
326 @Override
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800327 public void startActivities(Intent[] intents) {
328 throw new UnsupportedOperationException();
329 }
330
331 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700332 public void startActivities(Intent[] intents, Bundle options) {
333 startActivities(intents);
334 }
335
336 @Override
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700337 public void startIntentSender(IntentSender intent,
338 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
339 throws IntentSender.SendIntentException {
340 throw new UnsupportedOperationException();
341 }
Dianne Hackborna4972e92012-03-14 10:38:05 -0700342
343 @Override
344 public void startIntentSender(IntentSender intent,
345 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags,
346 Bundle options) throws IntentSender.SendIntentException {
347 startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags);
348 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800349
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700350 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800351 public void sendBroadcast(Intent intent) {
352 throw new UnsupportedOperationException();
353 }
354
Amith Yamasani67cf7d32012-02-16 14:31:23 -0800355 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 public void sendBroadcast(Intent intent, String receiverPermission) {
357 throw new UnsupportedOperationException();
358 }
359
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800360 /** @hide */
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700361 @Override
362 public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) {
363 throw new UnsupportedOperationException();
364 }
365
366 /** @hide */
Tyler Gunnf955e562018-04-26 14:43:31 -0700367 @Override
368 public void sendBroadcastAsUserMultiplePermissions(Intent intent, UserHandle user,
369 String[] receiverPermissions) {
370 throw new UnsupportedOperationException();
371 }
372
373 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700374 @SystemApi
375 @Override
376 public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) {
377 throw new UnsupportedOperationException();
378 }
379
380 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800381 @Override
382 public void sendBroadcast(Intent intent, String receiverPermission, int appOp) {
383 throw new UnsupportedOperationException();
384 }
385
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800386 @Override
387 public void sendOrderedBroadcast(Intent intent,
388 String receiverPermission) {
389 throw new UnsupportedOperationException();
390 }
391
392 @Override
393 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
394 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
395 Bundle initialExtras) {
396 throw new UnsupportedOperationException();
397 }
398
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800399 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700400 @SystemApi
401 @Override
402 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
403 Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
404 Bundle initialExtras) {
405 throw new UnsupportedOperationException();
406 }
407
408 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800409 @Override
410 public void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp,
411 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
412 Bundle initialExtras) {
413 throw new UnsupportedOperationException();
414 }
415
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800416 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700417 public void sendBroadcastAsUser(Intent intent, UserHandle user) {
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700418 throw new UnsupportedOperationException();
419 }
420
421 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700422 public void sendBroadcastAsUser(Intent intent, UserHandle user,
423 String receiverPermission) {
424 throw new UnsupportedOperationException();
425 }
426
Svet Ganov16a16892015-04-16 10:32:04 -0700427 /** @hide */
Chad Brubaker52c8edc2016-07-25 14:30:26 -0700428 @SystemApi
429 @Override
430 public void sendBroadcastAsUser(Intent intent, UserHandle user,
431 String receiverPermission, Bundle options) {
432 throw new UnsupportedOperationException();
433 }
434
435 /** @hide */
Svet Ganov16a16892015-04-16 10:32:04 -0700436 @Override
437 public void sendBroadcastAsUser(Intent intent, UserHandle user,
438 String receiverPermission, int appOp) {
439 throw new UnsupportedOperationException();
440 }
441
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700442 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700443 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700444 String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700445 int initialCode, String initialData, Bundle initialExtras) {
446 throw new UnsupportedOperationException();
447 }
448
Amith Yamasani3cf75722014-05-16 12:37:29 -0700449 /** @hide */
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700450 @Override
Amith Yamasani3cf75722014-05-16 12:37:29 -0700451 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
452 String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
Dianne Hackbornfd854ee2015-07-13 18:00:37 -0700453 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
454 throw new UnsupportedOperationException();
455 }
456
457 /** @hide */
458 @Override
459 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
460 String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
461 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
Amith Yamasani3cf75722014-05-16 12:37:29 -0700462 throw new UnsupportedOperationException();
463 }
464
465 @Override
Jordan Liua32e6fc2019-10-29 10:33:55 -0700466 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
467 String receiverAppOp, BroadcastReceiver resultReceiver, Handler scheduler,
468 int initialCode, String initialData, Bundle initialExtras) {
469 throw new UnsupportedOperationException();
470 }
471
472 @Override
Peter Wangcf8bfcc2019-11-07 16:57:23 -0800473 public void sendOrderedBroadcast(Intent intent, String receiverPermission, String receiverAppOp,
474 Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode,
475 String initialData, Bundle initialExtras) {
476 throw new UnsupportedOperationException();
477 }
478
479 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800480 public void sendStickyBroadcast(Intent intent) {
481 throw new UnsupportedOperationException();
482 }
483
484 @Override
Dianne Hackbornefa199f2009-09-19 12:03:15 -0700485 public void sendStickyOrderedBroadcast(Intent intent,
486 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
487 Bundle initialExtras) {
488 throw new UnsupportedOperationException();
489 }
490
491 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800492 public void removeStickyBroadcast(Intent intent) {
493 throw new UnsupportedOperationException();
494 }
495
496 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700497 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
498 throw new UnsupportedOperationException();
499 }
500
Dianne Hackborne0e413e2015-12-09 17:22:26 -0800501 /** @hide */
502 @Override
503 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
504 throw new UnsupportedOperationException();
505 }
506
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700507 @Override
508 public void sendStickyOrderedBroadcastAsUser(Intent intent,
509 UserHandle user, BroadcastReceiver resultReceiver,
510 Handler scheduler, int initialCode, String initialData,
511 Bundle initialExtras) {
512 throw new UnsupportedOperationException();
513 }
514
515 @Override
516 public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
517 throw new UnsupportedOperationException();
518 }
519
520 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800521 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
522 throw new UnsupportedOperationException();
523 }
524
525 @Override
526 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
Chad Brubaker6d6015f2017-04-18 11:25:16 -0700527 int flags) {
Chad Brubaker816c83b2017-03-02 10:27:59 -0800528 throw new UnsupportedOperationException();
529 }
530
531 @Override
532 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800533 String broadcastPermission, Handler scheduler) {
534 throw new UnsupportedOperationException();
535 }
536
Chad Brubaker816c83b2017-03-02 10:27:59 -0800537 @Override
538 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
Chad Brubaker6d6015f2017-04-18 11:25:16 -0700539 String broadcastPermission, Handler scheduler, int flags) {
Chad Brubaker816c83b2017-03-02 10:27:59 -0800540 throw new UnsupportedOperationException();
541 }
542
Dianne Hackborn20e80982012-08-31 19:00:44 -0700543 /** @hide */
544 @Override
Meng Wange3bd3ba2019-11-05 10:43:45 -0800545 @SystemApi
546 public Intent registerReceiverForAllUsers(BroadcastReceiver receiver,
547 IntentFilter filter, String broadcastPermission, Handler scheduler) {
548 throw new UnsupportedOperationException();
549 }
550
551 /** @hide */
552 @Override
Dianne Hackborn20e80982012-08-31 19:00:44 -0700553 public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
554 IntentFilter filter, String broadcastPermission, Handler scheduler) {
555 throw new UnsupportedOperationException();
556 }
557
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800558 @Override
559 public void unregisterReceiver(BroadcastReceiver receiver) {
560 throw new UnsupportedOperationException();
561 }
562
563 @Override
564 public ComponentName startService(Intent service) {
565 throw new UnsupportedOperationException();
566 }
567
568 @Override
Christopher Tate08992ac2017-03-21 11:37:06 -0700569 public ComponentName startForegroundService(Intent service) {
570 throw new UnsupportedOperationException();
571 }
572
Christopher Tate42a386b2016-11-07 12:21:21 -0800573 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800574 public boolean stopService(Intent service) {
575 throw new UnsupportedOperationException();
576 }
577
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700578 /** @hide */
579 @Override
580 public ComponentName startServiceAsUser(Intent service, UserHandle user) {
581 throw new UnsupportedOperationException();
582 }
583
584 /** @hide */
585 @Override
Christopher Tate08992ac2017-03-21 11:37:06 -0700586 public ComponentName startForegroundServiceAsUser(Intent service, UserHandle user) {
587 throw new UnsupportedOperationException();
588 }
589
Christopher Tate42a386b2016-11-07 12:21:21 -0800590 /** @hide */
591 @Override
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700592 public boolean stopServiceAsUser(Intent service, UserHandle user) {
593 throw new UnsupportedOperationException();
594 }
595
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800596 @Override
597 public boolean bindService(Intent service, ServiceConnection conn, int flags) {
598 throw new UnsupportedOperationException();
599 }
600
Dianne Hackborn27b4d942018-11-12 15:01:40 -0800601 @Override
Bo Liu58a57662019-03-06 20:21:45 +0000602 public boolean bindService(Intent service, int flags, Executor executor,
603 ServiceConnection conn) {
604 throw new UnsupportedOperationException();
605 }
606
607 @Override
608 public boolean bindIsolatedService(Intent service, int flags, String instanceName,
609 Executor executor, ServiceConnection conn) {
Dianne Hackborn27b4d942018-11-12 15:01:40 -0800610 throw new UnsupportedOperationException();
611 }
612
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800613 /** @hide */
614 @Override
Amith Yamasani27b89e62013-01-16 12:30:11 -0800615 public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
616 UserHandle user) {
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800617 throw new UnsupportedOperationException();
618 }
619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800620 @Override
Dianne Hackborna631d562018-11-20 15:58:15 -0800621 public void updateServiceGroup(ServiceConnection conn, int group, int importance) {
622 throw new UnsupportedOperationException();
623 }
624
625 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800626 public void unbindService(ServiceConnection conn) {
627 throw new UnsupportedOperationException();
628 }
629
630 @Override
631 public boolean startInstrumentation(ComponentName className,
632 String profileFile, Bundle arguments) {
633 throw new UnsupportedOperationException();
634 }
635
636 @Override
637 public Object getSystemService(String name) {
638 throw new UnsupportedOperationException();
639 }
640
641 @Override
Jeff Brown6e539312015-02-24 18:53:21 -0800642 public String getSystemServiceName(Class<?> serviceClass) {
643 throw new UnsupportedOperationException();
644 }
645
646 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800647 public int checkPermission(String permission, int pid, int uid) {
648 throw new UnsupportedOperationException();
649 }
650
Dianne Hackbornff170242014-11-19 10:59:01 -0800651 /** @hide */
652 @Override
653 public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
654 return checkPermission(permission, pid, uid);
655 }
656
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800657 @Override
658 public int checkCallingPermission(String permission) {
659 throw new UnsupportedOperationException();
660 }
661
662 @Override
663 public int checkCallingOrSelfPermission(String permission) {
664 throw new UnsupportedOperationException();
665 }
666
667 @Override
Svetoslavc6d1c342015-02-26 14:44:43 -0800668 public int checkSelfPermission(String permission) {
669 throw new UnsupportedOperationException();
670 }
671
672 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800673 public void enforcePermission(
674 String permission, int pid, int uid, String message) {
675 throw new UnsupportedOperationException();
676 }
677
678 @Override
679 public void enforceCallingPermission(String permission, String message) {
680 throw new UnsupportedOperationException();
681 }
682
683 @Override
684 public void enforceCallingOrSelfPermission(String permission, String message) {
685 throw new UnsupportedOperationException();
686 }
687
688 @Override
689 public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
690 throw new UnsupportedOperationException();
691 }
692
693 @Override
694 public void revokeUriPermission(Uri uri, int modeFlags) {
695 throw new UnsupportedOperationException();
696 }
697
698 @Override
Dianne Hackborna47223f2017-03-30 13:49:13 -0700699 public void revokeUriPermission(String targetPackage, Uri uri, int modeFlags) {
700 throw new UnsupportedOperationException();
701 }
702
703 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800704 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
705 throw new UnsupportedOperationException();
706 }
707
Dianne Hackbornff170242014-11-19 10:59:01 -0800708 /** @hide */
709 @Override
710 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
711 return checkUriPermission(uri, pid, uid, modeFlags);
712 }
713
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800714 @Override
715 public int checkCallingUriPermission(Uri uri, int modeFlags) {
716 throw new UnsupportedOperationException();
717 }
718
719 @Override
720 public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
721 throw new UnsupportedOperationException();
722 }
723
724 @Override
725 public int checkUriPermission(Uri uri, String readPermission,
726 String writePermission, int pid, int uid, int modeFlags) {
727 throw new UnsupportedOperationException();
728 }
729
730 @Override
731 public void enforceUriPermission(
732 Uri uri, int pid, int uid, int modeFlags, String message) {
733 throw new UnsupportedOperationException();
734 }
735
736 @Override
737 public void enforceCallingUriPermission(
738 Uri uri, int modeFlags, String message) {
739 throw new UnsupportedOperationException();
740 }
741
742 @Override
743 public void enforceCallingOrSelfUriPermission(
744 Uri uri, int modeFlags, String message) {
745 throw new UnsupportedOperationException();
746 }
747
748 public void enforceUriPermission(
749 Uri uri, String readPermission, String writePermission,
750 int pid, int uid, int modeFlags, String message) {
751 throw new UnsupportedOperationException();
752 }
753
754 @Override
755 public Context createPackageContext(String packageName, int flags)
756 throws PackageManager.NameNotFoundException {
757 throw new UnsupportedOperationException();
758 }
Romain Guy870e09f2009-07-06 16:35:25 -0700759
Jeff Sharkey6d515712012-09-20 16:06:08 -0700760 /** {@hide} */
761 @Override
Svetoslav976e8bd2014-07-16 15:12:03 -0700762 public Context createApplicationContext(ApplicationInfo application, int flags)
763 throws PackageManager.NameNotFoundException {
764 return null;
765 }
766
Adam Lesinski4e862812016-11-21 16:02:24 -0800767 /** @hide */
768 @Override
769 public Context createContextForSplit(String splitName)
770 throws PackageManager.NameNotFoundException {
771 throw new UnsupportedOperationException();
772 }
773
Svetoslav976e8bd2014-07-16 15:12:03 -0700774 /** {@hide} */
775 @Override
Jeff Sharkey6d515712012-09-20 16:06:08 -0700776 public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
777 throws PackageManager.NameNotFoundException {
778 throw new UnsupportedOperationException();
779 }
780
Jim Millera75a8832013-02-07 16:53:32 -0800781 /** {@hide} */
782 @Override
Makoto Onuki6b1e9d22019-10-11 20:19:58 -0700783 public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) {
Makoto Onuki9432f7d2019-10-09 15:33:11 -0700784 throw new UnsupportedOperationException();
785 }
786
787 /** {@hide} */
788 @Override
Jim Millera75a8832013-02-07 16:53:32 -0800789 public int getUserId() {
790 throw new UnsupportedOperationException();
791 }
792
Romain Guy870e09f2009-07-06 16:35:25 -0700793 @Override
Dianne Hackborn756220b2012-08-14 16:45:30 -0700794 public Context createConfigurationContext(Configuration overrideConfiguration) {
795 throw new UnsupportedOperationException();
796 }
797
798 @Override
Jeff Browna492c3a2012-08-23 19:48:44 -0700799 public Context createDisplayContext(Display display) {
800 throw new UnsupportedOperationException();
801 }
802
803 @Override
Romain Guy870e09f2009-07-06 16:35:25 -0700804 public boolean isRestricted() {
Svetoslav976e8bd2014-07-16 15:12:03 -0700805 throw new UnsupportedOperationException();
Romain Guy870e09f2009-07-06 16:35:25 -0700806 }
Jeff Brown98365d72012-08-19 20:30:52 -0700807
808 /** @hide */
809 @Override
Craig Mautner48d0d182013-06-11 07:53:06 -0700810 public DisplayAdjustments getDisplayAdjustments(int displayId) {
Jeff Brown98365d72012-08-19 20:30:52 -0700811 throw new UnsupportedOperationException();
812 }
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700813
Adam Lesinski4ece3d62016-06-16 18:05:41 -0700814 /** @hide */
815 @Override
816 public Display getDisplay() {
817 throw new UnsupportedOperationException();
818 }
819
Andrii Kulianb047b8b2017-02-08 18:38:26 -0800820 /** @hide */
821 @Override
Yohei Yukawa5281b6b2018-10-15 07:38:25 +0800822 public int getDisplayId() {
823 throw new UnsupportedOperationException();
824 }
825
826 /** @hide */
827 @Override
Andrii Kulianb047b8b2017-02-08 18:38:26 -0800828 public void updateDisplay(int displayId) {
829 throw new UnsupportedOperationException();
830 }
831
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700832 @Override
833 public File[] getExternalFilesDirs(String type) {
834 throw new UnsupportedOperationException();
835 }
836
837 @Override
838 public File[] getObbDirs() {
839 throw new UnsupportedOperationException();
840 }
841
842 @Override
843 public File[] getExternalCacheDirs() {
844 throw new UnsupportedOperationException();
845 }
Jeff Sharkey2ee3c1e2014-05-30 15:38:35 -0700846
847 @Override
848 public File[] getExternalMediaDirs() {
849 throw new UnsupportedOperationException();
850 }
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700851
Fyodor Kupolov61221292016-09-02 15:21:03 -0700852 /** @hide **/
853 @Override
854 public File getPreloadsFileCache() { throw new UnsupportedOperationException(); }
855
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700856 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600857 public Context createDeviceProtectedStorageContext() {
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700858 throw new UnsupportedOperationException();
859 }
860
861 /** {@hide} */
862 @SystemApi
863 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600864 public Context createCredentialProtectedStorageContext() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700865 throw new UnsupportedOperationException();
866 }
867
868 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600869 public boolean isDeviceProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700870 throw new UnsupportedOperationException();
871 }
872
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700873 /** {@hide} */
874 @SystemApi
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700875 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600876 public boolean isCredentialProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700877 throw new UnsupportedOperationException();
878 }
Tony Mak46aabe52016-11-14 12:53:06 +0000879
880 /** {@hide} */
881 @Override
Seigo Nonaka6d6cd682017-06-22 08:22:18 -0700882 public boolean canLoadUnsafeResources() {
883 throw new UnsupportedOperationException();
884 }
885
886 /** {@hide} */
887 @Override
Tony Mak46aabe52016-11-14 12:53:06 +0000888 public IBinder getActivityToken() {
889 throw new UnsupportedOperationException();
890 }
891
892 /** {@hide} */
893 @Override
894 public IServiceConnection getServiceDispatcher(ServiceConnection conn, Handler handler,
895 int flags) {
896 throw new UnsupportedOperationException();
897 }
898
899 /** {@hide} */
900 @Override
901 public IApplicationThread getIApplicationThread() {
902 throw new UnsupportedOperationException();
903 }
Tony Makbf9928d2016-12-22 11:02:45 +0000904
905 /** {@hide} */
906 @Override
907 public Handler getMainThreadHandler() {
908 throw new UnsupportedOperationException();
909 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800910}