blob: b739eadc8862beef47e52a667e8579bc4fe7031c [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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.content.ComponentName;
21import android.content.ContentResolver;
22import android.content.Context;
23import android.content.Intent;
24import android.content.IntentFilter;
25import android.content.BroadcastReceiver;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070026import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027import android.content.ServiceConnection;
28import android.content.SharedPreferences;
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -070029import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.pm.PackageManager;
31import android.content.res.AssetManager;
Dianne Hackborn756220b2012-08-14 16:45:30 -070032import android.content.res.Configuration;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033import android.content.res.Resources;
Vasu Nori74f170f2010-06-01 18:06:18 -070034import android.database.DatabaseErrorHandler;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.database.sqlite.SQLiteDatabase;
36import android.graphics.Bitmap;
37import android.graphics.drawable.Drawable;
38import android.net.Uri;
39import android.os.Bundle;
40import android.os.Handler;
Dianne Hackbornff170242014-11-19 10:59:01 -080041import android.os.IBinder;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.os.Looper;
Dianne Hackborn79af1dd2012-08-16 16:42:52 -070043import android.os.UserHandle;
Craig Mautner48d0d182013-06-11 07:53:06 -070044import android.view.DisplayAdjustments;
Jeff Browna492c3a2012-08-23 19:48:44 -070045import android.view.Display;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046
47import java.io.File;
48import java.io.FileInputStream;
49import java.io.FileNotFoundException;
50import java.io.FileOutputStream;
51import java.io.IOException;
52import java.io.InputStream;
53
54/**
Stephan Linznerb51617f2016-01-27 18:09:50 -080055 * A mock {@link android.content.Context} class. All methods are non-functional and throw
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056 * {@link java.lang.UnsupportedOperationException}. You can use this to inject other dependencies,
57 * mocks, or monitors into the classes you are testing.
Stephan Linznerb51617f2016-01-27 18:09:50 -080058 *
59 * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
60 * New tests should be written using the
61 * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062 */
Stephan Linznerb51617f2016-01-27 18:09:50 -080063@Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080064public class MockContext extends Context {
65
66 @Override
67 public AssetManager getAssets() {
68 throw new UnsupportedOperationException();
69 }
70
71 @Override
72 public Resources getResources() {
73 throw new UnsupportedOperationException();
74 }
75
76 @Override
77 public PackageManager getPackageManager() {
78 throw new UnsupportedOperationException();
79 }
80
81 @Override
82 public ContentResolver getContentResolver() {
83 throw new UnsupportedOperationException();
84 }
85
86 @Override
87 public Looper getMainLooper() {
88 throw new UnsupportedOperationException();
89 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080090
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080091 @Override
92 public Context getApplicationContext() {
93 throw new UnsupportedOperationException();
94 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080095
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096 @Override
97 public void setTheme(int resid) {
98 throw new UnsupportedOperationException();
99 }
100
101 @Override
102 public Resources.Theme getTheme() {
103 throw new UnsupportedOperationException();
104 }
105
106 @Override
107 public ClassLoader getClassLoader() {
108 throw new UnsupportedOperationException();
109 }
110
111 @Override
112 public String getPackageName() {
113 throw new UnsupportedOperationException();
114 }
115
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800116 /** @hide */
117 @Override
118 public String getBasePackageName() {
119 throw new UnsupportedOperationException();
120 }
121
Dianne Hackborn95d78532013-09-11 09:51:14 -0700122 /** @hide */
123 @Override
124 public String getOpPackageName() {
125 throw new UnsupportedOperationException();
126 }
127
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800128 @Override
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700129 public ApplicationInfo getApplicationInfo() {
130 throw new UnsupportedOperationException();
131 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800132
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700133 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134 public String getPackageResourcePath() {
135 throw new UnsupportedOperationException();
136 }
137
Joe Onorato23ecae32009-06-10 17:07:15 -0700138 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139 public String getPackageCodePath() {
140 throw new UnsupportedOperationException();
141 }
142
143 @Override
144 public SharedPreferences getSharedPreferences(String name, int mode) {
145 throw new UnsupportedOperationException();
146 }
147
148 @Override
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700149 public SharedPreferences getSharedPreferences(File file, int mode) {
150 throw new UnsupportedOperationException();
151 }
152
153 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600154 public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700155 throw new UnsupportedOperationException();
156 }
157
158 @Override
159 public boolean deleteSharedPreferences(String name) {
160 throw new UnsupportedOperationException();
161 }
162
163 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800164 public FileInputStream openFileInput(String name) throws FileNotFoundException {
165 throw new UnsupportedOperationException();
166 }
167
168 @Override
169 public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException {
170 throw new UnsupportedOperationException();
171 }
172
173 @Override
174 public boolean deleteFile(String name) {
175 throw new UnsupportedOperationException();
176 }
177
178 @Override
179 public File getFileStreamPath(String name) {
180 throw new UnsupportedOperationException();
181 }
182
183 @Override
Jeff Sharkey6a6cdaf2015-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 */
410 @Override
411 public void sendBroadcastAsUser(Intent intent, UserHandle user,
412 String receiverPermission, int appOp) {
413 throw new UnsupportedOperationException();
414 }
415
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700416 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700417 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700418 String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700419 int initialCode, String initialData, Bundle initialExtras) {
420 throw new UnsupportedOperationException();
421 }
422
Amith Yamasani3cf75722014-05-16 12:37:29 -0700423 /** @hide */
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700424 @Override
Amith Yamasani3cf75722014-05-16 12:37:29 -0700425 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
426 String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
Dianne Hackbornfd854ee2015-07-13 18:00:37 -0700427 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
428 throw new UnsupportedOperationException();
429 }
430
431 /** @hide */
432 @Override
433 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
434 String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
435 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
Amith Yamasani3cf75722014-05-16 12:37:29 -0700436 throw new UnsupportedOperationException();
437 }
438
439 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800440 public void sendStickyBroadcast(Intent intent) {
441 throw new UnsupportedOperationException();
442 }
443
444 @Override
Dianne Hackbornefa199f2009-09-19 12:03:15 -0700445 public void sendStickyOrderedBroadcast(Intent intent,
446 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
447 Bundle initialExtras) {
448 throw new UnsupportedOperationException();
449 }
450
451 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800452 public void removeStickyBroadcast(Intent intent) {
453 throw new UnsupportedOperationException();
454 }
455
456 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700457 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
458 throw new UnsupportedOperationException();
459 }
460
Dianne Hackborne0e413e2015-12-09 17:22:26 -0800461 /** @hide */
462 @Override
463 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
464 throw new UnsupportedOperationException();
465 }
466
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700467 @Override
468 public void sendStickyOrderedBroadcastAsUser(Intent intent,
469 UserHandle user, BroadcastReceiver resultReceiver,
470 Handler scheduler, int initialCode, String initialData,
471 Bundle initialExtras) {
472 throw new UnsupportedOperationException();
473 }
474
475 @Override
476 public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
477 throw new UnsupportedOperationException();
478 }
479
480 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800481 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
482 throw new UnsupportedOperationException();
483 }
484
485 @Override
486 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
487 String broadcastPermission, Handler scheduler) {
488 throw new UnsupportedOperationException();
489 }
490
Dianne Hackborn20e80982012-08-31 19:00:44 -0700491 /** @hide */
492 @Override
493 public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
494 IntentFilter filter, String broadcastPermission, Handler scheduler) {
495 throw new UnsupportedOperationException();
496 }
497
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800498 @Override
499 public void unregisterReceiver(BroadcastReceiver receiver) {
500 throw new UnsupportedOperationException();
501 }
502
503 @Override
504 public ComponentName startService(Intent service) {
505 throw new UnsupportedOperationException();
506 }
507
508 @Override
509 public boolean stopService(Intent service) {
510 throw new UnsupportedOperationException();
511 }
512
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700513 /** @hide */
514 @Override
515 public ComponentName startServiceAsUser(Intent service, UserHandle user) {
516 throw new UnsupportedOperationException();
517 }
518
519 /** @hide */
520 @Override
521 public boolean stopServiceAsUser(Intent service, UserHandle user) {
522 throw new UnsupportedOperationException();
523 }
524
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800525 @Override
526 public boolean bindService(Intent service, ServiceConnection conn, int flags) {
527 throw new UnsupportedOperationException();
528 }
529
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800530 /** @hide */
531 @Override
Amith Yamasani27b89e62013-01-16 12:30:11 -0800532 public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
533 UserHandle user) {
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800534 throw new UnsupportedOperationException();
535 }
536
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800537 @Override
538 public void unbindService(ServiceConnection conn) {
539 throw new UnsupportedOperationException();
540 }
541
542 @Override
543 public boolean startInstrumentation(ComponentName className,
544 String profileFile, Bundle arguments) {
545 throw new UnsupportedOperationException();
546 }
547
548 @Override
549 public Object getSystemService(String name) {
550 throw new UnsupportedOperationException();
551 }
552
553 @Override
Jeff Brown6e539312015-02-24 18:53:21 -0800554 public String getSystemServiceName(Class<?> serviceClass) {
555 throw new UnsupportedOperationException();
556 }
557
558 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800559 public int checkPermission(String permission, int pid, int uid) {
560 throw new UnsupportedOperationException();
561 }
562
Dianne Hackbornff170242014-11-19 10:59:01 -0800563 /** @hide */
564 @Override
565 public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
566 return checkPermission(permission, pid, uid);
567 }
568
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800569 @Override
570 public int checkCallingPermission(String permission) {
571 throw new UnsupportedOperationException();
572 }
573
574 @Override
575 public int checkCallingOrSelfPermission(String permission) {
576 throw new UnsupportedOperationException();
577 }
578
579 @Override
Svetoslavc6d1c342015-02-26 14:44:43 -0800580 public int checkSelfPermission(String permission) {
581 throw new UnsupportedOperationException();
582 }
583
584 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800585 public void enforcePermission(
586 String permission, int pid, int uid, String message) {
587 throw new UnsupportedOperationException();
588 }
589
590 @Override
591 public void enforceCallingPermission(String permission, String message) {
592 throw new UnsupportedOperationException();
593 }
594
595 @Override
596 public void enforceCallingOrSelfPermission(String permission, String message) {
597 throw new UnsupportedOperationException();
598 }
599
600 @Override
601 public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
602 throw new UnsupportedOperationException();
603 }
604
605 @Override
606 public void revokeUriPermission(Uri uri, int modeFlags) {
607 throw new UnsupportedOperationException();
608 }
609
610 @Override
611 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
612 throw new UnsupportedOperationException();
613 }
614
Dianne Hackbornff170242014-11-19 10:59:01 -0800615 /** @hide */
616 @Override
617 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
618 return checkUriPermission(uri, pid, uid, modeFlags);
619 }
620
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800621 @Override
622 public int checkCallingUriPermission(Uri uri, int modeFlags) {
623 throw new UnsupportedOperationException();
624 }
625
626 @Override
627 public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
628 throw new UnsupportedOperationException();
629 }
630
631 @Override
632 public int checkUriPermission(Uri uri, String readPermission,
633 String writePermission, int pid, int uid, int modeFlags) {
634 throw new UnsupportedOperationException();
635 }
636
637 @Override
638 public void enforceUriPermission(
639 Uri uri, int pid, int uid, int modeFlags, String message) {
640 throw new UnsupportedOperationException();
641 }
642
643 @Override
644 public void enforceCallingUriPermission(
645 Uri uri, int modeFlags, String message) {
646 throw new UnsupportedOperationException();
647 }
648
649 @Override
650 public void enforceCallingOrSelfUriPermission(
651 Uri uri, int modeFlags, String message) {
652 throw new UnsupportedOperationException();
653 }
654
655 public void enforceUriPermission(
656 Uri uri, String readPermission, String writePermission,
657 int pid, int uid, int modeFlags, String message) {
658 throw new UnsupportedOperationException();
659 }
660
661 @Override
662 public Context createPackageContext(String packageName, int flags)
663 throws PackageManager.NameNotFoundException {
664 throw new UnsupportedOperationException();
665 }
Romain Guy870e09f2009-07-06 16:35:25 -0700666
Jeff Sharkey6d515712012-09-20 16:06:08 -0700667 /** {@hide} */
668 @Override
Svetoslav976e8bd2014-07-16 15:12:03 -0700669 public Context createApplicationContext(ApplicationInfo application, int flags)
670 throws PackageManager.NameNotFoundException {
671 return null;
672 }
673
674 /** {@hide} */
675 @Override
Jeff Sharkey6d515712012-09-20 16:06:08 -0700676 public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
677 throws PackageManager.NameNotFoundException {
678 throw new UnsupportedOperationException();
679 }
680
Jim Millera75a8832013-02-07 16:53:32 -0800681 /** {@hide} */
682 @Override
683 public int getUserId() {
684 throw new UnsupportedOperationException();
685 }
686
Romain Guy870e09f2009-07-06 16:35:25 -0700687 @Override
Dianne Hackborn756220b2012-08-14 16:45:30 -0700688 public Context createConfigurationContext(Configuration overrideConfiguration) {
689 throw new UnsupportedOperationException();
690 }
691
692 @Override
Jeff Browna492c3a2012-08-23 19:48:44 -0700693 public Context createDisplayContext(Display display) {
694 throw new UnsupportedOperationException();
695 }
696
697 @Override
Romain Guy870e09f2009-07-06 16:35:25 -0700698 public boolean isRestricted() {
Svetoslav976e8bd2014-07-16 15:12:03 -0700699 throw new UnsupportedOperationException();
Romain Guy870e09f2009-07-06 16:35:25 -0700700 }
Jeff Brown98365d72012-08-19 20:30:52 -0700701
702 /** @hide */
703 @Override
Craig Mautner48d0d182013-06-11 07:53:06 -0700704 public DisplayAdjustments getDisplayAdjustments(int displayId) {
Jeff Brown98365d72012-08-19 20:30:52 -0700705 throw new UnsupportedOperationException();
706 }
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700707
708 @Override
709 public File[] getExternalFilesDirs(String type) {
710 throw new UnsupportedOperationException();
711 }
712
713 @Override
714 public File[] getObbDirs() {
715 throw new UnsupportedOperationException();
716 }
717
718 @Override
719 public File[] getExternalCacheDirs() {
720 throw new UnsupportedOperationException();
721 }
Jeff Sharkey2ee3c1e2014-05-30 15:38:35 -0700722
723 @Override
724 public File[] getExternalMediaDirs() {
725 throw new UnsupportedOperationException();
726 }
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700727
728 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600729 public Context createDeviceProtectedStorageContext() {
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700730 throw new UnsupportedOperationException();
731 }
732
733 /** {@hide} */
734 @SystemApi
735 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600736 public Context createCredentialProtectedStorageContext() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700737 throw new UnsupportedOperationException();
738 }
739
740 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600741 public boolean isDeviceProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700742 throw new UnsupportedOperationException();
743 }
744
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700745 /** {@hide} */
746 @SystemApi
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700747 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600748 public boolean isCredentialProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700749 throw new UnsupportedOperationException();
750 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800751}