Skip to content

Commit 9f18bd1

Browse files
author
Sergey Vasilinets
committed
Clean up InspectorEnvironment from ArtToolInterface methods
fixes: 161568929 fixes: 163335801 Test: ./gradlew :workmanager:workmanager-inspec:cC Change-Id: I9badc0ee07f0cd8e89d16835c287eed696571e55
1 parent 36023e5 commit 9f18bd1

2 files changed

Lines changed: 3 additions & 76 deletions

File tree

‎inspection/inspection/src/main/java/androidx/inspection/InspectorEnvironment.java‎

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,11 @@
1818

1919
import androidx.annotation.NonNull;
2020

21-
import java.util.List;
22-
2321
/**
2422
* This interface provides inspector specific utilities, such as
2523
* managed threads and ARTTI features.
2624
*/
27-
//TODO(b/163335801): remove "extends ArtToolInterface"
28-
// /temporary implements ArtToolInterface to ease drop to Studio.
29-
public interface InspectorEnvironment extends ArtToolInterface {
30-
31-
// TODO: will be removed once studio and clients are migrated
32-
/**
33-
* This interface will be removed
34-
* @param <T>
35-
*/
36-
interface ExitHook<T> extends ArtToolInterface.ExitHook<T> {
37-
}
38-
39-
/**
40-
* This interface will be removed
41-
*/
42-
interface EntryHook extends ArtToolInterface.EntryHook {
43-
}
25+
public interface InspectorEnvironment {
4426

4527
/**
4628
* Executors provided by App Inspection Platforms. Clients should use it instead of
@@ -55,44 +37,5 @@ default InspectorExecutors executors() {
5537
* Interface that provides ART TI capabilities.
5638
*/
5739
@NonNull
58-
default ArtToolInterface artTI() {
59-
return this;
60-
}
61-
62-
// Temporary default implementations (so they can be removed from actual implementation of
63-
// InspectorEnvironment
64-
@NonNull
65-
@Override
66-
default <T> List<T> findInstances(@NonNull Class<T> clazz) {
67-
return artTI().findInstances(clazz);
68-
}
69-
70-
@Override
71-
default void registerEntryHook(@NonNull Class<?> originClass, @NonNull String originMethod,
72-
@NonNull ArtToolInterface.EntryHook entryHook) {
73-
artTI().registerEntryHook(originClass, originMethod, entryHook);
74-
}
75-
76-
@Override
77-
default <T> void registerExitHook(@NonNull Class<?> originClass, @NonNull String originMethod,
78-
@NonNull ArtToolInterface.ExitHook<T> exitHook) {
79-
artTI().registerExitHook(originClass, originMethod, exitHook);
80-
}
81-
82-
/**
83-
* Temporary method for backwards compat. TODO(b/163335801)
84-
*/
85-
default void registerEntryHook(@NonNull Class<?> originClass, @NonNull String originMethod,
86-
@NonNull EntryHook entryHook) {
87-
artTI().registerEntryHook(originClass, originMethod, entryHook);
88-
}
89-
90-
/**
91-
* Temporary method for backwards compat. TODO(b/163335801)
92-
*/
93-
default <T> void registerExitHook(@NonNull Class<?> originClass, @NonNull String originMethod,
94-
@NonNull ExitHook<T> exitHook) {
95-
artTI().registerExitHook(originClass, originMethod, exitHook);
96-
}
97-
40+
ArtToolInterface artTI();
9841
}

‎sqlite/sqlite-inspection/src/androidTest/java/androidx/sqlite/inspection/RoomInvalidationRegistryWithoutRoomTest.kt‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,7 @@ class RoomInvalidationRegistryWithoutRoomTest {
3535
// this does not really assert anything, we just want to make sure it does not crash and
3636
// never makes a call to the environment if Room is not available.
3737
val env = object : InspectorEnvironment {
38-
override fun registerEntryHook(
39-
originClass: Class<*>,
40-
originMethod: String,
41-
entryHook: ArtToolInterface.EntryHook
42-
) {
43-
throw AssertionError("should never call environment")
44-
}
45-
46-
override fun <T : Any?> findInstances(clazz: Class<T>): MutableList<T> {
47-
throw AssertionError("should never call environment")
48-
}
49-
50-
override fun <T : Any?> registerExitHook(
51-
originClass: Class<*>,
52-
originMethod: String,
53-
exitHook: ArtToolInterface.ExitHook<T>
54-
) {
38+
override fun artTI(): ArtToolInterface {
5539
throw AssertionError("should never call environment")
5640
}
5741
}

0 commit comments

Comments
 (0)