Merge "Explicitly take flags in createContextAsUser()"
This commit is contained in:
@@ -1366,7 +1366,7 @@ package android.content {
|
|||||||
|
|
||||||
public abstract class Context {
|
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 @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 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 @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();
|
method @Nullable public abstract java.io.File getPreloadsFileCache();
|
||||||
|
|||||||
@@ -640,7 +640,7 @@ package android.content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract class Context {
|
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 @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 android.view.Display getDisplay();
|
||||||
method public abstract int getDisplayId();
|
method public abstract int getDisplayId();
|
||||||
|
|||||||
@@ -2224,9 +2224,9 @@ class ContextImpl extends Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Context createContextAsUser(UserHandle user) {
|
public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) {
|
||||||
try {
|
try {
|
||||||
return createPackageContextAsUser(getPackageName(), mFlags, user);
|
return createPackageContextAsUser(getPackageName(), flags, user);
|
||||||
} catch (NameNotFoundException e) {
|
} catch (NameNotFoundException e) {
|
||||||
throw new IllegalStateException("Own package not found: package=" + getPackageName());
|
throw new IllegalStateException("Own package not found: package=" + getPackageName());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5276,7 +5276,7 @@ public abstract class Context {
|
|||||||
@SystemApi
|
@SystemApi
|
||||||
@TestApi
|
@TestApi
|
||||||
@NonNull
|
@NonNull
|
||||||
public Context createContextAsUser(@NonNull UserHandle user) {
|
public Context createContextAsUser(@NonNull UserHandle user, @CreatePackageOptions int flags) {
|
||||||
if (Build.IS_ENG) {
|
if (Build.IS_ENG) {
|
||||||
throw new IllegalStateException("createContextAsUser not overridden!");
|
throw new IllegalStateException("createContextAsUser not overridden!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -898,8 +898,8 @@ public class ContextWrapper extends Context {
|
|||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public Context createContextAsUser(UserHandle user) {
|
public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) {
|
||||||
return mBase.createContextAsUser(user);
|
return mBase.createContextAsUser(user, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
|
|||||||
@@ -765,7 +765,7 @@ public class MockContext extends Context {
|
|||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
@Override
|
@Override
|
||||||
public Context createContextAsUser(UserHandle user) {
|
public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user