blob: 4718780bc5b3e6341f65142c83fc25ac64d71d70 [file] [log] [blame]
// Copyright (C) 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option java_multiple_files = true;
option java_package = "com.android.emulator";
option objc_class_prefix = "AEC";
package android.emulation.control;
import "google/protobuf/empty.proto";
import "snapshot.proto";
// The SnapshotService enables you to list, store, and retrieve snapshots.
// Currently the snapshot service is very limited, in the sense that you can:
//
// 1. Store only one snapshot. All existing snapshots will be deleted.
// 2. Cannot rename the snapshots.
// 3. There are no guarantees that you will be able to load the snapshot
service SnapshotService {
// Lists all the valid snapshots that are stored locally for the currently
// running avd.
rpc listSnapshots(google.protobuf.Empty) returns (SnapshotList) {}
// Pulls down the snapshot stored inside the AVD as a tar.gz stream
rpc pullSnapshot(Snapshot) returns (stream Snapshot) {}
// Push a tar.gz stream contain the snapshot.
rpc pushSnapshot(stream Snapshot) returns (Snapshot) {}
// Loads the given snapshot inside the emulator.
rpc loadSnapshot(Snapshot) returns (Snapshot) {}
// Create as a snapshot of the current state of the emulator.
rpc saveSnapshot(Snapshot) returns (Snapshot) {}
// Deletes the given snapshot from the avd.
rpc deleteSnapshot(Snapshot) returns (Snapshot) {}
// Tracks the given process for automated snapshot creation in case of
// assert failures.
rpc trackProcess(IceboxTarget) returns (IceboxTarget) {}
}
message Snapshot {
enum Format {
TARGZ = 0;
TAR = 1;
}
// The identifier to the snapshot.
string snapshot_id = 1;
// A stream of bytes. Encoded as a tar (possibly gzipped) file.
bytes payload = 2;
// status fields.
bool success = 3;
bytes err = 4;
Format format = 5;
}
message SnapshotDetails {
string snapshot_id = 1;
emulator_snapshot.Snapshot details = 2;
}
message SnapshotList {
repeated SnapshotDetails snapshots = 1;
}
//
message IceboxTarget {
// This is the process id to attach to, if this value is not set (0)
// The process name will be used instead.
int64 pid = 1;
// The process name to attach to if any, if this is not set the pid will
// be used. This is usually the application name of your application under
// test, that is passed in to the am instrument command. It is likely
// what you will find in your AndroidManifest.xml
string packageName = 2;
// The name of the snapshot that icebox will create if a snapshot is
// generated.
string snapshotId = 3;
// True if icebox failed to track the given target.
bool failed = 4;
// Detailed error message that might provide more information.
string err = 5;
}