Merge "Merge RQ2A.210305.007"

This commit is contained in:
Xin Li
2021-03-03 21:41:39 +00:00
committed by Gerrit Code Review
1243 changed files with 25637 additions and 52468 deletions

View File

@@ -119,8 +119,9 @@ public class CrossProfileApps {
* {@link #getTargetUserProfiles()} if different to the calling user, otherwise a
* {@link SecurityException} will be thrown.
* @param callingActivity The activity to start the new activity from for the purposes of
* deciding which task the new activity should belong to. If {@code null}, the activity
* will always be started in a new task.
* passing back any result and deciding which task the new activity should belong to. If
* {@code null}, the activity will always be started in a new task and no result will be
* returned.
*/
@RequiresPermission(anyOf = {
android.Manifest.permission.INTERACT_ACROSS_PROFILES,
@@ -146,8 +147,9 @@ public class CrossProfileApps {
* {@link #getTargetUserProfiles()} if different to the calling user, otherwise a
* {@link SecurityException} will be thrown.
* @param callingActivity The activity to start the new activity from for the purposes of
* deciding which task the new activity should belong to. If {@code null}, the activity
* will always be started in a new task.
* passing back any result and deciding which task the new activity should belong to. If
* {@code null}, the activity will always be started in a new task and no result will be
* returned.
* @param options The activity options or {@code null}. See {@link android.app.ActivityOptions}.
*/
@RequiresPermission(anyOf = {

View File

@@ -17,6 +17,7 @@
package android.content.pm;
import android.annotation.UserIdInt;
import android.app.AppOpsManager.Mode;
import android.os.UserHandle;
import java.util.List;
@@ -62,4 +63,14 @@ public abstract class CrossProfileAppsInternal {
*/
public abstract List<UserHandle> getTargetUserProfiles(
String packageName, @UserIdInt int userId);
/**
* Sets the app-op for {@link android.Manifest.permission#INTERACT_ACROSS_PROFILES} that is
* configurable by users in Settings. This configures it for the profile group of the given
* user.
*
* @see CrossProfileApps#setInteractAcrossProfilesAppOp(String, int)
*/
public abstract void setInteractAcrossProfilesAppOp(
String packageName, @Mode int newMode, @UserIdInt int userId);
}

View File

@@ -99,6 +99,11 @@ import java.util.Set;
* packages that are currently installed on the device.
*
* You can find this class through {@link Context#getPackageManager}.
*
* <p class="note"><strong>Note: </strong>If your app targets Android 11 (API level 30) or
* higher, the methods in this class each return a filtered list of apps. Learn more about how to
* <a href="/training/basics/intents/package-visibility">manage package visibility</a>.
* </p>
*/
public abstract class PackageManager {
private static final String TAG = "PackageManager";
@@ -1741,6 +1746,15 @@ public abstract class PackageManager {
* {@hide} */
public static final int DELETE_FAILED_USED_SHARED_LIBRARY = -6;
/**
* Deletion failed return code: this is passed to the
* {@link IPackageDeleteObserver} if the system failed to delete the package
* because there is an app pinned.
*
* @hide
*/
public static final int DELETE_FAILED_APP_PINNED = -7;
/**
* Return code that is passed to the {@link IPackageMoveObserver} when the
* package has been successfully moved by the system.
@@ -7791,6 +7805,7 @@ public abstract class PackageManager {
case DELETE_FAILED_OWNER_BLOCKED: return "DELETE_FAILED_OWNER_BLOCKED";
case DELETE_FAILED_ABORTED: return "DELETE_FAILED_ABORTED";
case DELETE_FAILED_USED_SHARED_LIBRARY: return "DELETE_FAILED_USED_SHARED_LIBRARY";
case DELETE_FAILED_APP_PINNED: return "DELETE_FAILED_APP_PINNED";
default: return Integer.toString(status);
}
}
@@ -7805,6 +7820,7 @@ public abstract class PackageManager {
case DELETE_FAILED_OWNER_BLOCKED: return PackageInstaller.STATUS_FAILURE_BLOCKED;
case DELETE_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED;
case DELETE_FAILED_USED_SHARED_LIBRARY: return PackageInstaller.STATUS_FAILURE_CONFLICT;
case DELETE_FAILED_APP_PINNED: return PackageInstaller.STATUS_FAILURE_BLOCKED;
default: return PackageInstaller.STATUS_FAILURE;
}
}