blob: c7cbf977d7d71855359abca97fde6cbb80ac122e [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
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600148 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800149 @Override
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700150 public SharedPreferences getSharedPreferences(File file, int mode) {
151 throw new UnsupportedOperationException();
152 }
153
154 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600155 public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700156 throw new UnsupportedOperationException();
157 }
158
159 @Override
160 public boolean deleteSharedPreferences(String name) {
161 throw new UnsupportedOperationException();
162 }
163
164 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800165 public FileInputStream openFileInput(String name) throws FileNotFoundException {
166 throw new UnsupportedOperationException();
167 }
168
169 @Override
170 public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException {
171 throw new UnsupportedOperationException();
172 }
173
174 @Override
175 public boolean deleteFile(String name) {
176 throw new UnsupportedOperationException();
177 }
178
179 @Override
180 public File getFileStreamPath(String name) {
181 throw new UnsupportedOperationException();
182 }
183
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600184 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800185 @Override
Jeff Sharkey6a6cdaf2015-12-07 19:25:19 -0700186 public File getSharedPreferencesPath(String name) {
187 throw new UnsupportedOperationException();
188 }
189
190 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800191 public String[] fileList() {
192 throw new UnsupportedOperationException();
193 }
194
195 @Override
Jeff Sharkey2c1ba9a2016-02-17 15:29:38 -0700196 public File getDataDir() {
197 throw new UnsupportedOperationException();
198 }
199
200 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800201 public File getFilesDir() {
202 throw new UnsupportedOperationException();
203 }
204
205 @Override
Christopher Tatea7835b62014-07-11 17:25:57 -0700206 public File getNoBackupFilesDir() {
207 throw new UnsupportedOperationException();
208 }
209
210 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800211 public File getExternalFilesDir(String type) {
212 throw new UnsupportedOperationException();
213 }
214
215 @Override
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800216 public File getObbDir() {
217 throw new UnsupportedOperationException();
218 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800219
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800220 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800221 public File getCacheDir() {
222 throw new UnsupportedOperationException();
223 }
224
225 @Override
Jeff Sharkey4ed745d2014-07-15 20:39:15 -0700226 public File getCodeCacheDir() {
227 throw new UnsupportedOperationException();
228 }
229
230 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800231 public File getExternalCacheDir() {
232 throw new UnsupportedOperationException();
233 }
234
235 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800236 public File getDir(String name, int mode) {
237 throw new UnsupportedOperationException();
238 }
239
240 @Override
Stephan Linznerb51617f2016-01-27 18:09:50 -0800241 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800242 SQLiteDatabase.CursorFactory factory) {
243 throw new UnsupportedOperationException();
244 }
245
246 @Override
Vasu Nori74f170f2010-06-01 18:06:18 -0700247 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
248 SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) {
249 throw new UnsupportedOperationException();
250 }
251
252 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800253 public File getDatabasePath(String name) {
254 throw new UnsupportedOperationException();
255 }
256
257 @Override
258 public String[] databaseList() {
259 throw new UnsupportedOperationException();
260 }
261
262 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600263 public boolean moveDatabaseFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700264 throw new UnsupportedOperationException();
265 }
266
267 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800268 public boolean deleteDatabase(String name) {
269 throw new UnsupportedOperationException();
270 }
271
272 @Override
273 public Drawable getWallpaper() {
274 throw new UnsupportedOperationException();
275 }
276
277 @Override
278 public Drawable peekWallpaper() {
279 throw new UnsupportedOperationException();
280 }
281
282 @Override
283 public int getWallpaperDesiredMinimumWidth() {
284 throw new UnsupportedOperationException();
285 }
286
287 @Override
288 public int getWallpaperDesiredMinimumHeight() {
289 throw new UnsupportedOperationException();
290 }
291
292 @Override
293 public void setWallpaper(Bitmap bitmap) throws IOException {
294 throw new UnsupportedOperationException();
295 }
296
297 @Override
298 public void setWallpaper(InputStream data) throws IOException {
299 throw new UnsupportedOperationException();
300 }
301
302 @Override
303 public void clearWallpaper() {
304 throw new UnsupportedOperationException();
305 }
306
307 @Override
308 public void startActivity(Intent intent) {
309 throw new UnsupportedOperationException();
310 }
311
312 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700313 public void startActivity(Intent intent, Bundle options) {
314 startActivity(intent);
315 }
316
317 @Override
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800318 public void startActivities(Intent[] intents) {
319 throw new UnsupportedOperationException();
320 }
321
322 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700323 public void startActivities(Intent[] intents, Bundle options) {
324 startActivities(intents);
325 }
326
327 @Override
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700328 public void startIntentSender(IntentSender intent,
329 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
330 throws IntentSender.SendIntentException {
331 throw new UnsupportedOperationException();
332 }
Dianne Hackborna4972e92012-03-14 10:38:05 -0700333
334 @Override
335 public void startIntentSender(IntentSender intent,
336 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags,
337 Bundle options) throws IntentSender.SendIntentException {
338 startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags);
339 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800340
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700341 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800342 public void sendBroadcast(Intent intent) {
343 throw new UnsupportedOperationException();
344 }
345
Amith Yamasani67cf7d32012-02-16 14:31:23 -0800346 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800347 public void sendBroadcast(Intent intent, String receiverPermission) {
348 throw new UnsupportedOperationException();
349 }
350
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800351 /** @hide */
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700352 @Override
353 public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) {
354 throw new UnsupportedOperationException();
355 }
356
357 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700358 @SystemApi
359 @Override
360 public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) {
361 throw new UnsupportedOperationException();
362 }
363
364 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800365 @Override
366 public void sendBroadcast(Intent intent, String receiverPermission, int appOp) {
367 throw new UnsupportedOperationException();
368 }
369
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800370 @Override
371 public void sendOrderedBroadcast(Intent intent,
372 String receiverPermission) {
373 throw new UnsupportedOperationException();
374 }
375
376 @Override
377 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
378 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
379 Bundle initialExtras) {
380 throw new UnsupportedOperationException();
381 }
382
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800383 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700384 @SystemApi
385 @Override
386 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
387 Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
388 Bundle initialExtras) {
389 throw new UnsupportedOperationException();
390 }
391
392 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800393 @Override
394 public void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp,
395 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
396 Bundle initialExtras) {
397 throw new UnsupportedOperationException();
398 }
399
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800400 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700401 public void sendBroadcastAsUser(Intent intent, UserHandle user) {
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700402 throw new UnsupportedOperationException();
403 }
404
405 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700406 public void sendBroadcastAsUser(Intent intent, UserHandle user,
407 String receiverPermission) {
408 throw new UnsupportedOperationException();
409 }
410
Svet Ganov16a16892015-04-16 10:32:04 -0700411 /** @hide */
412 @Override
413 public void sendBroadcastAsUser(Intent intent, UserHandle user,
414 String receiverPermission, int appOp) {
415 throw new UnsupportedOperationException();
416 }
417
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700418 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700419 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700420 String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700421 int initialCode, String initialData, Bundle initialExtras) {
422 throw new UnsupportedOperationException();
423 }
424
Amith Yamasani3cf75722014-05-16 12:37:29 -0700425 /** @hide */
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700426 @Override
Amith Yamasani3cf75722014-05-16 12:37:29 -0700427 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
428 String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
Dianne Hackbornfd854ee2015-07-13 18:00:37 -0700429 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
430 throw new UnsupportedOperationException();
431 }
432
433 /** @hide */
434 @Override
435 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
436 String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
437 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
Amith Yamasani3cf75722014-05-16 12:37:29 -0700438 throw new UnsupportedOperationException();
439 }
440
441 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800442 public void sendStickyBroadcast(Intent intent) {
443 throw new UnsupportedOperationException();
444 }
445
446 @Override
Dianne Hackbornefa199f2009-09-19 12:03:15 -0700447 public void sendStickyOrderedBroadcast(Intent intent,
448 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
449 Bundle initialExtras) {
450 throw new UnsupportedOperationException();
451 }
452
453 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800454 public void removeStickyBroadcast(Intent intent) {
455 throw new UnsupportedOperationException();
456 }
457
458 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700459 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
460 throw new UnsupportedOperationException();
461 }
462
Dianne Hackborne0e413e2015-12-09 17:22:26 -0800463 /** @hide */
464 @Override
465 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
466 throw new UnsupportedOperationException();
467 }
468
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700469 @Override
470 public void sendStickyOrderedBroadcastAsUser(Intent intent,
471 UserHandle user, BroadcastReceiver resultReceiver,
472 Handler scheduler, int initialCode, String initialData,
473 Bundle initialExtras) {
474 throw new UnsupportedOperationException();
475 }
476
477 @Override
478 public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
479 throw new UnsupportedOperationException();
480 }
481
482 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800483 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
484 throw new UnsupportedOperationException();
485 }
486
487 @Override
488 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
489 String broadcastPermission, Handler scheduler) {
490 throw new UnsupportedOperationException();
491 }
492
Dianne Hackborn20e80982012-08-31 19:00:44 -0700493 /** @hide */
494 @Override
495 public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
496 IntentFilter filter, String broadcastPermission, Handler scheduler) {
497 throw new UnsupportedOperationException();
498 }
499
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800500 @Override
501 public void unregisterReceiver(BroadcastReceiver receiver) {
502 throw new UnsupportedOperationException();
503 }
504
505 @Override
506 public ComponentName startService(Intent service) {
507 throw new UnsupportedOperationException();
508 }
509
510 @Override
511 public boolean stopService(Intent service) {
512 throw new UnsupportedOperationException();
513 }
514
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700515 /** @hide */
516 @Override
517 public ComponentName startServiceAsUser(Intent service, UserHandle user) {
518 throw new UnsupportedOperationException();
519 }
520
521 /** @hide */
522 @Override
523 public boolean stopServiceAsUser(Intent service, UserHandle user) {
524 throw new UnsupportedOperationException();
525 }
526
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800527 @Override
528 public boolean bindService(Intent service, ServiceConnection conn, int flags) {
529 throw new UnsupportedOperationException();
530 }
531
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800532 /** @hide */
533 @Override
Amith Yamasani27b89e62013-01-16 12:30:11 -0800534 public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
535 UserHandle user) {
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800536 throw new UnsupportedOperationException();
537 }
538
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800539 @Override
540 public void unbindService(ServiceConnection conn) {
541 throw new UnsupportedOperationException();
542 }
543
544 @Override
545 public boolean startInstrumentation(ComponentName className,
546 String profileFile, Bundle arguments) {
547 throw new UnsupportedOperationException();
548 }
549
550 @Override
551 public Object getSystemService(String name) {
552 throw new UnsupportedOperationException();
553 }
554
555 @Override
Jeff Brown6e539312015-02-24 18:53:21 -0800556 public String getSystemServiceName(Class<?> serviceClass) {
557 throw new UnsupportedOperationException();
558 }
559
560 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800561 public int checkPermission(String permission, int pid, int uid) {
562 throw new UnsupportedOperationException();
563 }
564
Dianne Hackbornff170242014-11-19 10:59:01 -0800565 /** @hide */
566 @Override
567 public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
568 return checkPermission(permission, pid, uid);
569 }
570
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800571 @Override
572 public int checkCallingPermission(String permission) {
573 throw new UnsupportedOperationException();
574 }
575
576 @Override
577 public int checkCallingOrSelfPermission(String permission) {
578 throw new UnsupportedOperationException();
579 }
580
581 @Override
Svetoslavc6d1c342015-02-26 14:44:43 -0800582 public int checkSelfPermission(String permission) {
583 throw new UnsupportedOperationException();
584 }
585
586 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800587 public void enforcePermission(
588 String permission, int pid, int uid, String message) {
589 throw new UnsupportedOperationException();
590 }
591
592 @Override
593 public void enforceCallingPermission(String permission, String message) {
594 throw new UnsupportedOperationException();
595 }
596
597 @Override
598 public void enforceCallingOrSelfPermission(String permission, String message) {
599 throw new UnsupportedOperationException();
600 }
601
602 @Override
603 public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
604 throw new UnsupportedOperationException();
605 }
606
607 @Override
608 public void revokeUriPermission(Uri uri, int modeFlags) {
609 throw new UnsupportedOperationException();
610 }
611
612 @Override
613 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
614 throw new UnsupportedOperationException();
615 }
616
Dianne Hackbornff170242014-11-19 10:59:01 -0800617 /** @hide */
618 @Override
619 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
620 return checkUriPermission(uri, pid, uid, modeFlags);
621 }
622
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800623 @Override
624 public int checkCallingUriPermission(Uri uri, int modeFlags) {
625 throw new UnsupportedOperationException();
626 }
627
628 @Override
629 public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
630 throw new UnsupportedOperationException();
631 }
632
633 @Override
634 public int checkUriPermission(Uri uri, String readPermission,
635 String writePermission, int pid, int uid, int modeFlags) {
636 throw new UnsupportedOperationException();
637 }
638
639 @Override
640 public void enforceUriPermission(
641 Uri uri, int pid, int uid, int modeFlags, String message) {
642 throw new UnsupportedOperationException();
643 }
644
645 @Override
646 public void enforceCallingUriPermission(
647 Uri uri, int modeFlags, String message) {
648 throw new UnsupportedOperationException();
649 }
650
651 @Override
652 public void enforceCallingOrSelfUriPermission(
653 Uri uri, int modeFlags, String message) {
654 throw new UnsupportedOperationException();
655 }
656
657 public void enforceUriPermission(
658 Uri uri, String readPermission, String writePermission,
659 int pid, int uid, int modeFlags, String message) {
660 throw new UnsupportedOperationException();
661 }
662
663 @Override
664 public Context createPackageContext(String packageName, int flags)
665 throws PackageManager.NameNotFoundException {
666 throw new UnsupportedOperationException();
667 }
Romain Guy870e09f2009-07-06 16:35:25 -0700668
Jeff Sharkey6d515712012-09-20 16:06:08 -0700669 /** {@hide} */
670 @Override
Svetoslav976e8bd2014-07-16 15:12:03 -0700671 public Context createApplicationContext(ApplicationInfo application, int flags)
672 throws PackageManager.NameNotFoundException {
673 return null;
674 }
675
676 /** {@hide} */
677 @Override
Jeff Sharkey6d515712012-09-20 16:06:08 -0700678 public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
679 throws PackageManager.NameNotFoundException {
680 throw new UnsupportedOperationException();
681 }
682
Jim Millera75a8832013-02-07 16:53:32 -0800683 /** {@hide} */
684 @Override
685 public int getUserId() {
686 throw new UnsupportedOperationException();
687 }
688
Romain Guy870e09f2009-07-06 16:35:25 -0700689 @Override
Dianne Hackborn756220b2012-08-14 16:45:30 -0700690 public Context createConfigurationContext(Configuration overrideConfiguration) {
691 throw new UnsupportedOperationException();
692 }
693
694 @Override
Jeff Browna492c3a2012-08-23 19:48:44 -0700695 public Context createDisplayContext(Display display) {
696 throw new UnsupportedOperationException();
697 }
698
699 @Override
Romain Guy870e09f2009-07-06 16:35:25 -0700700 public boolean isRestricted() {
Svetoslav976e8bd2014-07-16 15:12:03 -0700701 throw new UnsupportedOperationException();
Romain Guy870e09f2009-07-06 16:35:25 -0700702 }
Jeff Brown98365d72012-08-19 20:30:52 -0700703
704 /** @hide */
705 @Override
Craig Mautner48d0d182013-06-11 07:53:06 -0700706 public DisplayAdjustments getDisplayAdjustments(int displayId) {
Jeff Brown98365d72012-08-19 20:30:52 -0700707 throw new UnsupportedOperationException();
708 }
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700709
710 @Override
711 public File[] getExternalFilesDirs(String type) {
712 throw new UnsupportedOperationException();
713 }
714
715 @Override
716 public File[] getObbDirs() {
717 throw new UnsupportedOperationException();
718 }
719
720 @Override
721 public File[] getExternalCacheDirs() {
722 throw new UnsupportedOperationException();
723 }
Jeff Sharkey2ee3c1e2014-05-30 15:38:35 -0700724
725 @Override
726 public File[] getExternalMediaDirs() {
727 throw new UnsupportedOperationException();
728 }
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700729
730 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600731 public Context createDeviceProtectedStorageContext() {
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700732 throw new UnsupportedOperationException();
733 }
734
735 /** {@hide} */
736 @SystemApi
737 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600738 public Context createCredentialProtectedStorageContext() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700739 throw new UnsupportedOperationException();
740 }
741
742 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600743 public boolean isDeviceProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700744 throw new UnsupportedOperationException();
745 }
746
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700747 /** {@hide} */
748 @SystemApi
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700749 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600750 public boolean isCredentialProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700751 throw new UnsupportedOperationException();
752 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800753}