Merge "Explicitly take flags in createContextAsUser()"
am: a7948ddcb9
Change-Id: I6947903d66da1e64c461a1557e82a72a97a8848b
This commit is contained in:
@@ -1366,7 +1366,7 @@ package android.content {
|
||||
|
||||
public abstract class Context {
|
||||
method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public boolean bindServiceAsUser(@RequiresPermission android.content.Intent, android.content.ServiceConnection, int, android.os.UserHandle);
|
||||
method @NonNull public android.content.Context createContextAsUser(@NonNull android.os.UserHandle);
|
||||
method @NonNull public android.content.Context createContextAsUser(@NonNull android.os.UserHandle, int);
|
||||
method public abstract android.content.Context createCredentialProtectedStorageContext();
|
||||
method @NonNull public android.content.Context createPackageContextAsUser(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
|
||||
method @Nullable public abstract java.io.File getPreloadsFileCache();
|
||||
|
||||
@@ -640,7 +640,7 @@ package android.content {
|
||||
}
|
||||
|
||||
public abstract class Context {
|
||||
method @NonNull public android.content.Context createContextAsUser(@NonNull android.os.UserHandle);
|
||||
method @NonNull public android.content.Context createContextAsUser(@NonNull android.os.UserHandle, int);
|
||||
method @NonNull public android.content.Context createPackageContextAsUser(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
|
||||
method public abstract android.view.Display getDisplay();
|
||||
method public abstract int getDisplayId();
|
||||
|
||||
@@ -2224,9 +2224,9 @@ class ContextImpl extends Context {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context createContextAsUser(UserHandle user) {
|
||||
public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) {
|
||||
try {
|
||||
return createPackageContextAsUser(getPackageName(), mFlags, user);
|
||||
return createPackageContextAsUser(getPackageName(), flags, user);
|
||||
} catch (NameNotFoundException e) {
|
||||
throw new IllegalStateException("Own package not found: package=" + getPackageName());
|
||||
}
|
||||
|
||||
@@ -5284,7 +5284,7 @@ public abstract class Context {
|
||||
@SystemApi
|
||||
@TestApi
|
||||
@NonNull
|
||||
public Context createContextAsUser(@NonNull UserHandle user) {
|
||||
public Context createContextAsUser(@NonNull UserHandle user, @CreatePackageOptions int flags) {
|
||||
if (Build.IS_ENG) {
|
||||
throw new IllegalStateException("createContextAsUser not overridden!");
|
||||
}
|
||||
|
||||
@@ -898,8 +898,8 @@ public class ContextWrapper extends Context {
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public Context createContextAsUser(UserHandle user) {
|
||||
return mBase.createContextAsUser(user);
|
||||
public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) {
|
||||
return mBase.createContextAsUser(user, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
|
||||
@@ -765,7 +765,7 @@ public class MockContext extends Context {
|
||||
|
||||
/** {@hide} */
|
||||
@Override
|
||||
public Context createContextAsUser(UserHandle user) {
|
||||
public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user