blob: fa5b896ea1268aee4481c964673473a3c7bdc412 [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;
Jeff Sharkey8439ac02017-12-12 17:26:23 -070022import android.content.BroadcastReceiver;
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;
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;
Jeff Browna492c3a2012-08-23 19:48:44 -070046import android.view.Display;
Jeff Sharkey8439ac02017-12-12 17:26:23 -070047import android.view.DisplayAdjustments;
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;
Jeff Sharkey8439ac02017-12-12 17:26:23 -070055import java.util.concurrent.Executor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
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
Jeff Sharkey8439ac02017-12-12 17:26:23 -070090 public Executor getMainExecutor() {
91 throw new UnsupportedOperationException();
92 }
93
94 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095 public Context getApplicationContext() {
96 throw new UnsupportedOperationException();
97 }
Stephan Linznerb51617f2016-01-27 18:09:50 -080098
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080099 @Override
100 public void setTheme(int resid) {
101 throw new UnsupportedOperationException();
102 }
103
104 @Override
105 public Resources.Theme getTheme() {
106 throw new UnsupportedOperationException();
107 }
108
109 @Override
110 public ClassLoader getClassLoader() {
111 throw new UnsupportedOperationException();
112 }
113
114 @Override
115 public String getPackageName() {
116 throw new UnsupportedOperationException();
117 }
118
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800119 /** @hide */
120 @Override
121 public String getBasePackageName() {
122 throw new UnsupportedOperationException();
123 }
124
Dianne Hackborn95d78532013-09-11 09:51:14 -0700125 /** @hide */
126 @Override
127 public String getOpPackageName() {
128 throw new UnsupportedOperationException();
129 }
130
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800131 @Override
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700132 public ApplicationInfo getApplicationInfo() {
133 throw new UnsupportedOperationException();
134 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800135
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700136 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 public String getPackageResourcePath() {
138 throw new UnsupportedOperationException();
139 }
140
Joe Onorato23ecae32009-06-10 17:07:15 -0700141 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 public String getPackageCodePath() {
143 throw new UnsupportedOperationException();
144 }
145
146 @Override
147 public SharedPreferences getSharedPreferences(String name, int mode) {
148 throw new UnsupportedOperationException();
149 }
150
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600151 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800152 @Override
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700153 public SharedPreferences getSharedPreferences(File file, int mode) {
154 throw new UnsupportedOperationException();
155 }
156
Christopher Tatefe2368c2017-05-17 15:42:35 -0700157 /** @hide */
158 @Override
159 public void reloadSharedPreferences() {
160 throw new UnsupportedOperationException();
161 }
162
Jeff Sharkey8fc29cf2015-11-30 17:51:00 -0700163 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600164 public boolean moveSharedPreferencesFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700165 throw new UnsupportedOperationException();
166 }
167
168 @Override
169 public boolean deleteSharedPreferences(String name) {
170 throw new UnsupportedOperationException();
171 }
172
173 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800174 public FileInputStream openFileInput(String name) throws FileNotFoundException {
175 throw new UnsupportedOperationException();
176 }
177
178 @Override
179 public FileOutputStream openFileOutput(String name, int mode) throws FileNotFoundException {
180 throw new UnsupportedOperationException();
181 }
182
183 @Override
184 public boolean deleteFile(String name) {
185 throw new UnsupportedOperationException();
186 }
187
188 @Override
189 public File getFileStreamPath(String name) {
190 throw new UnsupportedOperationException();
191 }
192
Jeff Sharkey70168dd2016-03-30 21:47:16 -0600193 /** @removed */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800194 @Override
Jeff Sharkey6a6cdaf2015-12-07 19:25:19 -0700195 public File getSharedPreferencesPath(String name) {
196 throw new UnsupportedOperationException();
197 }
198
199 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800200 public String[] fileList() {
201 throw new UnsupportedOperationException();
202 }
203
204 @Override
Jeff Sharkey2c1ba9a2016-02-17 15:29:38 -0700205 public File getDataDir() {
206 throw new UnsupportedOperationException();
207 }
208
209 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800210 public File getFilesDir() {
211 throw new UnsupportedOperationException();
212 }
213
214 @Override
Christopher Tatea7835b62014-07-11 17:25:57 -0700215 public File getNoBackupFilesDir() {
216 throw new UnsupportedOperationException();
217 }
218
219 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800220 public File getExternalFilesDir(String type) {
221 throw new UnsupportedOperationException();
222 }
223
224 @Override
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800225 public File getObbDir() {
226 throw new UnsupportedOperationException();
227 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800228
Dianne Hackborn805fd7e2011-01-16 18:30:29 -0800229 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800230 public File getCacheDir() {
231 throw new UnsupportedOperationException();
232 }
233
234 @Override
Jeff Sharkey4ed745d2014-07-15 20:39:15 -0700235 public File getCodeCacheDir() {
236 throw new UnsupportedOperationException();
237 }
238
239 @Override
Dianne Hackborne83cefce2010-02-04 17:38:14 -0800240 public File getExternalCacheDir() {
241 throw new UnsupportedOperationException();
242 }
243
244 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 public File getDir(String name, int mode) {
246 throw new UnsupportedOperationException();
247 }
248
249 @Override
Stephan Linznerb51617f2016-01-27 18:09:50 -0800250 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800251 SQLiteDatabase.CursorFactory factory) {
252 throw new UnsupportedOperationException();
253 }
254
255 @Override
Vasu Nori74f170f2010-06-01 18:06:18 -0700256 public SQLiteDatabase openOrCreateDatabase(String file, int mode,
257 SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) {
258 throw new UnsupportedOperationException();
259 }
260
261 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800262 public File getDatabasePath(String name) {
263 throw new UnsupportedOperationException();
264 }
265
266 @Override
267 public String[] databaseList() {
268 throw new UnsupportedOperationException();
269 }
270
271 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600272 public boolean moveDatabaseFrom(Context sourceContext, String name) {
Jeff Sharkey35871f22016-01-29 17:13:29 -0700273 throw new UnsupportedOperationException();
274 }
275
276 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800277 public boolean deleteDatabase(String name) {
278 throw new UnsupportedOperationException();
279 }
280
281 @Override
282 public Drawable getWallpaper() {
283 throw new UnsupportedOperationException();
284 }
285
286 @Override
287 public Drawable peekWallpaper() {
288 throw new UnsupportedOperationException();
289 }
290
291 @Override
292 public int getWallpaperDesiredMinimumWidth() {
293 throw new UnsupportedOperationException();
294 }
295
296 @Override
297 public int getWallpaperDesiredMinimumHeight() {
298 throw new UnsupportedOperationException();
299 }
300
301 @Override
302 public void setWallpaper(Bitmap bitmap) throws IOException {
303 throw new UnsupportedOperationException();
304 }
305
306 @Override
307 public void setWallpaper(InputStream data) throws IOException {
308 throw new UnsupportedOperationException();
309 }
310
311 @Override
312 public void clearWallpaper() {
313 throw new UnsupportedOperationException();
314 }
315
316 @Override
317 public void startActivity(Intent intent) {
318 throw new UnsupportedOperationException();
319 }
320
321 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700322 public void startActivity(Intent intent, Bundle options) {
323 startActivity(intent);
324 }
325
326 @Override
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800327 public void startActivities(Intent[] intents) {
328 throw new UnsupportedOperationException();
329 }
330
331 @Override
Dianne Hackborna4972e92012-03-14 10:38:05 -0700332 public void startActivities(Intent[] intents, Bundle options) {
333 startActivities(intents);
334 }
335
336 @Override
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700337 public void startIntentSender(IntentSender intent,
338 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
339 throws IntentSender.SendIntentException {
340 throw new UnsupportedOperationException();
341 }
Dianne Hackborna4972e92012-03-14 10:38:05 -0700342
343 @Override
344 public void startIntentSender(IntentSender intent,
345 Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags,
346 Bundle options) throws IntentSender.SendIntentException {
347 startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags);
348 }
Stephan Linznerb51617f2016-01-27 18:09:50 -0800349
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700350 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800351 public void sendBroadcast(Intent intent) {
352 throw new UnsupportedOperationException();
353 }
354
Amith Yamasani67cf7d32012-02-16 14:31:23 -0800355 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 public void sendBroadcast(Intent intent, String receiverPermission) {
357 throw new UnsupportedOperationException();
358 }
359
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800360 /** @hide */
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700361 @Override
362 public void sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) {
363 throw new UnsupportedOperationException();
364 }
365
366 /** @hide */
Tyler Gunnf955e562018-04-26 14:43:31 -0700367 @Override
368 public void sendBroadcastAsUserMultiplePermissions(Intent intent, UserHandle user,
369 String[] receiverPermissions) {
370 throw new UnsupportedOperationException();
371 }
372
373 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700374 @SystemApi
375 @Override
376 public void sendBroadcast(Intent intent, String receiverPermission, Bundle options) {
377 throw new UnsupportedOperationException();
378 }
379
380 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800381 @Override
382 public void sendBroadcast(Intent intent, String receiverPermission, int appOp) {
383 throw new UnsupportedOperationException();
384 }
385
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800386 @Override
387 public void sendOrderedBroadcast(Intent intent,
388 String receiverPermission) {
389 throw new UnsupportedOperationException();
390 }
391
392 @Override
393 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
394 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
395 Bundle initialExtras) {
396 throw new UnsupportedOperationException();
397 }
398
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800399 /** @hide */
Dianne Hackborna750a632015-06-16 17:18:23 -0700400 @SystemApi
401 @Override
402 public void sendOrderedBroadcast(Intent intent, String receiverPermission,
403 Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
404 Bundle initialExtras) {
405 throw new UnsupportedOperationException();
406 }
407
408 /** @hide */
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800409 @Override
410 public void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp,
411 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
412 Bundle initialExtras) {
413 throw new UnsupportedOperationException();
414 }
415
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800416 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700417 public void sendBroadcastAsUser(Intent intent, UserHandle user) {
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700418 throw new UnsupportedOperationException();
419 }
420
421 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700422 public void sendBroadcastAsUser(Intent intent, UserHandle user,
423 String receiverPermission) {
424 throw new UnsupportedOperationException();
425 }
426
Svet Ganov16a16892015-04-16 10:32:04 -0700427 /** @hide */
Chad Brubaker52c8edc2016-07-25 14:30:26 -0700428 @SystemApi
429 @Override
430 public void sendBroadcastAsUser(Intent intent, UserHandle user,
431 String receiverPermission, Bundle options) {
432 throw new UnsupportedOperationException();
433 }
434
435 /** @hide */
Svet Ganov16a16892015-04-16 10:32:04 -0700436 @Override
437 public void sendBroadcastAsUser(Intent intent, UserHandle user,
438 String receiverPermission, int appOp) {
439 throw new UnsupportedOperationException();
440 }
441
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700442 @Override
Dianne Hackborn79af1dd2012-08-16 16:42:52 -0700443 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700444 String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler,
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700445 int initialCode, String initialData, Bundle initialExtras) {
446 throw new UnsupportedOperationException();
447 }
448
Amith Yamasani3cf75722014-05-16 12:37:29 -0700449 /** @hide */
Dianne Hackborn7d19e022012-08-07 19:12:33 -0700450 @Override
Amith Yamasani3cf75722014-05-16 12:37:29 -0700451 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
452 String receiverPermission, int appOp, BroadcastReceiver resultReceiver,
Dianne Hackbornfd854ee2015-07-13 18:00:37 -0700453 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
454 throw new UnsupportedOperationException();
455 }
456
457 /** @hide */
458 @Override
459 public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
460 String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver,
461 Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
Amith Yamasani3cf75722014-05-16 12:37:29 -0700462 throw new UnsupportedOperationException();
463 }
464
465 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800466 public void sendStickyBroadcast(Intent intent) {
467 throw new UnsupportedOperationException();
468 }
469
470 @Override
Dianne Hackbornefa199f2009-09-19 12:03:15 -0700471 public void sendStickyOrderedBroadcast(Intent intent,
472 BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData,
473 Bundle initialExtras) {
474 throw new UnsupportedOperationException();
475 }
476
477 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800478 public void removeStickyBroadcast(Intent intent) {
479 throw new UnsupportedOperationException();
480 }
481
482 @Override
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700483 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) {
484 throw new UnsupportedOperationException();
485 }
486
Dianne Hackborne0e413e2015-12-09 17:22:26 -0800487 /** @hide */
488 @Override
489 public void sendStickyBroadcastAsUser(Intent intent, UserHandle user, Bundle options) {
490 throw new UnsupportedOperationException();
491 }
492
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700493 @Override
494 public void sendStickyOrderedBroadcastAsUser(Intent intent,
495 UserHandle user, BroadcastReceiver resultReceiver,
496 Handler scheduler, int initialCode, String initialData,
497 Bundle initialExtras) {
498 throw new UnsupportedOperationException();
499 }
500
501 @Override
502 public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) {
503 throw new UnsupportedOperationException();
504 }
505
506 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800507 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
508 throw new UnsupportedOperationException();
509 }
510
511 @Override
512 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
Chad Brubaker6d6015f2017-04-18 11:25:16 -0700513 int flags) {
Chad Brubaker816c83b2017-03-02 10:27:59 -0800514 throw new UnsupportedOperationException();
515 }
516
517 @Override
518 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800519 String broadcastPermission, Handler scheduler) {
520 throw new UnsupportedOperationException();
521 }
522
Chad Brubaker816c83b2017-03-02 10:27:59 -0800523 @Override
524 public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter,
Chad Brubaker6d6015f2017-04-18 11:25:16 -0700525 String broadcastPermission, Handler scheduler, int flags) {
Chad Brubaker816c83b2017-03-02 10:27:59 -0800526 throw new UnsupportedOperationException();
527 }
528
Dianne Hackborn20e80982012-08-31 19:00:44 -0700529 /** @hide */
530 @Override
531 public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user,
532 IntentFilter filter, String broadcastPermission, Handler scheduler) {
533 throw new UnsupportedOperationException();
534 }
535
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800536 @Override
537 public void unregisterReceiver(BroadcastReceiver receiver) {
538 throw new UnsupportedOperationException();
539 }
540
541 @Override
542 public ComponentName startService(Intent service) {
543 throw new UnsupportedOperationException();
544 }
545
546 @Override
Christopher Tate08992ac2017-03-21 11:37:06 -0700547 public ComponentName startForegroundService(Intent service) {
548 throw new UnsupportedOperationException();
549 }
550
Christopher Tate42a386b2016-11-07 12:21:21 -0800551 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800552 public boolean stopService(Intent service) {
553 throw new UnsupportedOperationException();
554 }
555
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700556 /** @hide */
557 @Override
558 public ComponentName startServiceAsUser(Intent service, UserHandle user) {
559 throw new UnsupportedOperationException();
560 }
561
562 /** @hide */
563 @Override
Christopher Tate08992ac2017-03-21 11:37:06 -0700564 public ComponentName startForegroundServiceAsUser(Intent service, UserHandle user) {
565 throw new UnsupportedOperationException();
566 }
567
Christopher Tate42a386b2016-11-07 12:21:21 -0800568 /** @hide */
569 @Override
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700570 public boolean stopServiceAsUser(Intent service, UserHandle user) {
571 throw new UnsupportedOperationException();
572 }
573
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800574 @Override
575 public boolean bindService(Intent service, ServiceConnection conn, int flags) {
576 throw new UnsupportedOperationException();
577 }
578
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800579 /** @hide */
580 @Override
Amith Yamasani27b89e62013-01-16 12:30:11 -0800581 public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags,
582 UserHandle user) {
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800583 throw new UnsupportedOperationException();
584 }
585
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800586 @Override
587 public void unbindService(ServiceConnection conn) {
588 throw new UnsupportedOperationException();
589 }
590
591 @Override
592 public boolean startInstrumentation(ComponentName className,
593 String profileFile, Bundle arguments) {
594 throw new UnsupportedOperationException();
595 }
596
597 @Override
598 public Object getSystemService(String name) {
599 throw new UnsupportedOperationException();
600 }
601
602 @Override
Jeff Brown6e539312015-02-24 18:53:21 -0800603 public String getSystemServiceName(Class<?> serviceClass) {
604 throw new UnsupportedOperationException();
605 }
606
607 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800608 public int checkPermission(String permission, int pid, int uid) {
609 throw new UnsupportedOperationException();
610 }
611
Dianne Hackbornff170242014-11-19 10:59:01 -0800612 /** @hide */
613 @Override
614 public int checkPermission(String permission, int pid, int uid, IBinder callerToken) {
615 return checkPermission(permission, pid, uid);
616 }
617
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800618 @Override
619 public int checkCallingPermission(String permission) {
620 throw new UnsupportedOperationException();
621 }
622
623 @Override
624 public int checkCallingOrSelfPermission(String permission) {
625 throw new UnsupportedOperationException();
626 }
627
628 @Override
Svetoslavc6d1c342015-02-26 14:44:43 -0800629 public int checkSelfPermission(String permission) {
630 throw new UnsupportedOperationException();
631 }
632
633 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800634 public void enforcePermission(
635 String permission, int pid, int uid, String message) {
636 throw new UnsupportedOperationException();
637 }
638
639 @Override
640 public void enforceCallingPermission(String permission, String message) {
641 throw new UnsupportedOperationException();
642 }
643
644 @Override
645 public void enforceCallingOrSelfPermission(String permission, String message) {
646 throw new UnsupportedOperationException();
647 }
648
649 @Override
650 public void grantUriPermission(String toPackage, Uri uri, int modeFlags) {
651 throw new UnsupportedOperationException();
652 }
653
654 @Override
655 public void revokeUriPermission(Uri uri, int modeFlags) {
656 throw new UnsupportedOperationException();
657 }
658
659 @Override
Dianne Hackborna47223f2017-03-30 13:49:13 -0700660 public void revokeUriPermission(String targetPackage, Uri uri, int modeFlags) {
661 throw new UnsupportedOperationException();
662 }
663
664 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800665 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags) {
666 throw new UnsupportedOperationException();
667 }
668
Dianne Hackbornff170242014-11-19 10:59:01 -0800669 /** @hide */
670 @Override
671 public int checkUriPermission(Uri uri, int pid, int uid, int modeFlags, IBinder callerToken) {
672 return checkUriPermission(uri, pid, uid, modeFlags);
673 }
674
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800675 @Override
676 public int checkCallingUriPermission(Uri uri, int modeFlags) {
677 throw new UnsupportedOperationException();
678 }
679
680 @Override
681 public int checkCallingOrSelfUriPermission(Uri uri, int modeFlags) {
682 throw new UnsupportedOperationException();
683 }
684
685 @Override
686 public int checkUriPermission(Uri uri, String readPermission,
687 String writePermission, int pid, int uid, int modeFlags) {
688 throw new UnsupportedOperationException();
689 }
690
691 @Override
692 public void enforceUriPermission(
693 Uri uri, int pid, int uid, int modeFlags, String message) {
694 throw new UnsupportedOperationException();
695 }
696
697 @Override
698 public void enforceCallingUriPermission(
699 Uri uri, int modeFlags, String message) {
700 throw new UnsupportedOperationException();
701 }
702
703 @Override
704 public void enforceCallingOrSelfUriPermission(
705 Uri uri, int modeFlags, String message) {
706 throw new UnsupportedOperationException();
707 }
708
709 public void enforceUriPermission(
710 Uri uri, String readPermission, String writePermission,
711 int pid, int uid, int modeFlags, String message) {
712 throw new UnsupportedOperationException();
713 }
714
715 @Override
716 public Context createPackageContext(String packageName, int flags)
717 throws PackageManager.NameNotFoundException {
718 throw new UnsupportedOperationException();
719 }
Romain Guy870e09f2009-07-06 16:35:25 -0700720
Jeff Sharkey6d515712012-09-20 16:06:08 -0700721 /** {@hide} */
722 @Override
Svetoslav976e8bd2014-07-16 15:12:03 -0700723 public Context createApplicationContext(ApplicationInfo application, int flags)
724 throws PackageManager.NameNotFoundException {
725 return null;
726 }
727
Adam Lesinski4e862812016-11-21 16:02:24 -0800728 /** @hide */
729 @Override
730 public Context createContextForSplit(String splitName)
731 throws PackageManager.NameNotFoundException {
732 throw new UnsupportedOperationException();
733 }
734
Svetoslav976e8bd2014-07-16 15:12:03 -0700735 /** {@hide} */
736 @Override
Jeff Sharkey6d515712012-09-20 16:06:08 -0700737 public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
738 throws PackageManager.NameNotFoundException {
739 throw new UnsupportedOperationException();
740 }
741
Jim Millera75a8832013-02-07 16:53:32 -0800742 /** {@hide} */
743 @Override
744 public int getUserId() {
745 throw new UnsupportedOperationException();
746 }
747
Romain Guy870e09f2009-07-06 16:35:25 -0700748 @Override
Dianne Hackborn756220b2012-08-14 16:45:30 -0700749 public Context createConfigurationContext(Configuration overrideConfiguration) {
750 throw new UnsupportedOperationException();
751 }
752
753 @Override
Jeff Browna492c3a2012-08-23 19:48:44 -0700754 public Context createDisplayContext(Display display) {
755 throw new UnsupportedOperationException();
756 }
757
758 @Override
Romain Guy870e09f2009-07-06 16:35:25 -0700759 public boolean isRestricted() {
Svetoslav976e8bd2014-07-16 15:12:03 -0700760 throw new UnsupportedOperationException();
Romain Guy870e09f2009-07-06 16:35:25 -0700761 }
Jeff Brown98365d72012-08-19 20:30:52 -0700762
763 /** @hide */
764 @Override
Craig Mautner48d0d182013-06-11 07:53:06 -0700765 public DisplayAdjustments getDisplayAdjustments(int displayId) {
Jeff Brown98365d72012-08-19 20:30:52 -0700766 throw new UnsupportedOperationException();
767 }
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700768
Adam Lesinski4ece3d62016-06-16 18:05:41 -0700769 /** @hide */
770 @Override
771 public Display getDisplay() {
772 throw new UnsupportedOperationException();
773 }
774
Andrii Kulianb047b8b2017-02-08 18:38:26 -0800775 /** @hide */
776 @Override
Yohei Yukawa5281b6b2018-10-15 07:38:25 +0800777 public int getDisplayId() {
778 throw new UnsupportedOperationException();
779 }
780
781 /** @hide */
782 @Override
Andrii Kulianb047b8b2017-02-08 18:38:26 -0800783 public void updateDisplay(int displayId) {
784 throw new UnsupportedOperationException();
785 }
786
Jeff Sharkey7f392de2013-08-11 17:42:17 -0700787 @Override
788 public File[] getExternalFilesDirs(String type) {
789 throw new UnsupportedOperationException();
790 }
791
792 @Override
793 public File[] getObbDirs() {
794 throw new UnsupportedOperationException();
795 }
796
797 @Override
798 public File[] getExternalCacheDirs() {
799 throw new UnsupportedOperationException();
800 }
Jeff Sharkey2ee3c1e2014-05-30 15:38:35 -0700801
802 @Override
803 public File[] getExternalMediaDirs() {
804 throw new UnsupportedOperationException();
805 }
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700806
Fyodor Kupolov61221292016-09-02 15:21:03 -0700807 /** @hide **/
808 @Override
809 public File getPreloadsFileCache() { throw new UnsupportedOperationException(); }
810
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700811 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600812 public Context createDeviceProtectedStorageContext() {
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700813 throw new UnsupportedOperationException();
814 }
815
816 /** {@hide} */
817 @SystemApi
818 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600819 public Context createCredentialProtectedStorageContext() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700820 throw new UnsupportedOperationException();
821 }
822
823 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600824 public boolean isDeviceProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700825 throw new UnsupportedOperationException();
826 }
827
Jeff Sharkeye13529a2015-12-09 14:15:27 -0700828 /** {@hide} */
829 @SystemApi
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700830 @Override
Jeff Sharkey8a372a02016-03-16 16:25:45 -0600831 public boolean isCredentialProtectedStorage() {
Jeff Sharkey7a30a302015-12-08 14:20:06 -0700832 throw new UnsupportedOperationException();
833 }
Tony Mak46aabe52016-11-14 12:53:06 +0000834
835 /** {@hide} */
836 @Override
Seigo Nonaka6d6cd682017-06-22 08:22:18 -0700837 public boolean canLoadUnsafeResources() {
838 throw new UnsupportedOperationException();
839 }
840
841 /** {@hide} */
842 @Override
Tony Mak46aabe52016-11-14 12:53:06 +0000843 public IBinder getActivityToken() {
844 throw new UnsupportedOperationException();
845 }
846
847 /** {@hide} */
848 @Override
849 public IServiceConnection getServiceDispatcher(ServiceConnection conn, Handler handler,
850 int flags) {
851 throw new UnsupportedOperationException();
852 }
853
854 /** {@hide} */
855 @Override
856 public IApplicationThread getIApplicationThread() {
857 throw new UnsupportedOperationException();
858 }
Tony Makbf9928d2016-12-22 11:02:45 +0000859
860 /** {@hide} */
861 @Override
862 public Handler getMainThreadHandler() {
863 throw new UnsupportedOperationException();
864 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800865}