Add Context.createContextAsUser()

Without it, apps (mainline modules) will need to use createPackageContext...,
which is a bit painful.

Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id640e03862462724df1a4a3101f0b08faafba22f
This commit is contained in:
Makoto Onuki
2019-10-09 15:33:11 -07:00
parent b71657a60a
commit b844001d6a
6 changed files with 44 additions and 3 deletions

View File

@@ -756,6 +756,12 @@ public class MockContext extends Context {
throw new UnsupportedOperationException();
}
/** {@hide} */
@Override
public Context createContextAsUser(UserHandle user) {
throw new UnsupportedOperationException();
}
/** {@hide} */
@Override
public int getUserId() {