You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A custom `Context` implementation that allows for easy customization of common `Context` properties. This allows experimenting with "app level" interactions while using `app_process` instead.
3
+
A custom `Context` implementation and other core features that allows for easy customization of common core Android classes. This allows experimenting with "app level" interactions while using `app_process` instead.
4
+
5
+
## Usage
6
+
7
+
Set up your process by calling:
8
+
9
+
```kotlin
10
+
Common.initialize(classLoader)
11
+
```
12
+
13
+
This will set up your thread and initialize some core systems set up by `ActivityThread` during a normal app launch.
var mockAttributionSource:AttributionSource?=AttributionSource.Builder(1000).setPackageName("com.android.settings").setAttributionTag("*tag*").build()
26
+
var mockAttributionSource:AttributionSource?=AttributionSource.Builder(1000).setPackageName(basePackageName ?:"com.android.settings").setAttributionTag("*tag*").build()
27
27
privateval services = mutableMapOf<String, Any>()
28
28
var mockApplicationContext:Context?=null
29
29
var mockResources:Resources?=null
30
-
var mockPackageName:String?=null
30
+
var mockPackageName:String?=basePackageName
31
31
var mockPackageResourcePath:String?=null
32
32
var mockPackageCodePath:String?=null
33
33
var mockAssets:AssetManager?=null
@@ -49,15 +49,34 @@ class MockContext(base: Context) : ContextWrapper(base) {
49
49
var mockUnregisterReceiver: ((BroadcastReceiver?) ->Unit)?=null
0 commit comments