1818
1919import static androidx .test .internal .util .Checks .checkNotNull ;
2020
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 ;
2621import java .util .concurrent .atomic .AtomicReference ;
2722
2823/** Holds Espresso's object graph. */
@@ -43,10 +38,6 @@ static BaseLayerComponent baseLayer() {
4338 if (null == instanceRef ) {
4439 instanceRef = new GraphHolder (DaggerBaseLayerComponent .create ());
4540 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 ());
5041 return instanceRef .component ;
5142 } else {
5243 return instance .get ().component ;
@@ -55,19 +46,4 @@ static BaseLayerComponent baseLayer() {
5546 return instanceRef .component ;
5647 }
5748 }
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- }
7349}
0 commit comments