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

Commit 1c3be1a5 authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

resolve merge conflicts of cffb19c8 to mnc-dev am: 3f9ea2d3 am: d6c1126f am: e2c9b1af

am: d2a4e1b3

Change-Id: I8e59a88278ba50ab7e3768031611065131ed6834
parents a66746d1 d2a4e1b3
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1779,9 +1779,10 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM

        case START_BACKUP_AGENT_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
            String packageName = data.readString();
            int backupRestoreMode = data.readInt();
            boolean success = bindBackupAgent(info, backupRestoreMode);
            int userId = data.readInt();
            boolean success = bindBackupAgent(packageName, backupRestoreMode, userId);
            reply.writeNoException();
            reply.writeInt(success ? 1 : 0);
            return true;
@@ -4448,13 +4449,14 @@ class ActivityManagerProxy implements IActivityManager
        return binder;
    }

    public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
    public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId)
            throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        app.writeToParcel(data, 0);
        data.writeString(packageName);
        data.writeInt(backupRestoreMode);
        data.writeInt(userId);
        mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
        reply.readException();
        boolean success = reply.readInt() != 0;
+1 −1
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ public interface IActivityManager extends IInterface {
    public IBinder peekService(Intent service, String resolvedType, String callingPackage)
            throws RemoteException;

    public boolean bindBackupAgent(ApplicationInfo appInfo, int backupRestoreMode)
    public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId)
            throws RemoteException;
    public void clearPendingBackup() throws RemoteException;
    public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException;
+2 −1
Original line number Diff line number Diff line
@@ -2356,7 +2356,8 @@ public class BackupManagerService {
            mConnecting = true;
            mConnectedAgent = null;
            try {
                if (mActivityManager.bindBackupAgent(app, mode)) {
                if (mActivityManager.bindBackupAgent(app.packageName, mode,
                        UserHandle.USER_OWNER)) {
                    Slog.d(TAG, "awaiting agent for " + app);

                    // success; wait for the agent to arrive
+14 −3
Original line number Diff line number Diff line
@@ -17041,11 +17041,22 @@ public final class ActivityManagerService extends ActivityManagerNative
    // Cause the target app to be launched if necessary and its backup agent
    // instantiated.  The backup agent will invoke backupAgentCreated() on the
    // activity manager to announce its creation.
    public boolean bindBackupAgent(ApplicationInfo app, int backupMode) {
        if (DEBUG_BACKUP) Slog.v(TAG_BACKUP,
                "bindBackupAgent: app=" + app + " mode=" + backupMode);
    public boolean bindBackupAgent(String packageName, int backupMode, int userId) {
        if (DEBUG_BACKUP) Slog.v(TAG, "bindBackupAgent: app=" + packageName + " mode=" + backupMode);
        enforceCallingPermission("android.permission.CONFIRM_FULL_BACKUP", "bindBackupAgent");
        IPackageManager pm = AppGlobals.getPackageManager();
        ApplicationInfo app = null;
        try {
            app = pm.getApplicationInfo(packageName, 0, userId);
        } catch (RemoteException e) {
            // can't happen; package manager is process-local
        }
        if (app == null) {
            Slog.w(TAG, "Unable to bind backup agent for " + packageName);
            return false;
        }
        synchronized(this) {
            // !!! TODO: currently no check here that we're already bound
            BatteryStatsImpl.Uid.Pkg.Serv ss = null;