Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Activity's member Instrumentation in ActivityController #6860

Merged
merged 1 commit into from Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -7,7 +7,6 @@
import static org.robolectric.util.reflector.Reflector.reflector;

import android.app.Activity;
import android.app.ActivityThread;
import android.app.Application;
import android.app.Instrumentation;
import android.content.ComponentName;
Expand Down Expand Up @@ -502,8 +501,9 @@ public ActivityController<T> recreate() {
}
}

private static Instrumentation getInstrumentation() {
return ((ActivityThread) RuntimeEnvironment.getActivityThread()).getInstrumentation();
// Get the Instrumentation object scoped to the Activity.
private Instrumentation getInstrumentation() {
return _component_.getInstrumentation();
}

/** Accessor interface for android.app.Activity.NonConfigurationInstances's internals. */
Expand Down
Expand Up @@ -372,4 +372,7 @@ void setVoiceInteractor(

@Accessor("mConfigChangeFlags")
void setConfigChangeFlags(int value);

@Accessor("mInstrumentation")
Instrumentation getInstrumentation();
}