blob: 24e7bff0979492a316366cc15e4eb86d9a635d29 [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;
Christopher Tate42a386b2016-11-07 12:21:21 -080022import android.app.Notification;
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;
28import android.content.BroadcastReceiver;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070029import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.ServiceConnection;
31import android.content.SharedPreferences;
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -070032import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033import android.content.pm.PackageManager;
34import android.content.res.AssetManager;
Dianne Hackborn756220b2012-08-14 16:45:30 -070035import android.content.res.Configuration;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036import android.content.res.Resources;
Vasu Nori74f170f2010-06-01 18:06:18 -070037import android.database.DatabaseErrorHandler;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038import android.database.sqlite.SQLiteDatabase;
39import android.graphics.Bitmap;
40import android.graphics.drawable.Drawable;
41import android.net.Uri;
42import android.os.Bundle;
43import android.os.Handler;
Dianne Hackbornff170242014-11-19 10:59:01 -080044import android.os.IBinder;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045import android.os.Looper;
Dianne Hackborn79af1dd2012-08-16 16:42:52 -070046import android.os.UserHandle;
Craig Mautner48d0d182013-06-11 07:53:06 -070047import android.view.DisplayAdjustments;
Jeff Browna492c3a2012-08-23 19:48:44 -070048import android.view.Display;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049
50import java.io.File;
51import java.io.FileInputStream;
52import java.io.FileNotFoundException;
53import java.io.FileOutputStream;
54import java.io.IOException;
55import java.io.InputStream;
56
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
90 public Context getApplicationContext() {
91 throw new UnsupportedOperationException();
92 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080093
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080094 @Override
95 public void setTheme(int resid) {
96 throw new UnsupportedOperationException();
97 }
98
99 @Override
100 public Resources.Theme getTheme() {
101 throw new UnsupportedOperationException();
102 }
103
104 @Override
105 public ClassLoader getClassLoader() {
106 throw new UnsupportedOperationException();
107 }
108
109 @Override
110 public String getPackageName() {
111 throw new UnsupportedOperationException();
112 }
113
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800114 /** @hide */
115 @Override
116 public String getBasePackageName() {
117 throw new UnsupportedOperationException();
118 }
119
Dianne Hackborn95d78532013-09-11 09:51:14 -0700120 /** @hide */
121 @Override
122 public String getOpPackageName() {
123 throw new UnsupportedOperationException();
124 }
125
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800126 @Override
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700127 public ApplicationInfo getApplicationInfo() {
128 throw new UnsupportedOperationException();
129 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800130
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700131 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800132 public String getPackageResourcePath() {
133 throw new UnsupportedOperationException();
134 }
135
Joe Onorato23ecae32009-06-10 17:07:15 -0700136 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 public String getPackageCodePath() {
138 throw new UnsupportedOperationException();
139 }
140
141 @Override
142 public SharedPreferences getSharedPreferences(String name, int mode) {
143 throw new UnsupportedOperationException();
144 }
145
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600146 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800147 @Override
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700148 public SharedPreferences getSharedPreferences(File file, int mode) {
149 throw new UnsupportedOperationException();
150 }
151
152 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600153 public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700154 throw new UnsupportedOperationException();
155 }
156
157 @Override
158 public boolean deleteSharedPreferences(String name) {
159 throw new UnsupportedOperationException();
160 }
161
162 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800163 public FileInputStream openFileInput(String name) throws FileNotFoundException {
164 throw new UnsupportedOperationException();
165 }
166
167 @Override
168 public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException {
169 throw new UnsupportedOperationException();
170 }
171
172 @Override
173 public boolean deleteFile(String name) {
174 throw new UnsupportedOperationException();
175 }
176
177 @Override
178 public File getFileStreamPath(String name) {
179 throw new UnsupportedOperationException();
180 }
181
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600182 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800183 @Override
Jeff Sharkey6a6cdafa2015-12-07 19:25:19 -0700184 public File getSharedPreferencesPath(String name) {
185 throw new UnsupportedOperationException();
186 }
187
188 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800189 public String[] fileList() {
190 throw new UnsupportedOperationException();
191 }
192
193 @Override
Jeff Sharkey2c1ba9a2016-02-17 15:29:38 -0700194 public File getDataDir() {
195 throw new UnsupportedOperationException();
196 }
197
198 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800199 public File getFilesDir() {
200 throw new UnsupportedOperationException();
201 }
202
203 @Override
Christopher Tatea7835b62014-07-11 17:25:57 -0700204 public File getNoBackupFilesDir() {
205 throw new UnsupportedOperationException();
206 }
207
208 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800209 public File getExternalFilesDir(String type) {
210 throw new UnsupportedOperationException();
211 }
212
213 @Override
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800214 public File getObbDir() {
215 throw new UnsupportedOperationException();
216 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800217
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800218 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800219 public File getCacheDir() {
220 throw new UnsupportedOperationException();
221 }
222
223 @Override
Jeff Sharkey4ed745d2014-07-15 20:39:15 -0700224 public File getCodeCacheDir() {
225 throw new UnsupportedOperationException();
226 }
227
228 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800229 public File getExternalCacheDir() {
230 throw new UnsupportedOperationException();
231 }
232
233 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800234 public File getDir(String name, int mode) {
235 throw new UnsupportedOperationException();
236 }
237
238 @Override
Stephan Linznerb51617f2016-01-27 18:09:50 -0800239 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800240 SQLiteDatabase.CursorFactory factory) {
241 throw new UnsupportedOperationException();
242 }
243
244 @Override
Vasu Nori74f170f2010-06-01 18:06:18 -0700245 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
246 SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) {
247 throw new UnsupportedOperationException();
248 }
249
250 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800251 public File getDatabasePath(String name) {
252 throw new UnsupportedOperationException();
253 }
254
255 @Override
256 public String[] databaseList() {
257 throw new UnsupportedOperationException();
258 }
259
260 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600261 public boolean moveDatabaseFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700262 throw new UnsupportedOperationException();
263 }
264
265 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800266 public boolean deleteDatabase(String name) {
267 throw new UnsupportedOperationException();
268 }
269
270 @Override
271 public Drawable getWallpaper() {
272 throw new UnsupportedOperationException();
273 }
274
275 @Override
276 public Drawable peekWallpaper() {
277 throw new UnsupportedOperationException();
278 }
279
280 @Override
281 public int getWallpaperDesiredMinimumWidth() {
282 throw new UnsupportedOperationException();
283 }
284
285 @Override
286 public int getWallpaperDesiredMinimumHeight() {
287 throw new UnsupportedOperationException();
288 }
289
290 @Override
291 public void setWallpaper(Bitmap bitmap) throws IOException {
292 throw new UnsupportedOperationException();
293 }
294
295 @Override
296 public void setWallpaper(InputStream data) throws IOException {
297 throw new UnsupportedOperationException();
298 }
299
300 @Override
301 public void clearWallpaper() {
302 throw new UnsupportedOperationException();
303 }
304
305 @Override
306 public void startActivity(Intent intent) {
307 throw new UnsupportedOperationException();
308 }
309
310 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700311 public void startActivity(Intent intent, Bundle options) {
312 startActivity(intent);
313 }
314
315 @Override
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800316 public void startActivities(Intent[] intents) {
317 throw new UnsupportedOperationException();
318 }
319
320 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700321 public void startActivities(Intent[] intents, Bundle options) {
322 startActivities(intents);
323 }
324
325 @Override
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700326 public void startIntentSender(IntentSender intent,
327 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
328 throws IntentSender.SendIntentException {
329 throw new UnsupportedOperationException();
330 }
Dianne Hackborna4972e92012-03-14 10:38:05 -0700331
332 @Override
333 public void startIntentSender(IntentSender intent,
334 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags,
335 Bundle options) throws IntentSender.SendIntentException {
336 startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags);
337 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800338
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700339 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800340 public void sendBroadcast(Intent intent) {
341 throw new UnsupportedOperationException();
342 }
343
Amith Yamasani67cf7d32012-02-16 14:31:23 -0800344 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800345 public void sendBroadcast(Intent intent, String receiverPermission) {
346 throw new UnsupportedOperationException();
347 }
348
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800349 /** @hide */
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700350 @Override
351 public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) {
352 throw new UnsupportedOperationException();
353 }
354
355 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700356 @SystemApi
357 @Override
358 public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) {
359 throw new UnsupportedOperationException();
360 }
361
362 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800363 @Override
364 public void sendBroadcast(Intent intent, String receiverPermission, int appOp) {
365 throw new UnsupportedOperationException();
366 }
367
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800368 @Override
369 public void sendOrderedBroadcast(Intent intent,
370 String receiverPermission) {
371 throw new UnsupportedOperationException();
372 }
373
374 @Override
375 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
376 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
377 Bundle initialExtras) {
378 throw new UnsupportedOperationException();
379 }
380
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800381 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700382 @SystemApi
383 @Override
384 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
385 Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
386 Bundle initialExtras) {
387 throw new UnsupportedOperationException();
388 }
389
390 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800391 @Override
392 public void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp,
393 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
394 Bundle initialExtras) {
395 throw new UnsupportedOperationException();
396 }
397
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800398 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700399 public void sendBroadcastAsUser(Intent intent, UserHandle user) {
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700400 throw new UnsupportedOperationException();
401 }
402
403 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700404 public void sendBroadcastAsUser(Intent intent, UserHandle user,
405 String receiverPermission) {
406 throw new UnsupportedOperationException();
407 }
408
Svet Ganov16a16892015-04-16 10:32:04 -0700409 /** @hide */
Chad Brubaker52c8edc2016-07-25 14:30:26 -0700410 @SystemApi
411 @Override
412 public void sendBroadcastAsUser(Intent intent, UserHandle user,
413 String receiverPermission, Bundle options) {
414 throw new UnsupportedOperationException();
415 }
416
417 /** @hide */
Svet Ganov16a16892015-04-16 10:32:04 -0700418 @Override
419 public void sendBroadcastAsUser(Intent intent, UserHandle user,
420 String receiverPermission, int appOp) {
421 throw new UnsupportedOperationException();
422 }
423
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700424 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700425 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700426 String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700427 int initialCode, String initialData, Bundle initialExtras) {
428 throw new UnsupportedOperationException();
429 }
430
Amith Yamasani3cf75722014-05-16 12:37:29 -0700431 /** @hide */
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700432 @Override
Amith Yamasani3cf75722014-05-16 12:37:29 -0700433 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
434 String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
Dianne Hackbornfd854ee2015-07-13 18:00:37 -0700435 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
436 throw new UnsupportedOperationException();
437 }
438
439 /** @hide */
440 @Override
441 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
442 String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
443 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
Amith Yamasani3cf75722014-05-16 12:37:29 -0700444 throw new UnsupportedOperationException();
445 }
446
447 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800448 public void sendStickyBroadcast(Intent intent) {
449 throw new UnsupportedOperationException();
450 }
451
452 @Override
Dianne Hackbornefa199f2009-09-19 12:03:15 -0700453 public void sendStickyOrderedBroadcast(Intent intent,
454 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
455 Bundle initialExtras) {
456 throw new UnsupportedOperationException();
457 }
458
459 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800460 public void removeStickyBroadcast(Intent intent) {
461 throw new UnsupportedOperationException();
462 }
463
464 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700465 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
466 throw new UnsupportedOperationException();
467 }
468
Dianne Hackborne0e413e2015-12-09 17:22:26 -0800469 /** @hide */
470 @Override
471 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
472 throw new UnsupportedOperationException();
473 }
474
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700475 @Override
476 public void sendStickyOrderedBroadcastAsUser(Intent intent,
477 UserHandle user, BroadcastReceiver resultReceiver,
478 Handler scheduler, int initialCode, String initialData,
479 Bundle initialExtras) {
480 throw new UnsupportedOperationException();
481 }
482
483 @Override
484 public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
485 throw new UnsupportedOperationException();
486 }
487
488 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800489 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
490 throw new UnsupportedOperationException();
491 }
492
493 @Override
494 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
Chad Brubaker6d6015f652017-04-18 11:25:16 -0700495 int flags) {
Chad Brubaker816c83b2017-03-02 10:27:59 -0800496 throw new UnsupportedOperationException();
497 }
498
499 @Override
500 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800501 String broadcastPermission, Handler scheduler) {
502 throw new UnsupportedOperationException();
503 }
504
Chad Brubaker816c83b2017-03-02 10:27:59 -0800505 @Override
506 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
Chad Brubaker6d6015f652017-04-18 11:25:16 -0700507 String broadcastPermission, Handler scheduler, int flags) {
Chad Brubaker816c83b2017-03-02 10:27:59 -0800508 throw new UnsupportedOperationException();
509 }
510
Dianne Hackborn20e80982012-08-31 19:00:44 -0700511 /** @hide */
512 @Override
513 public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
514 IntentFilter filter, String broadcastPermission, Handler scheduler) {
515 throw new UnsupportedOperationException();
516 }
517
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800518 @Override
519 public void unregisterReceiver(BroadcastReceiver receiver) {
520 throw new UnsupportedOperationException();
521 }
522
523 @Override
524 public ComponentName startService(Intent service) {
525 throw new UnsupportedOperationException();
526 }
527
528 @Override
Christopher Tate08992ac2017-03-21 11:37:06 -0700529 public ComponentName startForegroundService(Intent service) {
530 throw new UnsupportedOperationException();
531 }
532
Christopher Tate42a386b2016-11-07 12:21:21 -0800533 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800534 public boolean stopService(Intent service) {
535 throw new UnsupportedOperationException();
536 }
537
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700538 /** @hide */
539 @Override
540 public ComponentName startServiceAsUser(Intent service, UserHandle user) {
541 throw new UnsupportedOperationException();
542 }
543
544 /** @hide */
545 @Override
Christopher Tate08992ac2017-03-21 11:37:06 -0700546 public ComponentName startForegroundServiceAsUser(Intent service, UserHandle user) {
547 throw new UnsupportedOperationException();
548 }
549
Christopher Tate42a386b2016-11-07 12:21:21 -0800550 /** @hide */
551 @Override
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700552 public boolean stopServiceAsUser(Intent service, UserHandle user) {
553 throw new UnsupportedOperationException();
554 }
555
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800556 @Override
557 public boolean bindService(Intent service, ServiceConnection conn, int flags) {
558 throw new UnsupportedOperationException();
559 }
560
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800561 /** @hide */
562 @Override
Amith Yamasani27b89e62013-01-16 12:30:11 -0800563 public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
564 UserHandle user) {
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800565 throw new UnsupportedOperationException();
566 }
567
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800568 @Override
569 public void unbindService(ServiceConnection conn) {
570 throw new UnsupportedOperationException();
571 }
572
573 @Override
574 public boolean startInstrumentation(ComponentName className,
575 String profileFile, Bundle arguments) {
576 throw new UnsupportedOperationException();
577 }
578
579 @Override
580 public Object getSystemService(String name) {
581 throw new UnsupportedOperationException();
582 }
583
584 @Override
Jeff Brown6e539312015-02-24 18:53:21 -0800585 public String getSystemServiceName(Class<?> serviceClass) {
586 throw new UnsupportedOperationException();
587 }
588
589 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800590 public int checkPermission(String permission, int pid, int uid) {
591 throw new UnsupportedOperationException();
592 }
593
Dianne Hackbornff170242014-11-19 10:59:01 -0800594 /** @hide */
595 @Override
596 public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
597 return checkPermission(permission, pid, uid);
598 }
599
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800600 @Override
601 public int checkCallingPermission(String permission) {
602 throw new UnsupportedOperationException();
603 }
604
605 @Override
606 public int checkCallingOrSelfPermission(String permission) {
607 throw new UnsupportedOperationException();
608 }
609
610 @Override
Svetoslavc6d1c342015-02-26 14:44:43 -0800611 public int checkSelfPermission(String permission) {
612 throw new UnsupportedOperationException();
613 }
614
615 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800616 public void enforcePermission(
617 String permission, int pid, int uid, String message) {
618 throw new UnsupportedOperationException();
619 }
620
621 @Override
622 public void enforceCallingPermission(String permission, String message) {
623 throw new UnsupportedOperationException();
624 }
625
626 @Override
627 public void enforceCallingOrSelfPermission(String permission, String message) {
628 throw new UnsupportedOperationException();
629 }
630
631 @Override
632 public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
633 throw new UnsupportedOperationException();
634 }
635
636 @Override
637 public void revokeUriPermission(Uri uri, int modeFlags) {
638 throw new UnsupportedOperationException();
639 }
640
641 @Override
Dianne Hackborna47223f2017-03-30 13:49:13 -0700642 public void revokeUriPermission(String targetPackage, Uri uri, int modeFlags) {
643 throw new UnsupportedOperationException();
644 }
645
646 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800647 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
648 throw new UnsupportedOperationException();
649 }
650
Dianne Hackbornff170242014-11-19 10:59:01 -0800651 /** @hide */
652 @Override
653 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
654 return checkUriPermission(uri, pid, uid, modeFlags);
655 }
656
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800657 @Override
658 public int checkCallingUriPermission(Uri uri, int modeFlags) {
659 throw new UnsupportedOperationException();
660 }
661
662 @Override
663 public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
664 throw new UnsupportedOperationException();
665 }
666
667 @Override
668 public int checkUriPermission(Uri uri, String readPermission,
669 String writePermission, int pid, int uid, int modeFlags) {
670 throw new UnsupportedOperationException();
671 }
672
673 @Override
674 public void enforceUriPermission(
675 Uri uri, int pid, int uid, int modeFlags, String message) {
676 throw new UnsupportedOperationException();
677 }
678
679 @Override
680 public void enforceCallingUriPermission(
681 Uri uri, int modeFlags, String message) {
682 throw new UnsupportedOperationException();
683 }
684
685 @Override
686 public void enforceCallingOrSelfUriPermission(
687 Uri uri, int modeFlags, String message) {
688 throw new UnsupportedOperationException();
689 }
690
691 public void enforceUriPermission(
692 Uri uri, String readPermission, String writePermission,
693 int pid, int uid, int modeFlags, String message) {
694 throw new UnsupportedOperationException();
695 }
696
697 @Override
698 public Context createPackageContext(String packageName, int flags)
699 throws PackageManager.NameNotFoundException {
700 throw new UnsupportedOperationException();
701 }
Romain Guy870e09f2009-07-06 16:35:25 -0700702
Jeff Sharkey6d515712012-09-20 16:06:08 -0700703 /** {@hide} */
704 @Override
Svetoslav976e8bd2014-07-16 15:12:03 -0700705 public Context createApplicationContext(ApplicationInfo application, int flags)
706 throws PackageManager.NameNotFoundException {
707 return null;
708 }
709
Adam Lesinski4e862812016-11-21 16:02:24 -0800710 /** @hide */
711 @Override
712 public Context createContextForSplit(String splitName)
713 throws PackageManager.NameNotFoundException {
714 throw new UnsupportedOperationException();
715 }
716
Svetoslav976e8bd2014-07-16 15:12:03 -0700717 /** {@hide} */
718 @Override
Jeff Sharkey6d515712012-09-20 16:06:08 -0700719 public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
720 throws PackageManager.NameNotFoundException {
721 throw new UnsupportedOperationException();
722 }
723
Jim Millera75a8832013-02-07 16:53:32 -0800724 /** {@hide} */
725 @Override
726 public int getUserId() {
727 throw new UnsupportedOperationException();
728 }
729
Romain Guy870e09f2009-07-06 16:35:25 -0700730 @Override
Dianne Hackborn756220b2012-08-14 16:45:30 -0700731 public Context createConfigurationContext(Configuration overrideConfiguration) {
732 throw new UnsupportedOperationException();
733 }
734
735 @Override
Jeff Browna492c3a2012-08-23 19:48:44 -0700736 public Context createDisplayContext(Display display) {
737 throw new UnsupportedOperationException();
738 }
739
740 @Override
Romain Guy870e09f2009-07-06 16:35:25 -0700741 public boolean isRestricted() {
Svetoslav976e8bd2014-07-16 15:12:03 -0700742 throw new UnsupportedOperationException();
Romain Guy870e09f2009-07-06 16:35:25 -0700743 }
Jeff Brown98365d72012-08-19 20:30:52 -0700744
745 /** @hide */
746 @Override
Craig Mautner48d0d182013-06-11 07:53:06 -0700747 public DisplayAdjustments getDisplayAdjustments(int displayId) {
Jeff Brown98365d72012-08-19 20:30:52 -0700748 throw new UnsupportedOperationException();
749 }
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700750
Adam Lesinski4ece3d62016-06-16 18:05:41 -0700751 /** @hide */
752 @Override
753 public Display getDisplay() {
754 throw new UnsupportedOperationException();
755 }
756
Andrii Kulianb047b8b2017-02-08 18:38:26 -0800757 /** @hide */
758 @Override
759 public void updateDisplay(int displayId) {
760 throw new UnsupportedOperationException();
761 }
762
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700763 @Override
764 public File[] getExternalFilesDirs(String type) {
765 throw new UnsupportedOperationException();
766 }
767
768 @Override
769 public File[] getObbDirs() {
770 throw new UnsupportedOperationException();
771 }
772
773 @Override
774 public File[] getExternalCacheDirs() {
775 throw new UnsupportedOperationException();
776 }
Jeff Sharkey2ee3c1e2014-05-30 15:38:35 -0700777
778 @Override
779 public File[] getExternalMediaDirs() {
780 throw new UnsupportedOperationException();
781 }
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700782
Fyodor Kupolov61221292016-09-02 15:21:03 -0700783 /** @hide **/
784 @Override
785 public File getPreloadsFileCache() { throw new UnsupportedOperationException(); }
786
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700787 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600788 public Context createDeviceProtectedStorageContext() {
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700789 throw new UnsupportedOperationException();
790 }
791
792 /** {@hide} */
793 @SystemApi
794 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600795 public Context createCredentialProtectedStorageContext() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700796 throw new UnsupportedOperationException();
797 }
798
799 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600800 public boolean isDeviceProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700801 throw new UnsupportedOperationException();
802 }
803
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700804 /** {@hide} */
805 @SystemApi
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700806 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600807 public boolean isCredentialProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700808 throw new UnsupportedOperationException();
809 }
Tony Mak46aabe52016-11-14 12:53:06 +0000810
811 /** {@hide} */
812 @Override
Seigo Nonaka80f6a982017-06-22 08:22:18 -0700813 public boolean canLoadUnsafeResources() {
814 throw new UnsupportedOperationException();
815 }
816
817 /** {@hide} */
818 @Override
Tony Mak46aabe52016-11-14 12:53:06 +0000819 public IBinder getActivityToken() {
820 throw new UnsupportedOperationException();
821 }
822
823 /** {@hide} */
824 @Override
825 public IServiceConnection getServiceDispatcher(ServiceConnection conn, Handler handler,
826 int flags) {
827 throw new UnsupportedOperationException();
828 }
829
830 /** {@hide} */
831 @Override
832 public IApplicationThread getIApplicationThread() {
833 throw new UnsupportedOperationException();
834 }
Tony Makbf9928d2016-12-22 11:02:45 +0000835
836 /** {@hide} */
837 @Override
838 public Handler getMainThreadHandler() {
839 throw new UnsupportedOperationException();
840 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800841}