blob: 5e5ba462cfca2f55b8045c6d273c75ffdc47790f [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.test.mock;
18
Dianne Hackborna750a632015-06-16 17:18:23 -070019import android.annotation.SystemApi;
Tony Mak46aabe52016-11-14 12:53:06 +000020import android.app.IApplicationThread;
21import android.app.IServiceConnection;
Christopher Tate42a386b2016-11-07 12:21:21 -080022import android.app.Notification;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.ComponentName;
24import android.content.ContentResolver;
25import android.content.Context;
26import android.content.Intent;
27import android.content.IntentFilter;
28import android.content.BroadcastReceiver;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070029import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.ServiceConnection;
31import android.content.SharedPreferences;
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -070032import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033import android.content.pm.PackageManager;
34import android.content.res.AssetManager;
Dianne Hackborn756220b2012-08-14 16:45:30 -070035import android.content.res.Configuration;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036import android.content.res.Resources;
Vasu Nori74f170f2010-06-01 18:06:18 -070037import android.database.DatabaseErrorHandler;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038import android.database.sqlite.SQLiteDatabase;
39import android.graphics.Bitmap;
40import android.graphics.drawable.Drawable;
41import android.net.Uri;
42import android.os.Bundle;
43import android.os.Handler;
Dianne Hackbornff170242014-11-19 10:59:01 -080044import android.os.IBinder;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045import android.os.Looper;
Dianne Hackborn79af1dd2012-08-16 16:42:52 -070046import android.os.UserHandle;
Craig Mautner48d0d182013-06-11 07:53:06 -070047import android.view.DisplayAdjustments;
Jeff Browna492c3a2012-08-23 19:48:44 -070048import android.view.Display;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049
50import java.io.File;
51import java.io.FileInputStream;
52import java.io.FileNotFoundException;
53import java.io.FileOutputStream;
54import java.io.IOException;
55import java.io.InputStream;
56
57/**
Stephan Linznerb51617f2016-01-27 18:09:50 -080058 * A mock {@link android.content.Context} class. All methods are non-functional and throw
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080059 * {@link java.lang.UnsupportedOperationException}. You can use this to inject other dependencies,
60 * mocks, or monitors into the classes you are testing.
61 */
62public class MockContext extends Context {
63
64 @Override
65 public AssetManager getAssets() {
66 throw new UnsupportedOperationException();
67 }
68
69 @Override
70 public Resources getResources() {
71 throw new UnsupportedOperationException();
72 }
73
74 @Override
75 public PackageManager getPackageManager() {
76 throw new UnsupportedOperationException();
77 }
78
79 @Override
80 public ContentResolver getContentResolver() {
81 throw new UnsupportedOperationException();
82 }
83
84 @Override
85 public Looper getMainLooper() {
86 throw new UnsupportedOperationException();
87 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080088
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080089 @Override
90 public Context getApplicationContext() {
91 throw new UnsupportedOperationException();
92 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080093
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080094 @Override
95 public void setTheme(int resid) {
96 throw new UnsupportedOperationException();
97 }
98
99 @Override
100 public Resources.Theme getTheme() {
101 throw new UnsupportedOperationException();
102 }
103
104 @Override
105 public ClassLoader getClassLoader() {
106 throw new UnsupportedOperationException();
107 }
108
109 @Override
110 public String getPackageName() {
111 throw new UnsupportedOperationException();
112 }
113
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800114 /** @hide */
115 @Override
116 public String getBasePackageName() {
117 throw new UnsupportedOperationException();
118 }
119
Dianne Hackborn95d78532013-09-11 09:51:14 -0700120 /** @hide */
121 @Override
122 public String getOpPackageName() {
123 throw new UnsupportedOperationException();
124 }
125
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800126 @Override
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700127 public ApplicationInfo getApplicationInfo() {
128 throw new UnsupportedOperationException();
129 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800130
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700131 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800132 public String getPackageResourcePath() {
133 throw new UnsupportedOperationException();
134 }
135
Joe Onorato23ecae32009-06-10 17:07:15 -0700136 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 public String getPackageCodePath() {
138 throw new UnsupportedOperationException();
139 }
140
141 @Override
142 public SharedPreferences getSharedPreferences(String name, int mode) {
143 throw new UnsupportedOperationException();
144 }
145
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600146 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800147 @Override
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700148 public SharedPreferences getSharedPreferences(File file, int mode) {
149 throw new UnsupportedOperationException();
150 }
151
Christopher Tatefe2368c2017-05-17 15:42:35 -0700152 /** @hide */
153 @Override
154 public void reloadSharedPreferences() {
155 throw new UnsupportedOperationException();
156 }
157
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700158 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600159 public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700160 throw new UnsupportedOperationException();
161 }
162
163 @Override
164 public boolean deleteSharedPreferences(String name) {
165 throw new UnsupportedOperationException();
166 }
167
168 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800169 public FileInputStream openFileInput(String name) throws FileNotFoundException {
170 throw new UnsupportedOperationException();
171 }
172
173 @Override
174 public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException {
175 throw new UnsupportedOperationException();
176 }
177
178 @Override
179 public boolean deleteFile(String name) {
180 throw new UnsupportedOperationException();
181 }
182
183 @Override
184 public File getFileStreamPath(String name) {
185 throw new UnsupportedOperationException();
186 }
187
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600188 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800189 @Override
Jeff Sharkey6a6cdafa2015-12-07 19:25:19 -0700190 public File getSharedPreferencesPath(String name) {
191 throw new UnsupportedOperationException();
192 }
193
194 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800195 public String[] fileList() {
196 throw new UnsupportedOperationException();
197 }
198
199 @Override
Jeff Sharkey2c1ba9a2016-02-17 15:29:38 -0700200 public File getDataDir() {
201 throw new UnsupportedOperationException();
202 }
203
204 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800205 public File getFilesDir() {
206 throw new UnsupportedOperationException();
207 }
208
209 @Override
Christopher Tatea7835b62014-07-11 17:25:57 -0700210 public File getNoBackupFilesDir() {
211 throw new UnsupportedOperationException();
212 }
213
214 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800215 public File getExternalFilesDir(String type) {
216 throw new UnsupportedOperationException();
217 }
218
219 @Override
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800220 public File getObbDir() {
221 throw new UnsupportedOperationException();
222 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800223
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800224 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800225 public File getCacheDir() {
226 throw new UnsupportedOperationException();
227 }
228
229 @Override
Jeff Sharkey4ed745d2014-07-15 20:39:15 -0700230 public File getCodeCacheDir() {
231 throw new UnsupportedOperationException();
232 }
233
234 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800235 public File getExternalCacheDir() {
236 throw new UnsupportedOperationException();
237 }
238
239 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800240 public File getDir(String name, int mode) {
241 throw new UnsupportedOperationException();
242 }
243
244 @Override
Stephan Linznerb51617f2016-01-27 18:09:50 -0800245 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800246 SQLiteDatabase.CursorFactory factory) {
247 throw new UnsupportedOperationException();
248 }
249
250 @Override
Vasu Nori74f170f2010-06-01 18:06:18 -0700251 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
252 SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) {
253 throw new UnsupportedOperationException();
254 }
255
256 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800257 public File getDatabasePath(String name) {
258 throw new UnsupportedOperationException();
259 }
260
261 @Override
262 public String[] databaseList() {
263 throw new UnsupportedOperationException();
264 }
265
266 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600267 public boolean moveDatabaseFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700268 throw new UnsupportedOperationException();
269 }
270
271 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800272 public boolean deleteDatabase(String name) {
273 throw new UnsupportedOperationException();
274 }
275
276 @Override
277 public Drawable getWallpaper() {
278 throw new UnsupportedOperationException();
279 }
280
281 @Override
282 public Drawable peekWallpaper() {
283 throw new UnsupportedOperationException();
284 }
285
286 @Override
287 public int getWallpaperDesiredMinimumWidth() {
288 throw new UnsupportedOperationException();
289 }
290
291 @Override
292 public int getWallpaperDesiredMinimumHeight() {
293 throw new UnsupportedOperationException();
294 }
295
296 @Override
297 public void setWallpaper(Bitmap bitmap) throws IOException {
298 throw new UnsupportedOperationException();
299 }
300
301 @Override
302 public void setWallpaper(InputStream data) throws IOException {
303 throw new UnsupportedOperationException();
304 }
305
306 @Override
307 public void clearWallpaper() {
308 throw new UnsupportedOperationException();
309 }
310
311 @Override
312 public void startActivity(Intent intent) {
313 throw new UnsupportedOperationException();
314 }
315
316 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700317 public void startActivity(Intent intent, Bundle options) {
318 startActivity(intent);
319 }
320
321 @Override
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800322 public void startActivities(Intent[] intents) {
323 throw new UnsupportedOperationException();
324 }
325
326 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700327 public void startActivities(Intent[] intents, Bundle options) {
328 startActivities(intents);
329 }
330
331 @Override
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700332 public void startIntentSender(IntentSender intent,
333 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
334 throws IntentSender.SendIntentException {
335 throw new UnsupportedOperationException();
336 }
Dianne Hackborna4972e92012-03-14 10:38:05 -0700337
338 @Override
339 public void startIntentSender(IntentSender intent,
340 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags,
341 Bundle options) throws IntentSender.SendIntentException {
342 startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags);
343 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800344
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700345 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800346 public void sendBroadcast(Intent intent) {
347 throw new UnsupportedOperationException();
348 }
349
Amith Yamasani67cf7d32012-02-16 14:31:23 -0800350 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800351 public void sendBroadcast(Intent intent, String receiverPermission) {
352 throw new UnsupportedOperationException();
353 }
354
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800355 /** @hide */
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700356 @Override
357 public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) {
358 throw new UnsupportedOperationException();
359 }
360
361 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700362 @SystemApi
363 @Override
364 public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) {
365 throw new UnsupportedOperationException();
366 }
367
368 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800369 @Override
370 public void sendBroadcast(Intent intent, String receiverPermission, int appOp) {
371 throw new UnsupportedOperationException();
372 }
373
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800374 @Override
375 public void sendOrderedBroadcast(Intent intent,
376 String receiverPermission) {
377 throw new UnsupportedOperationException();
378 }
379
380 @Override
381 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
382 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
383 Bundle initialExtras) {
384 throw new UnsupportedOperationException();
385 }
386
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800387 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700388 @SystemApi
389 @Override
390 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
391 Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
392 Bundle initialExtras) {
393 throw new UnsupportedOperationException();
394 }
395
396 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800397 @Override
398 public void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp,
399 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
400 Bundle initialExtras) {
401 throw new UnsupportedOperationException();
402 }
403
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800404 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700405 public void sendBroadcastAsUser(Intent intent, UserHandle user) {
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700406 throw new UnsupportedOperationException();
407 }
408
409 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700410 public void sendBroadcastAsUser(Intent intent, UserHandle user,
411 String receiverPermission) {
412 throw new UnsupportedOperationException();
413 }
414
Svet Ganov16a16892015-04-16 10:32:04 -0700415 /** @hide */
Chad Brubaker52c8edc2016-07-25 14:30:26 -0700416 @SystemApi
417 @Override
418 public void sendBroadcastAsUser(Intent intent, UserHandle user,
419 String receiverPermission, Bundle options) {
420 throw new UnsupportedOperationException();
421 }
422
423 /** @hide */
Svet Ganov16a16892015-04-16 10:32:04 -0700424 @Override
425 public void sendBroadcastAsUser(Intent intent, UserHandle user,
426 String receiverPermission, int appOp) {
427 throw new UnsupportedOperationException();
428 }
429
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700430 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700431 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700432 String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700433 int initialCode, String initialData, Bundle initialExtras) {
434 throw new UnsupportedOperationException();
435 }
436
Amith Yamasani3cf75722014-05-16 12:37:29 -0700437 /** @hide */
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700438 @Override
Amith Yamasani3cf75722014-05-16 12:37:29 -0700439 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
440 String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
Dianne Hackbornfd854ee2015-07-13 18:00:37 -0700441 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
442 throw new UnsupportedOperationException();
443 }
444
445 /** @hide */
446 @Override
447 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
448 String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
449 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
Amith Yamasani3cf75722014-05-16 12:37:29 -0700450 throw new UnsupportedOperationException();
451 }
452
453 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800454 public void sendStickyBroadcast(Intent intent) {
455 throw new UnsupportedOperationException();
456 }
457
458 @Override
Dianne Hackbornefa199f2009-09-19 12:03:15 -0700459 public void sendStickyOrderedBroadcast(Intent intent,
460 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
461 Bundle initialExtras) {
462 throw new UnsupportedOperationException();
463 }
464
465 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800466 public void removeStickyBroadcast(Intent intent) {
467 throw new UnsupportedOperationException();
468 }
469
470 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700471 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
472 throw new UnsupportedOperationException();
473 }
474
Dianne Hackborne0e413e2015-12-09 17:22:26 -0800475 /** @hide */
476 @Override
477 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
478 throw new UnsupportedOperationException();
479 }
480
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700481 @Override
482 public void sendStickyOrderedBroadcastAsUser(Intent intent,
483 UserHandle user, BroadcastReceiver resultReceiver,
484 Handler scheduler, int initialCode, String initialData,
485 Bundle initialExtras) {
486 throw new UnsupportedOperationException();
487 }
488
489 @Override
490 public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
491 throw new UnsupportedOperationException();
492 }
493
494 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800495 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
496 throw new UnsupportedOperationException();
497 }
498
499 @Override
500 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
Chad Brubaker6d6015f652017-04-18 11:25:16 -0700501 int flags) {
Chad Brubaker816c83b2017-03-02 10:27:59 -0800502 throw new UnsupportedOperationException();
503 }
504
505 @Override
506 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800507 String broadcastPermission, Handler scheduler) {
508 throw new UnsupportedOperationException();
509 }
510
Chad Brubaker816c83b2017-03-02 10:27:59 -0800511 @Override
512 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
Chad Brubaker6d6015f652017-04-18 11:25:16 -0700513 String broadcastPermission, Handler scheduler, int flags) {
Chad Brubaker816c83b2017-03-02 10:27:59 -0800514 throw new UnsupportedOperationException();
515 }
516
Dianne Hackborn20e80982012-08-31 19:00:44 -0700517 /** @hide */
518 @Override
519 public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
520 IntentFilter filter, String broadcastPermission, Handler scheduler) {
521 throw new UnsupportedOperationException();
522 }
523
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800524 @Override
525 public void unregisterReceiver(BroadcastReceiver receiver) {
526 throw new UnsupportedOperationException();
527 }
528
529 @Override
530 public ComponentName startService(Intent service) {
531 throw new UnsupportedOperationException();
532 }
533
534 @Override
Christopher Tate08992ac2017-03-21 11:37:06 -0700535 public ComponentName startForegroundService(Intent service) {
536 throw new UnsupportedOperationException();
537 }
538
Christopher Tate42a386b2016-11-07 12:21:21 -0800539 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800540 public boolean stopService(Intent service) {
541 throw new UnsupportedOperationException();
542 }
543
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700544 /** @hide */
545 @Override
546 public ComponentName startServiceAsUser(Intent service, UserHandle user) {
547 throw new UnsupportedOperationException();
548 }
549
550 /** @hide */
551 @Override
Christopher Tate08992ac2017-03-21 11:37:06 -0700552 public ComponentName startForegroundServiceAsUser(Intent service, UserHandle user) {
553 throw new UnsupportedOperationException();
554 }
555
Christopher Tate42a386b2016-11-07 12:21:21 -0800556 /** @hide */
557 @Override
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700558 public boolean stopServiceAsUser(Intent service, UserHandle user) {
559 throw new UnsupportedOperationException();
560 }
561
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800562 @Override
563 public boolean bindService(Intent service, ServiceConnection conn, int flags) {
564 throw new UnsupportedOperationException();
565 }
566
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800567 /** @hide */
568 @Override
Amith Yamasani27b89e62013-01-16 12:30:11 -0800569 public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
570 UserHandle user) {
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800571 throw new UnsupportedOperationException();
572 }
573
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800574 @Override
575 public void unbindService(ServiceConnection conn) {
576 throw new UnsupportedOperationException();
577 }
578
579 @Override
580 public boolean startInstrumentation(ComponentName className,
581 String profileFile, Bundle arguments) {
582 throw new UnsupportedOperationException();
583 }
584
585 @Override
586 public Object getSystemService(String name) {
587 throw new UnsupportedOperationException();
588 }
589
590 @Override
Jeff Brown6e539312015-02-24 18:53:21 -0800591 public String getSystemServiceName(Class<?> serviceClass) {
592 throw new UnsupportedOperationException();
593 }
594
595 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800596 public int checkPermission(String permission, int pid, int uid) {
597 throw new UnsupportedOperationException();
598 }
599
Dianne Hackbornff170242014-11-19 10:59:01 -0800600 /** @hide */
601 @Override
602 public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
603 return checkPermission(permission, pid, uid);
604 }
605
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800606 @Override
607 public int checkCallingPermission(String permission) {
608 throw new UnsupportedOperationException();
609 }
610
611 @Override
612 public int checkCallingOrSelfPermission(String permission) {
613 throw new UnsupportedOperationException();
614 }
615
616 @Override
Svetoslavc6d1c342015-02-26 14:44:43 -0800617 public int checkSelfPermission(String permission) {
618 throw new UnsupportedOperationException();
619 }
620
621 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800622 public void enforcePermission(
623 String permission, int pid, int uid, String message) {
624 throw new UnsupportedOperationException();
625 }
626
627 @Override
628 public void enforceCallingPermission(String permission, String message) {
629 throw new UnsupportedOperationException();
630 }
631
632 @Override
633 public void enforceCallingOrSelfPermission(String permission, String message) {
634 throw new UnsupportedOperationException();
635 }
636
637 @Override
638 public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
639 throw new UnsupportedOperationException();
640 }
641
642 @Override
643 public void revokeUriPermission(Uri uri, int modeFlags) {
644 throw new UnsupportedOperationException();
645 }
646
647 @Override
Dianne Hackborna47223f2017-03-30 13:49:13 -0700648 public void revokeUriPermission(String targetPackage, Uri uri, int modeFlags) {
649 throw new UnsupportedOperationException();
650 }
651
652 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800653 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
654 throw new UnsupportedOperationException();
655 }
656
Dianne Hackbornff170242014-11-19 10:59:01 -0800657 /** @hide */
658 @Override
659 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
660 return checkUriPermission(uri, pid, uid, modeFlags);
661 }
662
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800663 @Override
664 public int checkCallingUriPermission(Uri uri, int modeFlags) {
665 throw new UnsupportedOperationException();
666 }
667
668 @Override
669 public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
670 throw new UnsupportedOperationException();
671 }
672
673 @Override
674 public int checkUriPermission(Uri uri, String readPermission,
675 String writePermission, int pid, int uid, int modeFlags) {
676 throw new UnsupportedOperationException();
677 }
678
679 @Override
680 public void enforceUriPermission(
681 Uri uri, int pid, int uid, int modeFlags, String message) {
682 throw new UnsupportedOperationException();
683 }
684
685 @Override
686 public void enforceCallingUriPermission(
687 Uri uri, int modeFlags, String message) {
688 throw new UnsupportedOperationException();
689 }
690
691 @Override
692 public void enforceCallingOrSelfUriPermission(
693 Uri uri, int modeFlags, String message) {
694 throw new UnsupportedOperationException();
695 }
696
697 public void enforceUriPermission(
698 Uri uri, String readPermission, String writePermission,
699 int pid, int uid, int modeFlags, String message) {
700 throw new UnsupportedOperationException();
701 }
702
703 @Override
704 public Context createPackageContext(String packageName, int flags)
705 throws PackageManager.NameNotFoundException {
706 throw new UnsupportedOperationException();
707 }
Romain Guy870e09f2009-07-06 16:35:25 -0700708
Jeff Sharkey6d515712012-09-20 16:06:08 -0700709 /** {@hide} */
710 @Override
Svetoslav976e8bd2014-07-16 15:12:03 -0700711 public Context createApplicationContext(ApplicationInfo application, int flags)
712 throws PackageManager.NameNotFoundException {
713 return null;
714 }
715
Adam Lesinski4e862812016-11-21 16:02:24 -0800716 /** @hide */
717 @Override
718 public Context createContextForSplit(String splitName)
719 throws PackageManager.NameNotFoundException {
720 throw new UnsupportedOperationException();
721 }
722
Svetoslav976e8bd2014-07-16 15:12:03 -0700723 /** {@hide} */
724 @Override
Jeff Sharkey6d515712012-09-20 16:06:08 -0700725 public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
726 throws PackageManager.NameNotFoundException {
727 throw new UnsupportedOperationException();
728 }
729
Jim Millera75a8832013-02-07 16:53:32 -0800730 /** {@hide} */
731 @Override
732 public int getUserId() {
733 throw new UnsupportedOperationException();
734 }
735
Romain Guy870e09f2009-07-06 16:35:25 -0700736 @Override
Dianne Hackborn756220b2012-08-14 16:45:30 -0700737 public Context createConfigurationContext(Configuration overrideConfiguration) {
738 throw new UnsupportedOperationException();
739 }
740
741 @Override
Jeff Browna492c3a2012-08-23 19:48:44 -0700742 public Context createDisplayContext(Display display) {
743 throw new UnsupportedOperationException();
744 }
745
746 @Override
Romain Guy870e09f2009-07-06 16:35:25 -0700747 public boolean isRestricted() {
Svetoslav976e8bd2014-07-16 15:12:03 -0700748 throw new UnsupportedOperationException();
Romain Guy870e09f2009-07-06 16:35:25 -0700749 }
Jeff Brown98365d72012-08-19 20:30:52 -0700750
751 /** @hide */
752 @Override
Craig Mautner48d0d182013-06-11 07:53:06 -0700753 public DisplayAdjustments getDisplayAdjustments(int displayId) {
Jeff Brown98365d72012-08-19 20:30:52 -0700754 throw new UnsupportedOperationException();
755 }
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700756
Adam Lesinski4ece3d62016-06-16 18:05:41 -0700757 /** @hide */
758 @Override
759 public Display getDisplay() {
760 throw new UnsupportedOperationException();
761 }
762
Andrii Kulianb047b8b2017-02-08 18:38:26 -0800763 /** @hide */
764 @Override
765 public void updateDisplay(int displayId) {
766 throw new UnsupportedOperationException();
767 }
768
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700769 @Override
770 public File[] getExternalFilesDirs(String type) {
771 throw new UnsupportedOperationException();
772 }
773
774 @Override
775 public File[] getObbDirs() {
776 throw new UnsupportedOperationException();
777 }
778
779 @Override
780 public File[] getExternalCacheDirs() {
781 throw new UnsupportedOperationException();
782 }
Jeff Sharkey2ee3c1e2014-05-30 15:38:35 -0700783
784 @Override
785 public File[] getExternalMediaDirs() {
786 throw new UnsupportedOperationException();
787 }
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700788
Fyodor Kupolov61221292016-09-02 15:21:03 -0700789 /** @hide **/
790 @Override
791 public File getPreloadsFileCache() { throw new UnsupportedOperationException(); }
792
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700793 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600794 public Context createDeviceProtectedStorageContext() {
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700795 throw new UnsupportedOperationException();
796 }
797
798 /** {@hide} */
799 @SystemApi
800 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600801 public Context createCredentialProtectedStorageContext() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700802 throw new UnsupportedOperationException();
803 }
804
805 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600806 public boolean isDeviceProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700807 throw new UnsupportedOperationException();
808 }
809
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700810 /** {@hide} */
811 @SystemApi
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700812 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600813 public boolean isCredentialProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700814 throw new UnsupportedOperationException();
815 }
Tony Mak46aabe52016-11-14 12:53:06 +0000816
817 /** {@hide} */
818 @Override
Seigo Nonaka6d6cd682017-06-22 08:22:18 -0700819 public boolean canLoadUnsafeResources() {
820 throw new UnsupportedOperationException();
821 }
822
823 /** {@hide} */
824 @Override
Tony Mak46aabe52016-11-14 12:53:06 +0000825 public IBinder getActivityToken() {
826 throw new UnsupportedOperationException();
827 }
828
829 /** {@hide} */
830 @Override
831 public IServiceConnection getServiceDispatcher(ServiceConnection conn, Handler handler,
832 int flags) {
833 throw new UnsupportedOperationException();
834 }
835
836 /** {@hide} */
837 @Override
838 public IApplicationThread getIApplicationThread() {
839 throw new UnsupportedOperationException();
840 }
Tony Makbf9928d2016-12-22 11:02:45 +0000841
842 /** {@hide} */
843 @Override
844 public Handler getMainThreadHandler() {
845 throw new UnsupportedOperationException();
846 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800847}