blob: b14fc41632b3e9af02b261f11a89901eee36d5f4 [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.
58 */
59public class MockContext extends Context {
60
61 @Override
62 public AssetManager getAssets() {
63 throw new UnsupportedOperationException();
64 }
65
66 @Override
67 public Resources getResources() {
68 throw new UnsupportedOperationException();
69 }
70
71 @Override
72 public PackageManager getPackageManager() {
73 throw new UnsupportedOperationException();
74 }
75
76 @Override
77 public ContentResolver getContentResolver() {
78 throw new UnsupportedOperationException();
79 }
80
81 @Override
82 public Looper getMainLooper() {
83 throw new UnsupportedOperationException();
84 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080085
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080086 @Override
87 public Context getApplicationContext() {
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 void setTheme(int resid) {
93 throw new UnsupportedOperationException();
94 }
95
96 @Override
97 public Resources.Theme getTheme() {
98 throw new UnsupportedOperationException();
99 }
100
101 @Override
102 public ClassLoader getClassLoader() {
103 throw new UnsupportedOperationException();
104 }
105
106 @Override
107 public String getPackageName() {
108 throw new UnsupportedOperationException();
109 }
110
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800111 /** @hide */
112 @Override
113 public String getBasePackageName() {
114 throw new UnsupportedOperationException();
115 }
116
Dianne Hackborn95d78532013-09-11 09:51:14 -0700117 /** @hide */
118 @Override
119 public String getOpPackageName() {
120 throw new UnsupportedOperationException();
121 }
122
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800123 @Override
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700124 public ApplicationInfo getApplicationInfo() {
125 throw new UnsupportedOperationException();
126 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800127
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700128 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800129 public String getPackageResourcePath() {
130 throw new UnsupportedOperationException();
131 }
132
Joe Onorato23ecae32009-06-10 17:07:15 -0700133 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134 public String getPackageCodePath() {
135 throw new UnsupportedOperationException();
136 }
137
138 @Override
139 public SharedPreferences getSharedPreferences(String name, int mode) {
140 throw new UnsupportedOperationException();
141 }
142
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600143 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800144 @Override
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700145 public SharedPreferences getSharedPreferences(File file, int mode) {
146 throw new UnsupportedOperationException();
147 }
148
149 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600150 public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700151 throw new UnsupportedOperationException();
152 }
153
154 @Override
155 public boolean deleteSharedPreferences(String name) {
156 throw new UnsupportedOperationException();
157 }
158
159 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800160 public FileInputStream openFileInput(String name) throws FileNotFoundException {
161 throw new UnsupportedOperationException();
162 }
163
164 @Override
165 public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException {
166 throw new UnsupportedOperationException();
167 }
168
169 @Override
170 public boolean deleteFile(String name) {
171 throw new UnsupportedOperationException();
172 }
173
174 @Override
175 public File getFileStreamPath(String name) {
176 throw new UnsupportedOperationException();
177 }
178
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600179 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800180 @Override
Jeff Sharkey6a6cdafa2015-12-07 19:25:19 -0700181 public File getSharedPreferencesPath(String name) {
182 throw new UnsupportedOperationException();
183 }
184
185 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800186 public String[] fileList() {
187 throw new UnsupportedOperationException();
188 }
189
190 @Override
Jeff Sharkey2c1ba9a2016-02-17 15:29:38 -0700191 public File getDataDir() {
192 throw new UnsupportedOperationException();
193 }
194
195 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800196 public File getFilesDir() {
197 throw new UnsupportedOperationException();
198 }
199
200 @Override
Christopher Tatea7835b62014-07-11 17:25:57 -0700201 public File getNoBackupFilesDir() {
202 throw new UnsupportedOperationException();
203 }
204
205 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800206 public File getExternalFilesDir(String type) {
207 throw new UnsupportedOperationException();
208 }
209
210 @Override
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800211 public File getObbDir() {
212 throw new UnsupportedOperationException();
213 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800214
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800215 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800216 public File getCacheDir() {
217 throw new UnsupportedOperationException();
218 }
219
220 @Override
Jeff Sharkey4ed745d2014-07-15 20:39:15 -0700221 public File getCodeCacheDir() {
222 throw new UnsupportedOperationException();
223 }
224
225 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800226 public File getExternalCacheDir() {
227 throw new UnsupportedOperationException();
228 }
229
230 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800231 public File getDir(String name, int mode) {
232 throw new UnsupportedOperationException();
233 }
234
235 @Override
Stephan Linznerb51617f2016-01-27 18:09:50 -0800236 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800237 SQLiteDatabase.CursorFactory factory) {
238 throw new UnsupportedOperationException();
239 }
240
241 @Override
Vasu Nori74f170f2010-06-01 18:06:18 -0700242 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
243 SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) {
244 throw new UnsupportedOperationException();
245 }
246
247 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800248 public File getDatabasePath(String name) {
249 throw new UnsupportedOperationException();
250 }
251
252 @Override
253 public String[] databaseList() {
254 throw new UnsupportedOperationException();
255 }
256
257 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600258 public boolean moveDatabaseFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700259 throw new UnsupportedOperationException();
260 }
261
262 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800263 public boolean deleteDatabase(String name) {
264 throw new UnsupportedOperationException();
265 }
266
267 @Override
268 public Drawable getWallpaper() {
269 throw new UnsupportedOperationException();
270 }
271
272 @Override
273 public Drawable peekWallpaper() {
274 throw new UnsupportedOperationException();
275 }
276
277 @Override
278 public int getWallpaperDesiredMinimumWidth() {
279 throw new UnsupportedOperationException();
280 }
281
282 @Override
283 public int getWallpaperDesiredMinimumHeight() {
284 throw new UnsupportedOperationException();
285 }
286
287 @Override
288 public void setWallpaper(Bitmap bitmap) throws IOException {
289 throw new UnsupportedOperationException();
290 }
291
292 @Override
293 public void setWallpaper(InputStream data) throws IOException {
294 throw new UnsupportedOperationException();
295 }
296
297 @Override
298 public void clearWallpaper() {
299 throw new UnsupportedOperationException();
300 }
301
302 @Override
303 public void startActivity(Intent intent) {
304 throw new UnsupportedOperationException();
305 }
306
307 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700308 public void startActivity(Intent intent, Bundle options) {
309 startActivity(intent);
310 }
311
312 @Override
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800313 public void startActivities(Intent[] intents) {
314 throw new UnsupportedOperationException();
315 }
316
317 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700318 public void startActivities(Intent[] intents, Bundle options) {
319 startActivities(intents);
320 }
321
322 @Override
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700323 public void startIntentSender(IntentSender intent,
324 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
325 throws IntentSender.SendIntentException {
326 throw new UnsupportedOperationException();
327 }
Dianne Hackborna4972e92012-03-14 10:38:05 -0700328
329 @Override
330 public void startIntentSender(IntentSender intent,
331 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags,
332 Bundle options) throws IntentSender.SendIntentException {
333 startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags);
334 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800335
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700336 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800337 public void sendBroadcast(Intent intent) {
338 throw new UnsupportedOperationException();
339 }
340
Amith Yamasani67cf7d32012-02-16 14:31:23 -0800341 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800342 public void sendBroadcast(Intent intent, String receiverPermission) {
343 throw new UnsupportedOperationException();
344 }
345
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800346 /** @hide */
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700347 @Override
348 public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) {
349 throw new UnsupportedOperationException();
350 }
351
352 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700353 @SystemApi
354 @Override
355 public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) {
356 throw new UnsupportedOperationException();
357 }
358
359 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800360 @Override
361 public void sendBroadcast(Intent intent, String receiverPermission, int appOp) {
362 throw new UnsupportedOperationException();
363 }
364
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800365 @Override
366 public void sendOrderedBroadcast(Intent intent,
367 String receiverPermission) {
368 throw new UnsupportedOperationException();
369 }
370
371 @Override
372 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
373 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
374 Bundle initialExtras) {
375 throw new UnsupportedOperationException();
376 }
377
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800378 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700379 @SystemApi
380 @Override
381 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
382 Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
383 Bundle initialExtras) {
384 throw new UnsupportedOperationException();
385 }
386
387 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800388 @Override
389 public void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp,
390 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
391 Bundle initialExtras) {
392 throw new UnsupportedOperationException();
393 }
394
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800395 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700396 public void sendBroadcastAsUser(Intent intent, UserHandle user) {
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700397 throw new UnsupportedOperationException();
398 }
399
400 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700401 public void sendBroadcastAsUser(Intent intent, UserHandle user,
402 String receiverPermission) {
403 throw new UnsupportedOperationException();
404 }
405
Svet Ganov16a16892015-04-16 10:32:04 -0700406 /** @hide */
407 @Override
408 public void sendBroadcastAsUser(Intent intent, UserHandle user,
409 String receiverPermission, int appOp) {
410 throw new UnsupportedOperationException();
411 }
412
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700413 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700414 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700415 String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700416 int initialCode, String initialData, Bundle initialExtras) {
417 throw new UnsupportedOperationException();
418 }
419
Amith Yamasani3cf75722014-05-16 12:37:29 -0700420 /** @hide */
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700421 @Override
Amith Yamasani3cf75722014-05-16 12:37:29 -0700422 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
423 String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
Dianne Hackbornfd854ee2015-07-13 18:00:37 -0700424 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
425 throw new UnsupportedOperationException();
426 }
427
428 /** @hide */
429 @Override
430 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
431 String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
432 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
Amith Yamasani3cf75722014-05-16 12:37:29 -0700433 throw new UnsupportedOperationException();
434 }
435
436 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800437 public void sendStickyBroadcast(Intent intent) {
438 throw new UnsupportedOperationException();
439 }
440
441 @Override
Dianne Hackbornefa199f2009-09-19 12:03:15 -0700442 public void sendStickyOrderedBroadcast(Intent intent,
443 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
444 Bundle initialExtras) {
445 throw new UnsupportedOperationException();
446 }
447
448 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800449 public void removeStickyBroadcast(Intent intent) {
450 throw new UnsupportedOperationException();
451 }
452
453 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700454 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
455 throw new UnsupportedOperationException();
456 }
457
Dianne Hackborne0e413e2015-12-09 17:22:26 -0800458 /** @hide */
459 @Override
460 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
461 throw new UnsupportedOperationException();
462 }
463
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700464 @Override
465 public void sendStickyOrderedBroadcastAsUser(Intent intent,
466 UserHandle user, BroadcastReceiver resultReceiver,
467 Handler scheduler, int initialCode, String initialData,
468 Bundle initialExtras) {
469 throw new UnsupportedOperationException();
470 }
471
472 @Override
473 public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
474 throw new UnsupportedOperationException();
475 }
476
477 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800478 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
479 throw new UnsupportedOperationException();
480 }
481
482 @Override
483 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
484 String broadcastPermission, Handler scheduler) {
485 throw new UnsupportedOperationException();
486 }
487
Dianne Hackborn20e80982012-08-31 19:00:44 -0700488 /** @hide */
489 @Override
490 public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
491 IntentFilter filter, String broadcastPermission, Handler scheduler) {
492 throw new UnsupportedOperationException();
493 }
494
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800495 @Override
496 public void unregisterReceiver(BroadcastReceiver receiver) {
497 throw new UnsupportedOperationException();
498 }
499
500 @Override
501 public ComponentName startService(Intent service) {
502 throw new UnsupportedOperationException();
503 }
504
505 @Override
506 public boolean stopService(Intent service) {
507 throw new UnsupportedOperationException();
508 }
509
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700510 /** @hide */
511 @Override
512 public ComponentName startServiceAsUser(Intent service, UserHandle user) {
513 throw new UnsupportedOperationException();
514 }
515
516 /** @hide */
517 @Override
518 public boolean stopServiceAsUser(Intent service, UserHandle user) {
519 throw new UnsupportedOperationException();
520 }
521
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800522 @Override
523 public boolean bindService(Intent service, ServiceConnection conn, int flags) {
524 throw new UnsupportedOperationException();
525 }
526
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800527 /** @hide */
528 @Override
Amith Yamasani27b89e62013-01-16 12:30:11 -0800529 public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
530 UserHandle user) {
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800531 throw new UnsupportedOperationException();
532 }
533
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800534 @Override
535 public void unbindService(ServiceConnection conn) {
536 throw new UnsupportedOperationException();
537 }
538
539 @Override
540 public boolean startInstrumentation(ComponentName className,
541 String profileFile, Bundle arguments) {
542 throw new UnsupportedOperationException();
543 }
544
545 @Override
546 public Object getSystemService(String name) {
547 throw new UnsupportedOperationException();
548 }
549
550 @Override
Jeff Brown6e539312015-02-24 18:53:21 -0800551 public String getSystemServiceName(Class<?> serviceClass) {
552 throw new UnsupportedOperationException();
553 }
554
555 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800556 public int checkPermission(String permission, int pid, int uid) {
557 throw new UnsupportedOperationException();
558 }
559
Dianne Hackbornff170242014-11-19 10:59:01 -0800560 /** @hide */
561 @Override
562 public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
563 return checkPermission(permission, pid, uid);
564 }
565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800566 @Override
567 public int checkCallingPermission(String permission) {
568 throw new UnsupportedOperationException();
569 }
570
571 @Override
572 public int checkCallingOrSelfPermission(String permission) {
573 throw new UnsupportedOperationException();
574 }
575
576 @Override
Svetoslavc6d1c342015-02-26 14:44:43 -0800577 public int checkSelfPermission(String permission) {
578 throw new UnsupportedOperationException();
579 }
580
581 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800582 public void enforcePermission(
583 String permission, int pid, int uid, String message) {
584 throw new UnsupportedOperationException();
585 }
586
587 @Override
588 public void enforceCallingPermission(String permission, String message) {
589 throw new UnsupportedOperationException();
590 }
591
592 @Override
593 public void enforceCallingOrSelfPermission(String permission, String message) {
594 throw new UnsupportedOperationException();
595 }
596
597 @Override
598 public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
599 throw new UnsupportedOperationException();
600 }
601
602 @Override
603 public void revokeUriPermission(Uri uri, int modeFlags) {
604 throw new UnsupportedOperationException();
605 }
606
607 @Override
608 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
609 throw new UnsupportedOperationException();
610 }
611
Dianne Hackbornff170242014-11-19 10:59:01 -0800612 /** @hide */
613 @Override
614 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
615 return checkUriPermission(uri, pid, uid, modeFlags);
616 }
617
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800618 @Override
619 public int checkCallingUriPermission(Uri uri, int modeFlags) {
620 throw new UnsupportedOperationException();
621 }
622
623 @Override
624 public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
625 throw new UnsupportedOperationException();
626 }
627
628 @Override
629 public int checkUriPermission(Uri uri, String readPermission,
630 String writePermission, int pid, int uid, int modeFlags) {
631 throw new UnsupportedOperationException();
632 }
633
634 @Override
635 public void enforceUriPermission(
636 Uri uri, int pid, int uid, int modeFlags, String message) {
637 throw new UnsupportedOperationException();
638 }
639
640 @Override
641 public void enforceCallingUriPermission(
642 Uri uri, int modeFlags, String message) {
643 throw new UnsupportedOperationException();
644 }
645
646 @Override
647 public void enforceCallingOrSelfUriPermission(
648 Uri uri, int modeFlags, String message) {
649 throw new UnsupportedOperationException();
650 }
651
652 public void enforceUriPermission(
653 Uri uri, String readPermission, String writePermission,
654 int pid, int uid, int modeFlags, String message) {
655 throw new UnsupportedOperationException();
656 }
657
658 @Override
659 public Context createPackageContext(String packageName, int flags)
660 throws PackageManager.NameNotFoundException {
661 throw new UnsupportedOperationException();
662 }
Romain Guy870e09f2009-07-06 16:35:25 -0700663
Jeff Sharkey6d515712012-09-20 16:06:08 -0700664 /** {@hide} */
665 @Override
Svetoslav976e8bd2014-07-16 15:12:03 -0700666 public Context createApplicationContext(ApplicationInfo application, int flags)
667 throws PackageManager.NameNotFoundException {
668 return null;
669 }
670
671 /** {@hide} */
672 @Override
Jeff Sharkey6d515712012-09-20 16:06:08 -0700673 public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
674 throws PackageManager.NameNotFoundException {
675 throw new UnsupportedOperationException();
676 }
677
Jim Millera75a8832013-02-07 16:53:32 -0800678 /** {@hide} */
679 @Override
680 public int getUserId() {
681 throw new UnsupportedOperationException();
682 }
683
Romain Guy870e09f2009-07-06 16:35:25 -0700684 @Override
Dianne Hackborn756220b2012-08-14 16:45:30 -0700685 public Context createConfigurationContext(Configuration overrideConfiguration) {
686 throw new UnsupportedOperationException();
687 }
688
689 @Override
Jeff Browna492c3a2012-08-23 19:48:44 -0700690 public Context createDisplayContext(Display display) {
691 throw new UnsupportedOperationException();
692 }
693
694 @Override
Romain Guy870e09f2009-07-06 16:35:25 -0700695 public boolean isRestricted() {
Svetoslav976e8bd2014-07-16 15:12:03 -0700696 throw new UnsupportedOperationException();
Romain Guy870e09f2009-07-06 16:35:25 -0700697 }
Jeff Brown98365d72012-08-19 20:30:52 -0700698
699 /** @hide */
700 @Override
Craig Mautner48d0d182013-06-11 07:53:06 -0700701 public DisplayAdjustments getDisplayAdjustments(int displayId) {
Jeff Brown98365d72012-08-19 20:30:52 -0700702 throw new UnsupportedOperationException();
703 }
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700704
705 @Override
706 public File[] getExternalFilesDirs(String type) {
707 throw new UnsupportedOperationException();
708 }
709
710 @Override
711 public File[] getObbDirs() {
712 throw new UnsupportedOperationException();
713 }
714
715 @Override
716 public File[] getExternalCacheDirs() {
717 throw new UnsupportedOperationException();
718 }
Jeff Sharkey2ee3c1e2014-05-30 15:38:35 -0700719
720 @Override
721 public File[] getExternalMediaDirs() {
722 throw new UnsupportedOperationException();
723 }
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700724
725 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600726 public Context createDeviceProtectedStorageContext() {
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700727 throw new UnsupportedOperationException();
728 }
729
730 /** {@hide} */
731 @SystemApi
732 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600733 public Context createCredentialProtectedStorageContext() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700734 throw new UnsupportedOperationException();
735 }
736
737 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600738 public boolean isDeviceProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700739 throw new UnsupportedOperationException();
740 }
741
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700742 /** {@hide} */
743 @SystemApi
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700744 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600745 public boolean isCredentialProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700746 throw new UnsupportedOperationException();
747 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800748}