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

Commit 8e34203c authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Add getApplicationContext to the mock implementation.

So that it'll be compatible with Loaders, which uses this method.
(Otherwise MockContext.getApplicationContext(), which just throws
an exception, will be used.)

Change-Id: I529b60466cf086b514fcddbef4583d1c5b750b9c
parent ed4fbd98
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -87,6 +87,11 @@ public abstract class ProviderTestCase2<T extends ContentProvider> extends Andro
            // one created through the regular Context
            return getContext().getDir("mockcontext2_" + name, mode);
        }

        @Override
        public Context getApplicationContext() {
            return this;
        }
    }
    /**
     * Constructor.