Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37d40d85 authored by Harry Cutts's avatar Harry Cutts
Browse files

TestableContext: override finished in TestWatcher

This is called on either test outcome, so we can deduplicate the code.

Bug: N/A
Test: $ atest --no-group-test \
    InputTests:com.android.server.input.debug.TouchpadDebugViewTest \
    InputTests:com.android.test.input.AnrTest
Flag: TEST_ONLY
Change-Id: Ibf4bfa489bd704acf00e8fcc0ff0a1f90538a511
parent bb798ae9
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -533,14 +533,7 @@ public class TestableContext extends ContextWrapper implements TestRule {
    public Statement apply(Statement base, Description description) {
        return new TestWatcher() {
            @Override
            protected void succeeded(Description description) {
                if (mSettingsProvider != null) {
                    mSettingsProvider.unregister();
                }
            }

            @Override
            protected void failed(Throwable e, Description description) {
            protected void finished(Description description) {
                if (mSettingsProvider != null) {
                    mSettingsProvider.unregister();
                }