blob: bcc68b38dd2beabcbb8b5afc6a1008301c95f847 [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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.ComponentName;
23import android.content.ContentResolver;
24import android.content.Context;
25import android.content.Intent;
26import android.content.IntentFilter;
27import android.content.BroadcastReceiver;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070028import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.ServiceConnection;
30import android.content.SharedPreferences;
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -070031import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032import android.content.pm.PackageManager;
33import android.content.res.AssetManager;
Dianne Hackborn756220b2012-08-14 16:45:30 -070034import android.content.res.Configuration;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.content.res.Resources;
Vasu Nori74f170f2010-06-01 18:06:18 -070036import android.database.DatabaseErrorHandler;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037import android.database.sqlite.SQLiteDatabase;
38import android.graphics.Bitmap;
39import android.graphics.drawable.Drawable;
40import android.net.Uri;
41import android.os.Bundle;
42import android.os.Handler;
Dianne Hackbornff170242014-11-19 10:59:01 -080043import android.os.IBinder;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import android.os.Looper;
Dianne Hackborn79af1dd2012-08-16 16:42:52 -070045import android.os.UserHandle;
Craig Mautner48d0d182013-06-11 07:53:06 -070046import android.view.DisplayAdjustments;
Jeff Browna492c3a2012-08-23 19:48:44 -070047import android.view.Display;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048
49import java.io.File;
50import java.io.FileInputStream;
51import java.io.FileNotFoundException;
52import java.io.FileOutputStream;
53import java.io.IOException;
54import java.io.InputStream;
55
56/**
Stephan Linznerb51617f2016-01-27 18:09:50 -080057 * A mock {@link android.content.Context} class. All methods are non-functional and throw
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080058 * {@link java.lang.UnsupportedOperationException}. You can use this to inject other dependencies,
59 * mocks, or monitors into the classes you are testing.
60 */
61public class MockContext extends Context {
62
63 @Override
64 public AssetManager getAssets() {
65 throw new UnsupportedOperationException();
66 }
67
68 @Override
69 public Resources getResources() {
70 throw new UnsupportedOperationException();
71 }
72
73 @Override
74 public PackageManager getPackageManager() {
75 throw new UnsupportedOperationException();
76 }
77
78 @Override
79 public ContentResolver getContentResolver() {
80 throw new UnsupportedOperationException();
81 }
82
83 @Override
84 public Looper getMainLooper() {
85 throw new UnsupportedOperationException();
86 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080087
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080088 @Override
89 public Context getApplicationContext() {
90 throw new UnsupportedOperationException();
91 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080092
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080093 @Override
94 public void setTheme(int resid) {
95 throw new UnsupportedOperationException();
96 }
97
98 @Override
99 public Resources.Theme getTheme() {
100 throw new UnsupportedOperationException();
101 }
102
103 @Override
104 public ClassLoader getClassLoader() {
105 throw new UnsupportedOperationException();
106 }
107
108 @Override
109 public String getPackageName() {
110 throw new UnsupportedOperationException();
111 }
112
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800113 /** @hide */
114 @Override
115 public String getBasePackageName() {
116 throw new UnsupportedOperationException();
117 }
118
Dianne Hackborn95d78532013-09-11 09:51:14 -0700119 /** @hide */
120 @Override
121 public String getOpPackageName() {
122 throw new UnsupportedOperationException();
123 }
124
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125 @Override
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700126 public ApplicationInfo getApplicationInfo() {
127 throw new UnsupportedOperationException();
128 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800129
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700130 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800131 public String getPackageResourcePath() {
132 throw new UnsupportedOperationException();
133 }
134
Joe Onorato23ecae32009-06-10 17:07:15 -0700135 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800136 public String getPackageCodePath() {
137 throw new UnsupportedOperationException();
138 }
139
140 @Override
141 public SharedPreferences getSharedPreferences(String name, int mode) {
142 throw new UnsupportedOperationException();
143 }
144
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600145 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800146 @Override
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700147 public SharedPreferences getSharedPreferences(File file, int mode) {
148 throw new UnsupportedOperationException();
149 }
150
151 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600152 public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700153 throw new UnsupportedOperationException();
154 }
155
156 @Override
157 public boolean deleteSharedPreferences(String name) {
158 throw new UnsupportedOperationException();
159 }
160
161 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800162 public FileInputStream openFileInput(String name) throws FileNotFoundException {
163 throw new UnsupportedOperationException();
164 }
165
166 @Override
167 public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException {
168 throw new UnsupportedOperationException();
169 }
170
171 @Override
172 public boolean deleteFile(String name) {
173 throw new UnsupportedOperationException();
174 }
175
176 @Override
177 public File getFileStreamPath(String name) {
178 throw new UnsupportedOperationException();
179 }
180
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600181 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800182 @Override
Jeff Sharkey6a6cdafa2015-12-07 19:25:19 -0700183 public File getSharedPreferencesPath(String name) {
184 throw new UnsupportedOperationException();
185 }
186
187 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800188 public String[] fileList() {
189 throw new UnsupportedOperationException();
190 }
191
192 @Override
Jeff Sharkey2c1ba9a2016-02-17 15:29:38 -0700193 public File getDataDir() {
194 throw new UnsupportedOperationException();
195 }
196
197 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800198 public File getFilesDir() {
199 throw new UnsupportedOperationException();
200 }
201
202 @Override
Christopher Tatea7835b62014-07-11 17:25:57 -0700203 public File getNoBackupFilesDir() {
204 throw new UnsupportedOperationException();
205 }
206
207 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800208 public File getExternalFilesDir(String type) {
209 throw new UnsupportedOperationException();
210 }
211
212 @Override
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800213 public File getObbDir() {
214 throw new UnsupportedOperationException();
215 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800216
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800217 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800218 public File getCacheDir() {
219 throw new UnsupportedOperationException();
220 }
221
222 @Override
Jeff Sharkey4ed745d2014-07-15 20:39:15 -0700223 public File getCodeCacheDir() {
224 throw new UnsupportedOperationException();
225 }
226
227 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800228 public File getExternalCacheDir() {
229 throw new UnsupportedOperationException();
230 }
231
232 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800233 public File getDir(String name, int mode) {
234 throw new UnsupportedOperationException();
235 }
236
237 @Override
Stephan Linznerb51617f2016-01-27 18:09:50 -0800238 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800239 SQLiteDatabase.CursorFactory factory) {
240 throw new UnsupportedOperationException();
241 }
242
243 @Override
Vasu Nori74f170f2010-06-01 18:06:18 -0700244 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
245 SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) {
246 throw new UnsupportedOperationException();
247 }
248
249 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800250 public File getDatabasePath(String name) {
251 throw new UnsupportedOperationException();
252 }
253
254 @Override
255 public String[] databaseList() {
256 throw new UnsupportedOperationException();
257 }
258
259 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600260 public boolean moveDatabaseFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700261 throw new UnsupportedOperationException();
262 }
263
264 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265 public boolean deleteDatabase(String name) {
266 throw new UnsupportedOperationException();
267 }
268
269 @Override
270 public Drawable getWallpaper() {
271 throw new UnsupportedOperationException();
272 }
273
274 @Override
275 public Drawable peekWallpaper() {
276 throw new UnsupportedOperationException();
277 }
278
279 @Override
280 public int getWallpaperDesiredMinimumWidth() {
281 throw new UnsupportedOperationException();
282 }
283
284 @Override
285 public int getWallpaperDesiredMinimumHeight() {
286 throw new UnsupportedOperationException();
287 }
288
289 @Override
290 public void setWallpaper(Bitmap bitmap) throws IOException {
291 throw new UnsupportedOperationException();
292 }
293
294 @Override
295 public void setWallpaper(InputStream data) throws IOException {
296 throw new UnsupportedOperationException();
297 }
298
299 @Override
300 public void clearWallpaper() {
301 throw new UnsupportedOperationException();
302 }
303
304 @Override
305 public void startActivity(Intent intent) {
306 throw new UnsupportedOperationException();
307 }
308
309 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700310 public void startActivity(Intent intent, Bundle options) {
311 startActivity(intent);
312 }
313
314 @Override
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800315 public void startActivities(Intent[] intents) {
316 throw new UnsupportedOperationException();
317 }
318
319 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700320 public void startActivities(Intent[] intents, Bundle options) {
321 startActivities(intents);
322 }
323
324 @Override
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700325 public void startIntentSender(IntentSender intent,
326 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
327 throws IntentSender.SendIntentException {
328 throw new UnsupportedOperationException();
329 }
Dianne Hackborna4972e92012-03-14 10:38:05 -0700330
331 @Override
332 public void startIntentSender(IntentSender intent,
333 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags,
334 Bundle options) throws IntentSender.SendIntentException {
335 startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags);
336 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800337
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700338 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800339 public void sendBroadcast(Intent intent) {
340 throw new UnsupportedOperationException();
341 }
342
Amith Yamasani67cf7d32012-02-16 14:31:23 -0800343 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800344 public void sendBroadcast(Intent intent, String receiverPermission) {
345 throw new UnsupportedOperationException();
346 }
347
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800348 /** @hide */
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700349 @Override
350 public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) {
351 throw new UnsupportedOperationException();
352 }
353
354 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700355 @SystemApi
356 @Override
357 public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) {
358 throw new UnsupportedOperationException();
359 }
360
361 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800362 @Override
363 public void sendBroadcast(Intent intent, String receiverPermission, int appOp) {
364 throw new UnsupportedOperationException();
365 }
366
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800367 @Override
368 public void sendOrderedBroadcast(Intent intent,
369 String receiverPermission) {
370 throw new UnsupportedOperationException();
371 }
372
373 @Override
374 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
375 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
376 Bundle initialExtras) {
377 throw new UnsupportedOperationException();
378 }
379
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800380 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700381 @SystemApi
382 @Override
383 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
384 Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
385 Bundle initialExtras) {
386 throw new UnsupportedOperationException();
387 }
388
389 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800390 @Override
391 public void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp,
392 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
393 Bundle initialExtras) {
394 throw new UnsupportedOperationException();
395 }
396
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800397 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700398 public void sendBroadcastAsUser(Intent intent, UserHandle user) {
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700399 throw new UnsupportedOperationException();
400 }
401
402 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700403 public void sendBroadcastAsUser(Intent intent, UserHandle user,
404 String receiverPermission) {
405 throw new UnsupportedOperationException();
406 }
407
Svet Ganov16a16892015-04-16 10:32:04 -0700408 /** @hide */
Chad Brubaker52c8edc2016-07-25 14:30:26 -0700409 @SystemApi
410 @Override
411 public void sendBroadcastAsUser(Intent intent, UserHandle user,
412 String receiverPermission, Bundle options) {
413 throw new UnsupportedOperationException();
414 }
415
416 /** @hide */
Svet Ganov16a16892015-04-16 10:32:04 -0700417 @Override
418 public void sendBroadcastAsUser(Intent intent, UserHandle user,
419 String receiverPermission, int appOp) {
420 throw new UnsupportedOperationException();
421 }
422
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700423 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700424 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700425 String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700426 int initialCode, String initialData, Bundle initialExtras) {
427 throw new UnsupportedOperationException();
428 }
429
Amith Yamasani3cf75722014-05-16 12:37:29 -0700430 /** @hide */
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700431 @Override
Amith Yamasani3cf75722014-05-16 12:37:29 -0700432 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
433 String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
Dianne Hackbornfd854ee2015-07-13 18:00:37 -0700434 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
435 throw new UnsupportedOperationException();
436 }
437
438 /** @hide */
439 @Override
440 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
441 String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
442 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
Amith Yamasani3cf75722014-05-16 12:37:29 -0700443 throw new UnsupportedOperationException();
444 }
445
446 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800447 public void sendStickyBroadcast(Intent intent) {
448 throw new UnsupportedOperationException();
449 }
450
451 @Override
Dianne Hackbornefa199f2009-09-19 12:03:15 -0700452 public void sendStickyOrderedBroadcast(Intent intent,
453 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
454 Bundle initialExtras) {
455 throw new UnsupportedOperationException();
456 }
457
458 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800459 public void removeStickyBroadcast(Intent intent) {
460 throw new UnsupportedOperationException();
461 }
462
463 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700464 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
465 throw new UnsupportedOperationException();
466 }
467
Dianne Hackborne0e413e2015-12-09 17:22:26 -0800468 /** @hide */
469 @Override
470 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
471 throw new UnsupportedOperationException();
472 }
473
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700474 @Override
475 public void sendStickyOrderedBroadcastAsUser(Intent intent,
476 UserHandle user, BroadcastReceiver resultReceiver,
477 Handler scheduler, int initialCode, String initialData,
478 Bundle initialExtras) {
479 throw new UnsupportedOperationException();
480 }
481
482 @Override
483 public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
484 throw new UnsupportedOperationException();
485 }
486
487 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800488 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
489 throw new UnsupportedOperationException();
490 }
491
492 @Override
493 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
494 String broadcastPermission, Handler scheduler) {
495 throw new UnsupportedOperationException();
496 }
497
Dianne Hackborn20e80982012-08-31 19:00:44 -0700498 /** @hide */
499 @Override
500 public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
501 IntentFilter filter, String broadcastPermission, Handler scheduler) {
502 throw new UnsupportedOperationException();
503 }
504
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800505 @Override
506 public void unregisterReceiver(BroadcastReceiver receiver) {
507 throw new UnsupportedOperationException();
508 }
509
510 @Override
511 public ComponentName startService(Intent service) {
512 throw new UnsupportedOperationException();
513 }
514
515 @Override
516 public boolean stopService(Intent service) {
517 throw new UnsupportedOperationException();
518 }
519
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700520 /** @hide */
521 @Override
522 public ComponentName startServiceAsUser(Intent service, UserHandle user) {
523 throw new UnsupportedOperationException();
524 }
525
526 /** @hide */
527 @Override
528 public boolean stopServiceAsUser(Intent service, UserHandle user) {
529 throw new UnsupportedOperationException();
530 }
531
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800532 @Override
533 public boolean bindService(Intent service, ServiceConnection conn, int flags) {
534 throw new UnsupportedOperationException();
535 }
536
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800537 /** @hide */
538 @Override
Amith Yamasani27b89e62013-01-16 12:30:11 -0800539 public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
540 UserHandle user) {
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800541 throw new UnsupportedOperationException();
542 }
543
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800544 @Override
545 public void unbindService(ServiceConnection conn) {
546 throw new UnsupportedOperationException();
547 }
548
549 @Override
550 public boolean startInstrumentation(ComponentName className,
551 String profileFile, Bundle arguments) {
552 throw new UnsupportedOperationException();
553 }
554
555 @Override
556 public Object getSystemService(String name) {
557 throw new UnsupportedOperationException();
558 }
559
560 @Override
Jeff Brown6e539312015-02-24 18:53:21 -0800561 public String getSystemServiceName(Class<?> serviceClass) {
562 throw new UnsupportedOperationException();
563 }
564
565 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800566 public int checkPermission(String permission, int pid, int uid) {
567 throw new UnsupportedOperationException();
568 }
569
Dianne Hackbornff170242014-11-19 10:59:01 -0800570 /** @hide */
571 @Override
572 public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
573 return checkPermission(permission, pid, uid);
574 }
575
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800576 @Override
577 public int checkCallingPermission(String permission) {
578 throw new UnsupportedOperationException();
579 }
580
581 @Override
582 public int checkCallingOrSelfPermission(String permission) {
583 throw new UnsupportedOperationException();
584 }
585
586 @Override
Svetoslavc6d1c342015-02-26 14:44:43 -0800587 public int checkSelfPermission(String permission) {
588 throw new UnsupportedOperationException();
589 }
590
591 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800592 public void enforcePermission(
593 String permission, int pid, int uid, String message) {
594 throw new UnsupportedOperationException();
595 }
596
597 @Override
598 public void enforceCallingPermission(String permission, String message) {
599 throw new UnsupportedOperationException();
600 }
601
602 @Override
603 public void enforceCallingOrSelfPermission(String permission, String message) {
604 throw new UnsupportedOperationException();
605 }
606
607 @Override
608 public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
609 throw new UnsupportedOperationException();
610 }
611
612 @Override
613 public void revokeUriPermission(Uri uri, int modeFlags) {
614 throw new UnsupportedOperationException();
615 }
616
617 @Override
618 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
619 throw new UnsupportedOperationException();
620 }
621
Dianne Hackbornff170242014-11-19 10:59:01 -0800622 /** @hide */
623 @Override
624 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
625 return checkUriPermission(uri, pid, uid, modeFlags);
626 }
627
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800628 @Override
629 public int checkCallingUriPermission(Uri uri, int modeFlags) {
630 throw new UnsupportedOperationException();
631 }
632
633 @Override
634 public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
635 throw new UnsupportedOperationException();
636 }
637
638 @Override
639 public int checkUriPermission(Uri uri, String readPermission,
640 String writePermission, int pid, int uid, int modeFlags) {
641 throw new UnsupportedOperationException();
642 }
643
644 @Override
645 public void enforceUriPermission(
646 Uri uri, int pid, int uid, int modeFlags, String message) {
647 throw new UnsupportedOperationException();
648 }
649
650 @Override
651 public void enforceCallingUriPermission(
652 Uri uri, int modeFlags, String message) {
653 throw new UnsupportedOperationException();
654 }
655
656 @Override
657 public void enforceCallingOrSelfUriPermission(
658 Uri uri, int modeFlags, String message) {
659 throw new UnsupportedOperationException();
660 }
661
662 public void enforceUriPermission(
663 Uri uri, String readPermission, String writePermission,
664 int pid, int uid, int modeFlags, String message) {
665 throw new UnsupportedOperationException();
666 }
667
668 @Override
669 public Context createPackageContext(String packageName, int flags)
670 throws PackageManager.NameNotFoundException {
671 throw new UnsupportedOperationException();
672 }
Romain Guy870e09f2009-07-06 16:35:25 -0700673
Jeff Sharkey6d515712012-09-20 16:06:08 -0700674 /** {@hide} */
675 @Override
Svetoslav976e8bd2014-07-16 15:12:03 -0700676 public Context createApplicationContext(ApplicationInfo application, int flags)
677 throws PackageManager.NameNotFoundException {
678 return null;
679 }
680
681 /** {@hide} */
682 @Override
Jeff Sharkey6d515712012-09-20 16:06:08 -0700683 public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
684 throws PackageManager.NameNotFoundException {
685 throw new UnsupportedOperationException();
686 }
687
Jim Millera75a8832013-02-07 16:53:32 -0800688 /** {@hide} */
689 @Override
690 public int getUserId() {
691 throw new UnsupportedOperationException();
692 }
693
Romain Guy870e09f2009-07-06 16:35:25 -0700694 @Override
Dianne Hackborn756220b2012-08-14 16:45:30 -0700695 public Context createConfigurationContext(Configuration overrideConfiguration) {
696 throw new UnsupportedOperationException();
697 }
698
699 @Override
Jeff Browna492c3a2012-08-23 19:48:44 -0700700 public Context createDisplayContext(Display display) {
701 throw new UnsupportedOperationException();
702 }
703
704 @Override
Romain Guy870e09f2009-07-06 16:35:25 -0700705 public boolean isRestricted() {
Svetoslav976e8bd2014-07-16 15:12:03 -0700706 throw new UnsupportedOperationException();
Romain Guy870e09f2009-07-06 16:35:25 -0700707 }
Jeff Brown98365d72012-08-19 20:30:52 -0700708
709 /** @hide */
710 @Override
Craig Mautner48d0d182013-06-11 07:53:06 -0700711 public DisplayAdjustments getDisplayAdjustments(int displayId) {
Jeff Brown98365d72012-08-19 20:30:52 -0700712 throw new UnsupportedOperationException();
713 }
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700714
Adam Lesinski4ece3d62016-06-16 18:05:41 -0700715 /** @hide */
716 @Override
717 public Display getDisplay() {
718 throw new UnsupportedOperationException();
719 }
720
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700721 @Override
722 public File[] getExternalFilesDirs(String type) {
723 throw new UnsupportedOperationException();
724 }
725
726 @Override
727 public File[] getObbDirs() {
728 throw new UnsupportedOperationException();
729 }
730
731 @Override
732 public File[] getExternalCacheDirs() {
733 throw new UnsupportedOperationException();
734 }
Jeff Sharkey2ee3c1e2014-05-30 15:38:35 -0700735
736 @Override
737 public File[] getExternalMediaDirs() {
738 throw new UnsupportedOperationException();
739 }
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700740
741 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600742 public Context createDeviceProtectedStorageContext() {
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700743 throw new UnsupportedOperationException();
744 }
745
746 /** {@hide} */
747 @SystemApi
748 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600749 public Context createCredentialProtectedStorageContext() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700750 throw new UnsupportedOperationException();
751 }
752
753 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600754 public boolean isDeviceProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700755 throw new UnsupportedOperationException();
756 }
757
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700758 /** {@hide} */
759 @SystemApi
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700760 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600761 public boolean isCredentialProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700762 throw new UnsupportedOperationException();
763 }
Tony Mak46aabe52016-11-14 12:53:06 +0000764
765 /** {@hide} */
766 @Override
767 public IBinder getActivityToken() {
768 throw new UnsupportedOperationException();
769 }
770
771 /** {@hide} */
772 @Override
773 public IServiceConnection getServiceDispatcher(ServiceConnection conn, Handler handler,
774 int flags) {
775 throw new UnsupportedOperationException();
776 }
777
778 /** {@hide} */
779 @Override
780 public IApplicationThread getIApplicationThread() {
781 throw new UnsupportedOperationException();
782 }
Tony Makbf9928d2016-12-22 11:02:45 +0000783
784 /** {@hide} */
785 @Override
786 public Handler getMainThreadHandler() {
787 throw new UnsupportedOperationException();
788 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800789}