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

Commit 0f2f9d06 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add commitChanges for signaling checkpointing end"

parents abe028ab e129e5ce
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -190,4 +190,5 @@ interface IStorageManager {
    void abortIdleMaintenance() = 80;
    void abortIdleMaintenance() = 80;
    String translateAppToSystem(String path, int pid, int uid) = 81;
    String translateAppToSystem(String path, int pid, int uid) = 81;
    String translateSystemToApp(String path, int pid, int uid) = 82;
    String translateSystemToApp(String path, int pid, int uid) = 82;
    void commitChanges() = 83;
}
}
+13 −0
Original line number Original line Diff line number Diff line
@@ -2526,6 +2526,19 @@ class StorageManagerService extends IStorageManager.Stub
        }
        }
    }
    }


    /**
     * Signal that checkpointing partitions should commit changes
     */
    @Override
    public void commitChanges() throws RemoteException {
        // Only the system process is permitted to commit checkpoints
        if (Binder.getCallingUid() != android.os.Process.SYSTEM_UID) {
            throw new SecurityException("no permission to commit checkpoint changes");
        }

        mVold.commitChanges();
    }

    @Override
    @Override
    public String getPassword() throws RemoteException {
    public String getPassword() throws RemoteException {
        mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER,
        mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER,
+9 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,7 @@ import android.os.IRemoteCallback;
import android.os.IUserManager;
import android.os.IUserManager;
import android.os.Looper;
import android.os.Looper;
import android.os.Message;
import android.os.Message;
import android.os.PowerManager;
import android.os.Process;
import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.RemoteException;
@@ -332,6 +333,14 @@ class UserController implements Handler.Callback {
                return;
                return;
            }
            }
        }
        }
        // Inform checkpointing systems of success
        try {
            getStorageManager().commitChanges();
        } catch (Exception e) {
            PowerManager pm = (PowerManager)
                     mInjector.getContext().getSystemService(Context.POWER_SERVICE);
            pm.reboot("Checkpoint commit failed");
        }


        // We always walk through all the user lifecycle states to send
        // We always walk through all the user lifecycle states to send
        // consistent developer events. We step into RUNNING_LOCKED here,
        // consistent developer events. We step into RUNNING_LOCKED here,