18
18
19
19
import static androidx .test .internal .util .Checks .checkNotNull ;
20
20
21
- import android .util .Log ;
22
- import androidx .test .platform .io .PlatformTestStorage ;
23
- import java .io .Serializable ;
24
- import java .util .HashMap ;
25
- import java .util .Map ;
26
21
import java .util .concurrent .atomic .AtomicReference ;
27
22
28
23
/** Holds Espresso's object graph. */
@@ -43,10 +38,6 @@ static BaseLayerComponent baseLayer() {
43
38
if (null == instanceRef ) {
44
39
instanceRef = new GraphHolder (DaggerBaseLayerComponent .create ());
45
40
if (instance .compareAndSet (null , instanceRef )) {
46
- // Also adds the usage data as test output properties. By default it's no-op.
47
- Map <String , Serializable > usageProperties = new HashMap <>();
48
- usageProperties .put ("Espresso" , "1" );
49
- addUsageToOutputProperties (usageProperties , instanceRef .component .testStorage ());
50
41
return instanceRef .component ;
51
42
} else {
52
43
return instance .get ().component ;
@@ -55,19 +46,4 @@ static BaseLayerComponent baseLayer() {
55
46
return instanceRef .component ;
56
47
}
57
48
}
58
-
59
- private static void addUsageToOutputProperties (
60
- Map <String , Serializable > usageProperties , PlatformTestStorage testStorage ) {
61
- try {
62
- testStorage .addOutputProperties (usageProperties );
63
- } catch (RuntimeException e ) {
64
- // The properties.dat file can be created only once on an automotive emulator with API 30,
65
- // which causes the `addOutputProperties` call to fail when running multiple test cases. Catch
66
- // the exception and log until the issue is fixed in the emulator.
67
- Log .w (
68
- TAG ,
69
- "Failed to add the output properties. This could happen when running on Robolectric or an"
70
- + " automotive emulator with API 30. Ignore for now." );
71
- }
72
- }
73
49
}
0 commit comments