Merge "Use the new gsid interface" am: c68c069db7 am: a0dc5e8e10

am: e3cf98d86c

Change-Id: I4b9387fdc227fae480c15da3512ce1354d243a6a
This commit is contained in:
Howard Chen
2019-11-15 04:20:27 -08:00
committed by android-build-merger
5 changed files with 73 additions and 19 deletions

View File

@@ -100,6 +100,19 @@ public class DynamicSystemManager {
}
}
}
/**
* Start DynamicSystem installation.
*
* @return true if the call succeeds
*/
@RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
public boolean startInstallation() {
try {
return mService.startInstallation();
} catch (RemoteException e) {
throw new RuntimeException(e.toString());
}
}
/**
* Start DynamicSystem installation. This call may take an unbounded amount of time. The caller
* may use another thread to call the getStartProgress() to get the progress.
@@ -112,9 +125,9 @@ public class DynamicSystemManager {
* true.
*/
@RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
public Session startInstallation(String name, long size, boolean readOnly) {
public Session createPartition(String name, long size, boolean readOnly) {
try {
if (mService.startInstallation(name, size, readOnly)) {
if (mService.createPartition(name, size, readOnly)) {
return new Session();
} else {
return null;
@@ -123,7 +136,18 @@ public class DynamicSystemManager {
throw new RuntimeException(e.toString());
}
}
/**
* Finish a previously started installation. Installations without a cooresponding
* finishInstallation() will be cleaned up during device boot.
*/
@RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
public boolean finishInstallation() {
try {
return mService.finishInstallation();
} catch (RemoteException e) {
throw new RuntimeException(e.toString());
}
}
/**
* Query the progress of the current installation operation. This can be called while the
* installation is in progress.

View File

@@ -21,15 +21,26 @@ import android.gsi.GsiProgress;
interface IDynamicSystemService
{
/**
* Start DynamicSystem installation. This call may take 60~90 seconds. The caller
* Start DynamicSystem installation.
* @return true if the call succeeds
*/
boolean startInstallation();
/**
* Create a DSU partition. This call may take 60~90 seconds. The caller
* may use another thread to call the getStartProgress() to get the progress.
*
* @param name The DSU partition name
* @param size Size of the DSU image in bytes
* @param readOnly True if this partition is readOnly
* @return true if the call succeeds
*/
boolean startInstallation(@utf8InCpp String name, long size, boolean readOnly);
boolean createPartition(@utf8InCpp String name, long size, boolean readOnly);
/**
* Finish a previously started installation. Installations without
* a cooresponding finishInstallation() will be cleaned up during device boot.
*/
boolean finishInstallation();
/**
* Query the progress of the current installation operation. This can be called while