Snap for 6258215 from a4884063554cfc2959069b9296e8d9e4a0bd931b to r-keystone-qcom-release

Change-Id: I6d40839dc64aedb1f6811c34c95fc278936509bd
diff --git a/darwin-x86_64/emulator b/darwin-x86_64/emulator
index e33a846..13abb17 100755
--- a/darwin-x86_64/emulator
+++ b/darwin-x86_64/emulator
Binary files differ
diff --git a/darwin-x86_64/emulator-check b/darwin-x86_64/emulator-check
index 26693a5..4a3f4ce 100755
--- a/darwin-x86_64/emulator-check
+++ b/darwin-x86_64/emulator-check
Binary files differ
diff --git a/darwin-x86_64/lib/advancedFeatures.ini b/darwin-x86_64/lib/advancedFeatures.ini
index ff99f47..a953124 100644
--- a/darwin-x86_64/lib/advancedFeatures.ini
+++ b/darwin-x86_64/lib/advancedFeatures.ini
@@ -291,3 +291,7 @@
 # (VkWriteDescriptorSet, and others)
 # Requires guest support
 VulkanIgnoredHandles = on
+
+# VirtioGpuNext-----------------------------------------------------------------
+# Whether virtio-gpu-next is supported. Requires guest support.
+VirtioGpuNext = on
diff --git a/darwin-x86_64/lib/advancedFeaturesCanary.ini b/darwin-x86_64/lib/advancedFeaturesCanary.ini
index ef59458..6baeb9d 100644
--- a/darwin-x86_64/lib/advancedFeaturesCanary.ini
+++ b/darwin-x86_64/lib/advancedFeaturesCanary.ini
@@ -296,3 +296,7 @@
 # (VkWriteDescriptorSet, and others)
 # Requires guest support
 VulkanIgnoredHandles = on
+
+# VirtioGpuNext-----------------------------------------------------------------
+# Whether virtio-gpu-next is supported. Requires guest support.
+VirtioGpuNext = on
diff --git a/darwin-x86_64/lib/emulator_controller.proto b/darwin-x86_64/lib/emulator_controller.proto
index 42181dd..ed8d54e 100644
--- a/darwin-x86_64/lib/emulator_controller.proto
+++ b/darwin-x86_64/lib/emulator_controller.proto
@@ -14,261 +14,435 @@
 syntax = "proto3";
 
 option java_multiple_files = true;
-option java_package = "com.android.emulator";
+option java_package = "com.android.emulator.control";
 option objc_class_prefix = "AEC";
 
 package android.emulation.control;
-
 import "google/protobuf/empty.proto";
 
 // An EmulatorController service lets you control the emulator.
+// Note that this is currently an experimental feature, and that the
+// service definition might change without notice. Use at your own risk!
+//
+// We use the following rough conventions:
+//
+// streamXXX --> streams values XXX (usually for emulator lifetime). Values
+//               are updated as soon as they become available.
+// getXXX    --> gets a single value XXX
+// setXXX    --> sets a single value XXX, does not returning state, these
+//               usually have an observable lasting side effect.
+// sendXXX   --> send a single event XXX, possibly returning state information.
+//               android usually responds to these events.
 service EmulatorController {
-    rpc setRotation(Rotation) returns (Rotation) {}
-    rpc getRotation(google.protobuf.Empty) returns (Rotation) {}
+  // set/get/stream the sensor data
+  rpc streamSensor(SensorValue) returns (stream SensorValue) {}
+  rpc getSensor(SensorValue) returns (SensorValue) {}
+  rpc setSensor(SensorValue) returns (google.protobuf.Empty) {}
 
-    rpc setBattery(BatteryState) returns (BatteryState) {}
-    rpc getBattery(google.protobuf.Empty) returns (BatteryState) {}
+  // set/get/stream the physical model, this is likely the one you are
+  // looking for when you wish to modify the device state.
+  rpc setPhysicalModel(PhysicalModelValue) returns (google.protobuf.Empty) {}
+  rpc getPhysicalModel(PhysicalModelValue) returns (PhysicalModelValue) {}
+  rpc streamPhysicalModel(PhysicalModelValue)
+      returns (stream PhysicalModelValue) {}
 
-    rpc getGps(google.protobuf.Empty) returns (GpsState) {}
-    rpc setGps(GpsState) returns (GpsState) {}
+  // Set/get the battery to the given state.
+  rpc setBattery(BatteryState) returns (google.protobuf.Empty) {}
+  rpc getBattery(google.protobuf.Empty) returns (BatteryState) {}
 
-    rpc sendFingerprint(FingerprintEvent) returns (google.protobuf.Empty) {}
-    rpc sendKey(KeyboardEvent) returns (google.protobuf.Empty) {}
+  // Set/get the state of the gps.
+  rpc getGps(google.protobuf.Empty) returns (GpsState) {}
+  rpc setGps(GpsState) returns (google.protobuf.Empty) {}
 
-    // Note that touch events can be used instead of mouse events if desired.
-    rpc sendTouch(TouchEvent) returns (google.protobuf.Empty) {}
-    rpc sendMouse(MouseEvent) returns (google.protobuf.Empty) {}
-    rpc sendRotary(RotaryEvent) returns (google.protobuf.Empty) {}
+  // Simulate a touch event on the finger print sensor.
+  rpc sendFingerprint(Fingerprint) returns (google.protobuf.Empty) {}
 
-    rpc getStatus(google.protobuf.Empty) returns (EmulatorStatus) {}
+  // Send a keyboard event. Translating the event.
+  rpc sendKey(KeyboardEvent) returns (google.protobuf.Empty) {}
 
-    rpc getScreenshot(ImageFormat) returns (Image) {}
+  // Send touch/mouse events. Note that mouse events can be simulated
+  // by touch events.
+  rpc sendTouch(TouchEvent) returns (google.protobuf.Empty) {}
+  rpc sendMouse(MouseEvent) returns (google.protobuf.Empty) {}
 
-    // Returns the last 128Kb of logcat output from the emulator
-    rpc getLogcat(LogMessage) returns (LogMessage) {}
+  // Make a phone call.
+  rpc sendPhone(PhoneCall) returns (PhoneResponse) {}
 
-    // Streams the logcat output from the emulator. The first call
-    // can retrieve up to 128Kb. This call will not return.
-    rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
+  // Retrieve the status of the emulator. This will contain general
+  // hardware information, and whether the device has booted or not.
+  rpc getStatus(google.protobuf.Empty) returns (EmulatorStatus) {}
 
-    rpc usePhone(TelephoneOperation) returns (TelephoneResponse) {}
+  // Gets an individual screenshot in the desired format.
+  //
+  // The image will be scaled to the desired ImageFormat, while maintaining the
+  // aspect ratio. The returned image will never exceed the provided width and
+  // height. Not setting the width or height (i.e. they are 0) will result in
+  // using the device width and height.
+  //
+  // The resulting image will be properly oriented and can be displayed directly
+  // without post processing. For example, if the device has a 1080x1920 screen
+  // and is in landscape mode and called with no width or height parameter, it
+  // will return an 1920x1080 image.
+  rpc getScreenshot(ImageFormat) returns (Image) {}
 
-    // The following endpoints are needed to establish the webrtc protocol
-    // Due to limitiations in Javascript we cannot make use of bidirectional
-    // endpoints See this [blog](https://grpc.io/blog/state-of-grpc-web) for
-    // details.
+  // Streams a series of screenshots in the desired format.
+  // A new frame will be delivered whenever the device produces a new frame.
+  // (Beware that this can produce a significant amout of data, and that
+  // certain translations are (png transform) can be costly).
+  rpc streamScreenshot(ImageFormat) returns (stream Image) {}
 
-    // This function will generate a new identifier that the client
-    // should use for further interaction. It will initiate the
-    // JSEP protocol on the server side.
-    rpc requestRtcStream(google.protobuf.Empty) returns (RtcId) {}
+  // Returns the last 128Kb of logcat output from the emulator
+  // Note that parsed logcat messages are only available after L (Api >23).
+  // it is possible that the logcat buffer gets overwritten, or falls behind.
+  rpc getLogcat(LogMessage) returns (LogMessage) {}
 
-    // Sends the given JsepMsg to the server. The RtcId in the
-    // message should point to an active stream negotiation in
-    // progress, otherwise the message will be ignored.
-    rpc sendJsepMessage(JsepMsg) returns (google.protobuf.Empty) {}
+  // Streams the logcat output from the emulator. The first call
+  // can retrieve up to 128Kb. This call will not return.
+  // Note that parsed logcat messages are only available after L (Api >23)
+  // it is possible that the logcat buffer gets overwritten, or falls behind.
+  rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
 
-    // Reads an available jsep messages for the given client id,
-    // blocking at most 5 seconds, or until one becomes available.
-    //
-    // The ice candidates for example will trickle in on this callback,
-    // as will the SDP negotation.
-    rpc receiveJsepMessage(RtcId) returns (JsepMsg) {}
+  // The following endpoints are needed to establish the webrtc protocol
+  // Due to limitiations in Javascript we cannot make use of bidirectional
+  // endpoints See this [blog](https://grpc.io/blog/state-of-grpc-web) for
+  // details. TODO(jansene): We should move this to a seperate service.
+
+  // This function will generate a new identifier that the client
+  // should use for further interaction. It will initiate the
+  // JSEP protocol on the server side.
+  rpc requestRtcStream(google.protobuf.Empty) returns (RtcId) {}
+
+  // Sends the given JsepMsg to the server. The RtcId in the
+  // message should point to an active stream negotiation in
+  // progress, otherwise the message will be ignored.
+  rpc sendJsepMessage(JsepMsg) returns (google.protobuf.Empty) {}
+
+  // Reads an available jsep messages for the given client id,
+  // blocking at most 5 seconds, or until one becomes available.
+  //
+  // The ice candidates for example will trickle in on this callback,
+  // as will the SDP negotation.
+  rpc receiveJsepMessage(RtcId) returns (JsepMsg) {}
 }
 
+message ParameterValue {
+  repeated float data = 1 [packed = true];
+}
+
+message PhysicalModelValue {
+  enum State {
+    OK = 0;
+    NO_SERVICE = -3;  // qemud service is not available/initiated.
+    DISABLED = -2;    // Sensor is disabled.
+    UNKNOWN = -1;     // Unknown sensor (should not happen)
+  }
+
+  // Details on the sensors documentation can be found here:
+  // https://developer.android.com/reference/android/hardware/Sensor.html#TYPE_
+  enum PhysicalType {
+    POSITION = 0;
+
+    // All values are angles in degrees.
+    // values = [x,y,z]
+    ROTATION = 1;
+
+    MAGNETIC_FIELD = 2;
+
+    // Temperature in °C
+    TEMPERATURE = 3;
+
+    // Proximity sensor distance measured in centimeters
+    PROXIMITY = 4;
+
+    // Ambient light level in SI lux units
+    LIGHT = 5;
+
+    // Atmospheric pressure in hPa (millibar)
+    PRESSURE = 6;
+
+    // Relative ambient air humidity in percent
+    HUMIDITY = 7;
+
+    VELOCITY = 8;
+    AMBIENT_MOTION = 9;
+  }
+  PhysicalType target = 1;
+
+  // [Output Only]
+  State status = 2;
+
+  // Value interpretation depends on sensor, will contain at most 3 values.
+  ParameterValue value = 3;
+}
+
+// A single sensor value.
+message SensorValue {
+  enum State {
+    OK = 0;
+    NO_SERVICE = -3;  // qemud service is not available/initiated.
+    DISABLED = -2;    // Sensor is disabled.
+    UNKNOWN = -1;     // Unknown sensor (should not happen)
+  }
+
+  // These are the various sensors that can be available in an emulated
+  // devices.
+  enum SensorType {
+    // Measures the acceleration force in m/s2 that is applied to a device
+    // on all three physical axes (x, y, and z), including the force of
+    // gravity.
+    ACCELERATION = 0;
+    // Measures a device's rate of rotation in rad/s around each of the
+    // three physical axes (x, y, and z).
+    GYROSCOPE = 1;
+    // Measures the ambient geomagnetic field for all three physical axes
+    // (x, y, z) in μT.
+    MAGNETIC_FIELD = 2;
+    // Measures degrees of rotation that a device makes around all three
+    // physical axes (x, y, z)
+    ORIENTATION = 3;
+    // Measures the temperature of the device in degrees Celsius (°C).
+    TEMPERATURE = 4;
+    // Measures the proximity of an object in cm relative to the view screen
+    // of a device. This sensor is typically used to determine whether a
+    // handset is being held up to a person's ear.
+    PROXIMITY = 5;
+    // Measures the ambient light level (illumination) in lx.
+    LIGHT = 6;
+    // Measures the ambient air pressure in hPa or mbar.
+    PRESSURE = 7;
+    // Measures the relative ambient humidity in percent (%).
+    HUMIDITY = 8;
+    MAGNETIC_FIELD_UNCALIBRATED = 9;
+    GYROSCOPE_UNCALIBRATED = 10;
+  }
+
+  // Type of sensor
+  SensorType target = 1;
+
+  // [Output Only]
+  State status = 2;
+
+  // Value interpretation depends on sensor enum, will contain at most 3 values.
+  ParameterValue value = 3;
+}
 
 message RtcId {
-    // The unique identifier of this connection. You will have to use the same
-    // identifier when sending/receiving messages. The server will generate a
-    // guid when receiving the start message.
-    string guid = 1;
+  // The unique identifier of this connection. You will have to use the
+  // same identifier when sending/receiving messages. The server will
+  // generate a guid when receiving the start message.
+  string guid = 1;
 }
 
 message JsepMsg {
-    // The unique identifier of this connection. You will have to use the same
-    // identifier when sending/receiving messages. The server will generate a
-    // guid when receiving the start message.
-    RtcId id = 1;
-    // The JSON payload. This usually can be directly handled by the Javascript
-    // The dictionary can contain the following properties
-    //
-    // - bye:
-    //        You can hang up now. No new message expected for you.
-    //        The server has stopped the RTC stream.
-    //
-    // - start:
-    //        An RTCConfiguration dictionary providing options to
-    //        configure the new connection. This can include the
-    //        turn configuration the serve is using. This dictionary can be
-    //        passed in directly to the
-    //        [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection)
-    //        object.
-    //
-    // - candidate:
-    //        The WebRTC API's RTCIceCandidateInit dictionary, which
-    //        contains the information needed to fundamentally describe an
-    //        RTCIceCandidate. See
-    //        [RTCIceCandidate](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate)
-    //        and [Session
-    //        Lifetime](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Session_lifetime)
-    //        for more details.
-    //
-    // - sdp:
-    //        RTCSessionDescriptionInit dictionary containing the values
-    //        to that can be assigned to a
-    //        [RTCSessionDescription](https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription)
-    string message = 2;
+  // The unique identifier of this connection. You will have to use the
+  // same identifier when sending/receiving messages. The server will
+  // generate a guid when receiving the start message.
+  RtcId id = 1;
+  // The JSON payload. This usually can be directly handled by the
+  // Javascript The dictionary can contain the following properties
+  //
+  // - bye:
+  //        You can hang up now. No new message expected for you.
+  //        The server has stopped the RTC stream.
+  //
+  // - start:
+  //        An RTCConfiguration dictionary providing options to
+  //        configure the new connection. This can include the
+  //        turn configuration the serve is using. This dictionary can be
+  //        passed in directly to the
+  //        [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection)
+  //        object.
+  //
+  // - candidate:
+  //        The WebRTC API's RTCIceCandidateInit dictionary, which
+  //        contains the information needed to fundamentally describe an
+  //        RTCIceCandidate. See
+  //        [RTCIceCandidate](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate)
+  //        and [Session
+  //        Lifetime](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Session_lifetime)
+  //        for more details.
+  //
+  // - sdp:
+  //        RTCSessionDescriptionInit dictionary containing the values
+  //        to that can be assigned to a
+  //        [RTCSessionDescription](https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription)
+  string message = 2;
 }
 
 message LogMessage {
-    // [Output Only] The contents of the log output.
-    string contents = 1;
-    // The starting byte position of the output that was returned. This should
-    // match the start parameter sent with the request. If the serial console
-    // output exceeds the size of the buffer, older output will be overwritten
-    // by newer content and the start values will be mismatched.
-    int64 start = 2;
-    //[Output Only] The position of the next byte of content from the serial
-    // console output. Use this value in the next request as the start
-    // parameter.
-    int64 next = 3;
+  // [Output Only] The contents of the log output.
+  string contents = 1;
+  // The starting byte position of the output that was returned. This
+  // should match the start parameter sent with the request. If the serial
+  // console output exceeds the size of the buffer, older output will be
+  // overwritten by newer content and the start values will be mismatched.
+  int64 start = 2;
+  //[Output Only] The position of the next byte of content from the serial
+  // console output. Use this value in the next request as the start
+  // parameter.
+  int64 next = 3;
 
-    // Set the sort of response you are interested it in.
-    // It the type is "Parsed" the entries field will contain the parsed
-    // results. otherwise the contents field will be set.
-    LogType sort = 4;
+  // Set the sort of response you are interested it in.
+  // It the type is "Parsed" the entries field will contain the parsed
+  // results. otherwise the contents field will be set.
+  LogType sort = 4;
 
-    // [Output Only] The parsed logcat entries so far. Only set if sort is set
-    // to Parsed
-    repeated LogcatEntry entries = 5;
+  // [Output Only] The parsed logcat entries so far. Only set if sort is
+  // set to Parsed
+  repeated LogcatEntry entries = 5;
 
-    enum LogType {
-        Text = 0;
-        Parsed = 1;
-    }
+  enum LogType {
+    Text = 0;
+    Parsed = 1;
+  }
 }
 
+// A parsed logcat entry.
 message LogcatEntry {
-    enum LogLevel {
-        UNKNOWN = 0;
-        DEFAULT = 1;
-        VERBOSE = 2;
-        DEBUG = 3;
-        INFO = 4;
-        WARN = 5;
-        ERR = 6;
-        FATAL = 7;
-        SILENT = 8;
-    };
+  // The possible log levels.
+  enum LogLevel {
+    UNKNOWN = 0;
+    DEFAULT = 1;
+    VERBOSE = 2;
+    DEBUG = 3;
+    INFO = 4;
+    WARN = 5;
+    ERR = 6;
+    FATAL = 7;
+    SILENT = 8;
+  };
 
-    uint64 timestamp = 1;
-    uint32 pid = 2;
-    uint32 tid = 3;
-    LogLevel level = 4;
-    string tag = 5;
-    string msg = 6;
+  // A Unix timestamps in  milliseconds (The number of milliseconds that
+  // have elapsed since January 1, 1970 (midnight UTC/GMT), not counting
+  // leap seconds)
+  uint64 timestamp = 1;
+
+  // Process id.
+  uint32 pid = 2;
+
+  // Thread id.
+  uint32 tid = 3;
+  LogLevel level = 4;
+  string tag = 5;
+  string msg = 6;
 }
 
+// Information about the hypervisor that is currently in use.
 message VmConfiguration {
-    enum VmHypervisorType {
-        HV_UNKNOWN = 0;
-        HV_NONE = 1;
-        HV_KVM = 2;
-        HV_HAXM = 3;
-        HV_HVF = 4;
-        HV_WHPX = 5;
-        HV_GVM = 6;
-    };
+  enum VmHypervisorType {
+    // An unknown hypervisor
+    UNKNOWN = 0;
 
-    VmHypervisorType hypervisorType = 1;
-    int32 numberOfCpuCores = 2;
-    int64 ramSizeBytes = 3;
+    // No hypervisor is in use. This usually means that the guest is
+    // running on a different CPU than the host, or you are using a
+    // platform where no hypervisor is available.
+    NONE = 1;
+
+    // The Kernel based Virtual Machine
+    // (https://www.linux-kvm.org/page/Main_Page)
+    KVM = 2;
+
+    // Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
+    // https://github.com/intel/haxm
+    HAXM = 3;
+
+    // Hypervisor Framework.
+    // https://developer.apple.com/documentation/hypervisor
+    HVF = 4;
+
+    // Window Hypervisor Platform
+    // https://docs.microsoft.com/en-us/virtualization/api/
+    WHPX = 5;
+
+    GVM = 6;
+  };
+
+  VmHypervisorType hypervisorType = 1;
+  int32 numberOfCpuCores = 2;
+  int64 ramSizeBytes = 3;
 }
 
-message RotaryEvent {
-    int32 delta = 1;
-}
-
-// The Touch interface represents a single contact point on a touch-sensitive
-// device. The contact point is commonly a finger or stylus and the device may
-// be a touchscreen or trackpad.
+// The Touch interface represents a single contact point on a
+// touch-sensitive device. The contact point is commonly a finger or stylus
+// and the device may be a touchscreen or trackpad.
 message Touch {
-    // The horizontal coordinate. This is the physical location on the screen
-    // For example 0 indicates the leftmost coordinate.
-    int32 x = 1;
+  // The horizontal coordinate. This is the physical location on the
+  // screen For example 0 indicates the leftmost coordinate.
+  int32 x = 1;
 
-    // The vertical coordinate. This is the physical location on the screen
-    // For example 0 indicates the top left coordinate.
-    int32 y = 2;
+  // The vertical coordinate. This is the physical location on the screen
+  // For example 0 indicates the top left coordinate.
+  int32 y = 2;
 
-    // The identifier is an arbitrary non-negative integer that is used to
-    // identify and track each tool independently when multiple tools are
-    // active. For example, when multiple fingers are touching the device, each
-    // finger should be assigned a distinct tracking id that is used as long as
-    // the finger remains in contact. Tracking ids may be reused when their
-    // associated tools move out of range.
-    //
-    // The emulator currently supports up to 10 concurrent touch events. The
-    // identifier should be a value from the set [0, 10]
-    int32 identifier = 3;
+  // The identifier is an arbitrary non-negative integer that is used to
+  // identify and track each tool independently when multiple tools are
+  // active. For example, when multiple fingers are touching the device,
+  // each finger should be assigned a distinct tracking id that is used as
+  // long as the finger remains in contact. Tracking ids may be reused
+  // when their associated tools move out of range.
+  //
+  // The emulator currently supports up to 10 concurrent touch events. The
+  // identifier should be a value from the set [0, 10]
+  int32 identifier = 3;
 
-    // Reports the physical pressure applied to the tip of the tool or the
-    // signal strength of the touch contact.
-    //
-    // The values reported must be non-zero when the tool is touching the device
-    // and zero otherwise to indicate that the touch event is completed.
-    //
-    // Make sure to deliver a pressure of 0 for the given identifier when the
-    // touch event is completed, otherwise the touch identifier will not be
-    // unregistered!
-    int32 pressure = 4;
+  // Reports the physical pressure applied to the tip of the tool or the
+  // signal strength of the touch contact.
+  //
+  // The values reported must be non-zero when the tool is touching the
+  // device and zero otherwise to indicate that the touch event is
+  // completed.
+  //
+  // Make sure to deliver a pressure of 0 for the given identifier when
+  // the touch event is completed, otherwise the touch identifier will not
+  // be unregistered!
+  int32 pressure = 4;
 
-    // Optionally reports the cross-sectional area of the touch contact, or the
-    // length of the longer dimension of the touch contact.
-    int32 touch_major = 5;
+  // Optionally reports the cross-sectional area of the touch contact, or
+  // the length of the longer dimension of the touch contact.
+  int32 touch_major = 5;
 
-    // Optionally reports the length of the shorter dimension of the touch
-    // contact. This axis will be ignored if touch_major is reporting an area
-    // measurement greater than 0.
-    int32 touch_minor = 6;
+  // Optionally reports the length of the shorter dimension of the touch
+  // contact. This axis will be ignored if touch_major is reporting an
+  // area measurement greater than 0.
+  int32 touch_minor = 6;
 }
 
-// A TouchEvent contains a list of Touch objects that are in contact with the
-// touch surface.
+// A TouchEvent contains a list of Touch objects that are in contact with
+// the touch surface.
 //
 // Touch events are delivered in sequence as specified in the touchList.
 //
 // TouchEvents are delivered to the emulated devices using ["Protocol
 // B"](https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt)
 message TouchEvent {
-    // The list of Touch objects, note that these do not need to be unique
-    repeated Touch touches = 1;
+  // The list of Touch objects, note that these do not need to be unique
+  repeated Touch touches = 1;
 
-    // The display device where the touch event occurred.
-    // Omitting or using the value 0 indicates the main display.
-    int32 device = 2;
+  // The display device where the touch event occurred.
+  // Omitting or using the value 0 indicates the main display.
+  int32 device = 2;
 }
 
 // The MouseEvent interface represents events that occur due to the user
 // interacting with a pointing device (such as a mouse).
 message MouseEvent {
-    // The horizontal coordinate. This is the physical location on the screen
-    // For example 0 indicates the leftmost coordinate.
-    int32 x = 1;
+  // The horizontal coordinate. This is the physical location on the
+  // screen For example 0 indicates the leftmost coordinate.
+  int32 x = 1;
 
-    // The vertical coordinate. This is the physical location on the screen
-    // For example 0 indicates the top left coordinate.
-    int32 y = 2;
+  // The vertical coordinate. This is the physical location on the screen
+  // For example 0 indicates the top left coordinate.
+  int32 y = 2;
 
-    // Indicates which buttons are pressed.
-    // 0: No button was pressed
-    // 1: Primary button (left)
-    // 2: Secondary button (right)
-    int32 buttons = 3;
+  // Indicates which buttons are pressed.
+  // 0: No button was pressed
+  // 1: Primary button (left)
+  // 2: Secondary button (right)
+  int32 buttons = 3;
 
-    // The display device where the mouse event occurred.
-    // Omitting or using the value 0 indicates the main display.
-    int32 device = 4;
+  // The display device where the mouse event occurred.
+  // Omitting or using the value 0 indicates the main display.
+  int32 device = 4;
 }
 
 // KeyboardEvent objects describe a user interaction with the keyboard; each
@@ -280,201 +454,249 @@
 // Note: that only keyCode, key, or text can be set and that the semantics
 // will slightly vary.
 message KeyboardEvent {
-    // Code types that the emulator can receive. Note that the emulator
-    // will do its best to translate the code to an evdev value that
-    // will be send to the emulator. This translation is based on
-    // the chromium translation tables. See
-    // https://chromium.googlesource.com/chromium/src/+/lkgr/ui/events/keycodes/dom/keycode_converter_data.inc
-    // for details on the translation.
-    enum KeyCodeType {
-        Usb = 0;
-        Evdev = 1;
-        XKB = 2;
-        Win = 3;
-        Mac = 4;
-    };
+  // Code types that the emulator can receive. Note that the emulator
+  // will do its best to translate the code to an evdev value that
+  // will be send to the emulator. This translation is based on
+  // the chromium translation tables. See
+  // https://chromium.googlesource.com/chromium/src/+/lkgr/ui/events/keycodes/dom/keycode_converter_data.inc
+  // for details on the translation.
+  enum KeyCodeType {
+    Usb = 0;
+    Evdev = 1;
+    XKB = 2;
+    Win = 3;
+    Mac = 4;
+  };
 
-    enum KeyEventType {
-        // Indicates that this keyevent should be send to the emulator
-        // as a key down event. Meaning that the key event will be
-        // translated to an EvDev event type and bit 11 (0x400) will be
-        // set before it is sent to the emulator.
-        keydown = 0;
+  enum KeyEventType {
+    // Indicates that this keyevent should be send to the emulator
+    // as a key down event. Meaning that the key event will be
+    // translated to an EvDev event type and bit 11 (0x400) will be
+    // set before it is sent to the emulator.
+    keydown = 0;
 
-        // Indicates that the keyevent should be send to the emulator
-        // as a key up event. Meaning that the key event will be
-        // translated to an EvDev event type and
-        // sent to the emulator.
-        keyup = 1;
+    // Indicates that the keyevent should be send to the emulator
+    // as a key up event. Meaning that the key event will be
+    // translated to an EvDev event type and
+    // sent to the emulator.
+    keyup = 1;
 
-        // Indicates that the keyevent will be send to the emulator
-        // as e key down event and immediately followed by a keyup event.
-        keypress = 2;
-    };
+    // Indicates that the keyevent will be send to the emulator
+    // as e key down event and immediately followed by a keyup event.
+    keypress = 2;
+  };
 
-    // Type of keycode contained in the keyCode field.
-    KeyCodeType codeType = 1;
+  // Type of keycode contained in the keyCode field.
+  KeyCodeType codeType = 1;
 
-    // The type of keyboard event that should be sent to the emulator
-    KeyEventType eventType = 2;
+  // The type of keyboard event that should be sent to the emulator
+  KeyEventType eventType = 2;
 
-    // This property represents a physical key on the keyboard (as opposed to
-    // the character generated by pressing the key). In other words, this
-    // property is a value which isn't altered by keyboard layout or the state
-    // of the modifier keys. This value will be interpreted by
-    // the emulator depending on the KeyCodeType. The incoming key code will be
-    // translated to an evdev code type and send to the emulator.
-    // The values in key and text will be ignored.
-    int32 keyCode = 3;
+  // This property represents a physical key on the keyboard (as opposed
+  // to the character generated by pressing the key). In other words, this
+  // property is a value which isn't altered by keyboard layout or the
+  // state of the modifier keys. This value will be interpreted by the
+  // emulator depending on the KeyCodeType. The incoming key code will be
+  // translated to an evdev code type and send to the emulator.
+  // The values in key and text will be ignored.
+  int32 keyCode = 3;
 
-    // The value of the key pressed by the user, taking into consideration the
-    // state of modifier keys such as Shift as well as the keyboard locale and
-    // layout. This follows the  w3c standard used in browsers.
-    // You can find an accurate description of valid values
-    // (here)[https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values]
-    // The values in text, keyCode, eventType and codeType will be ignored and a
-    // keypress event will be delivered to the emulator.
-    string key = 4;
+  // The value of the key pressed by the user, taking into consideration
+  // the state of modifier keys such as Shift as well as the keyboard
+  // locale and layout. This follows the  w3c standard used in browsers.
+  // You can find an accurate description of valid values
+  // (here)[https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values]
+  // The values in text, keyCode, eventType and codeType will be ignored
+  // and a keypress event will be delivered to the emulator.
+  string key = 4;
 
-    // Series of utf8 encoded characters to send to the emulator. Every
-    // character will be translated to an EvDev event type and send to the
-    // emulator as a keypress event. The values in keyCode, eventType, codeType
-    // and key will be ignored.
-    string text = 5;
+  // Series of utf8 encoded characters to send to the emulator. Every
+  // character will be translated to an EvDev event type and send to the
+  // emulator as a keypress event. The values in keyCode, eventType,
+  // codeType and key will be ignored.
+  string text = 5;
 }
 
-message FingerprintEvent {
-    bool isTouching = 1;
-    int32 touchId = 2;
+message Fingerprint {
+  // True when the fingprint is touched.
+  bool isTouching = 1;
+
+  // The identifier of the registered fingerprint.
+  int32 touchId = 2;
 }
 
 message GpsState {
-    bool passiveUpdate = 1;
-    double latitude = 2;
-    double longitude = 3;
-    double speed = 4;
-    double heading = 5;
-    double elevation = 6;
-    int32 satellites = 7;
+  bool passiveUpdate = 1;
+
+  // The latitude, in degrees.
+  double latitude = 2;
+
+  // The longitude, in degrees.
+  double longitude = 3;
+
+  // The speed if it is available, in meters/second over ground
+  double speed = 4;
+
+  // gets the horizontal direction of travel of this device, and is not
+  // related to the device orientation. It is guaranteed to be in the
+  // range [0.0, 360.0] if the device has a bearing. 0=North, 90=East,
+  // 180=South, etc..
+  double bearing = 5;
+
+  // The altitude if available, in meters above the WGS 84 reference
+  // ellipsoid.
+  double altitude = 6;
+
+  // The number of satellites used to derive the fix
+  int32 satellites = 7;
 }
 
 message BatteryState {
-    enum BatteryStatus {
-        BATTERY_STATUS_UNKNOWN = 0;
-        BATTERY_STATUS_CHARGING = 1;
-        BATTERY_STATUS_DISCHARGING = 2;
-        BATTERY_STATUS_NOT_CHARGING = 3;
-        BATTERY_STATUS_FULL = 4;
-    };
-    enum BatteryCharger {
-        BATTERY_CHARGER_NONE = 0;
-        BATTERY_CHARGER_AC = 1;
-        BATTERY_CHARGER_USB = 2;
-        BATTERY_CHARGER_WIRELESS = 3;
-    };
+  enum BatteryStatus {
+    UNKNOWN = 0;
+    CHARGING = 1;
+    DISCHARGING = 2;
+    NOT_CHARGING = 3;
+    FULL = 4;
+  };
+  enum BatteryCharger {
+    NONE = 0;
+    AC = 1;
+    USB = 2;
+    WIRELESS = 3;
+  };
 
-    enum BatteryHealth {
-        BATTERY_HEALTH_GOOD = 0;
-        BATTERY_HEALTH_FAILED = 1;
-        BATTERY_HEALTH_DEAD = 2;
-        BATTERY_HEALTH_OVERVOLTAGE = 3;
-        BATTERY_HEALTH_OVERHEATED = 4;
-    };
-    bool hasBattery = 1;
-    bool isPresent = 2;
-    BatteryCharger charger = 3;
-    int32 chargeLevel = 4;
-    BatteryHealth health = 5;
-    BatteryStatus status = 6;
-}
-
-message ImageStream {
-    uint32 framerate = 1;
-    ImageFormat format = 2;
+  enum BatteryHealth {
+    GOOD = 0;
+    FAILED = 1;
+    DEAD = 2;
+    OVERVOLTAGE = 3;
+    OVERHEATED = 4;
+  };
+  bool hasBattery = 1;
+  bool isPresent = 2;
+  BatteryCharger charger = 3;
+  int32 chargeLevel = 4;
+  BatteryHealth health = 5;
+  BatteryStatus status = 6;
 }
 
 message ImageFormat {
-    enum ImgFormat {
-        PNG = 0;
-        RAW = 1;
-        RGB888 = 2;
-        RGBA8888 = 3;
-    }
-    ImgFormat format = 1;
-    Rotation rotation = 2;
+  enum ImgFormat {
+    // Portable Network Graphics format
+    // (https://en.wikipedia.org/wiki/Portable_Network_Graphics)
+    PNG = 0;
+
+    // Three-channel RGB color model supplemented with a fourth alpha
+    // channel. https://en.wikipedia.org/wiki/RGBA_color_model
+    // Each pixel consists of 4 bytes.
+    RGBA8888 = 1;
+
+    // Three-channel RGB color model, each pixel consists of 3 bytes
+    RGB888 = 2;
+  }
+
+  // The (desired) format of the resulting bytes.
+  ImgFormat format = 1;
+
+  // [Output Only] The rotation of the image. The image will be rotated
+  // based upon the coarse grained orientation of the device.
+  Rotation rotation = 2;
+
+  // The (desired) width of the image. When passed as input
+  // the image will be scaled to match the given
+  // width, while maintaining the aspect ratio of the device.
+  // The returned image will never exceed the given width, but can be less.
+  // Omitting this value (or passing in 0) will result in no scaling,
+  // and the width of the actual device will be used.
+  uint32 width = 3;
+
+  // The (desired) height of the image.  When passed as input
+  // the image will be scaled to match the given
+  // height, while maintaining the aspect ratio of the device.
+  // The returned image will never exceed the given height, but can be less.
+  // Omitting this value (or passing in 0) will result in no scaling,
+  // and the height of the actual device will be used.
+  uint32 height = 4;
 }
 
 message Image {
-    ImageFormat format = 1;
-    uint32 width = 2;
-    uint32 height = 3;
+  ImageFormat format = 1;
 
-    // The organization of the pixels in the image buffer is from left to
-    // right and bottom up.
-    bytes image = 4;
+  uint32 width = 2 [deprecated = true];   // width is contained in format.
+  uint32 height = 3 [deprecated = true];  // height is contained in format.
+
+  // The organization of the pixels in the image buffer is from left to
+  // right and bottom up.
+  bytes image = 4;
 }
 
 message Rotation {
-    enum SkinRotation {
-        SKIN_ROTATION_0 = 0;
-        SKIN_ROTATION_90 = 1;
-        SKIN_ROTATION_180 = 2;
-        SKIN_ROTATION_270 = 3;
-    }
-    SkinRotation rotation = 1;
+  enum SkinRotation {
+    PORTRAIT = 0;           // 0 degrees
+    REVERSE_LANDSCAPE = 1;  // -90 degrees
+    REVERSE_PORTRAIT = 2;   // -180 degrees
+    LANDSCAPE = 3;          // 90 degrees
+  }
+  SkinRotation rotation = 1;  // Can be inferred from z-axis as well.
+
+  // Specifies the angle of rotation, in degrees [-180, 180]
+  double xAxis = 2;
+  double yAxis = 3;
+  double zAxis = 4;
 }
 
-message TelephoneOperation {
-    enum Operation {
-        InitCall = 0;
-        AcceptCall = 1;
-        RejectCallExplicit = 2;
-        RejectCallBusy = 3;
-        DisconnectCall = 4;
-        PlaceCallOnHold = 5;
-        TakeCallOffHold = 6;
-    }
-    Operation operation = 1;
-    string number = 2;
+message PhoneCall {
+  enum Operation {
+    InitCall = 0;
+    AcceptCall = 1;
+    RejectCallExplicit = 2;
+    RejectCallBusy = 3;
+    DisconnectCall = 4;
+    PlaceCallOnHold = 5;
+    TakeCallOffHold = 6;
+  }
+  Operation operation = 1;
+  string number = 2;
 }
 
-message TelephoneResponse {
-    enum Response {
-        OK = 0;
-        BadOperation = 1;   // Enum out of range
-        BadNumber = 2;      // Mal-formed telephone number
-        InvalidAction = 3;  // E.g., disconnect when no call is in progress
-        ActionFailed = 4;   // Internal error
-        RadioOff = 5;       // Radio power off
-    }
-    Response response = 1;
+message PhoneResponse {
+  enum Response {
+    OK = 0;
+    BadOperation = 1;   // Enum out of range
+    BadNumber = 2;      // Mal-formed telephone number
+    InvalidAction = 3;  // E.g., disconnect when no call is in progress
+    ActionFailed = 4;   // Internal error
+    RadioOff = 5;       // Radio power off
+  }
+  Response response = 1;
 }
 
 message Entry {
-    string key = 1;
-    string value = 2;
+  string key = 1;
+  string value = 2;
 }
 
 message EntryList {
-    repeated Entry entry = 1;
+  repeated Entry entry = 1;
 }
 
 message EmulatorStatus {
-    // The emulator version string.
-    string version = 1;
+  // The emulator version string.
+  string version = 1;
 
-    // The time the emulator has been active in .ms
-    uint64 uptime = 2;
+  // The time the emulator has been active in .ms
+  uint64 uptime = 2;
 
-    // True if the device has completed booting.
-    // For P and later this information will accurate,
-    // for older images we rely on adb.
-    bool booted = 3;
+  // True if the device has completed booting.
+  // For P and later this information will accurate,
+  // for older images we rely on adb.
+  bool booted = 3;
 
-    // The current vm configuration
-    VmConfiguration vmConfig = 4;
+  // The current vm configuration
+  VmConfiguration vmConfig = 4;
 
-    // The hardware configuration of the running emulator as
-    // key valure pairs.
-    EntryList hardwareConfig = 5;
+  // The hardware configuration of the running emulator as
+  // key valure pairs.
+  EntryList hardwareConfig = 5;
 };
diff --git a/darwin-x86_64/lib/snapshot-service.proto b/darwin-x86_64/lib/snapshot-service.proto
deleted file mode 100644
index 4718780..0000000
--- a/darwin-x86_64/lib/snapshot-service.proto
+++ /dev/null
@@ -1,103 +0,0 @@
-// 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;
-}
diff --git a/darwin-x86_64/lib/snapshot.proto b/darwin-x86_64/lib/snapshot.proto
index 9229c09..2b73cb4 100644
--- a/darwin-x86_64/lib/snapshot.proto
+++ b/darwin-x86_64/lib/snapshot.proto
@@ -25,7 +25,7 @@
 
 package emulator_snapshot;
 
-option java_package = "com.android.emulator";
+option java_package = "com.android.emulator.snapshot";
 
 message Image {
     enum Type {
diff --git a/darwin-x86_64/lib/snapshot_service.proto b/darwin-x86_64/lib/snapshot_service.proto
new file mode 100644
index 0000000..75cbdb9
--- /dev/null
+++ b/darwin-x86_64/lib/snapshot_service.proto
@@ -0,0 +1,103 @@
+// 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";
+
+package android.emulation.control;
+
+import "google/protobuf/empty.proto";
+import "snapshot.proto";
+
+option java_multiple_files = true;
+option java_package = "com.android.emulator.control";
+option objc_class_prefix = "AEC";
+
+// 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(SnapshotPackage) returns (stream SnapshotPackage) {}
+
+  // Push a tar.gz stream contain the snapshot.
+  rpc PushSnapshot(stream SnapshotPackage) returns (SnapshotPackage) {}
+
+  // Loads the given snapshot inside the emulator.
+  rpc LoadSnapshot(SnapshotPackage) returns (SnapshotPackage) {}
+
+  // Create as a snapshot of the current state of the emulator.
+  rpc SaveSnapshot(SnapshotPackage) returns (SnapshotPackage) {}
+
+  // Deletes the given snapshot from the avd.
+  rpc DeleteSnapshot(SnapshotPackage) returns (SnapshotPackage) {}
+
+  // Tracks the given process for automated snapshot creation in case of
+  // assert failures.
+  rpc TrackProcess(IceboxTarget) returns (IceboxTarget) {}
+}
+
+message SnapshotPackage {
+  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 package_name = 2;
+
+  // The name of the snapshot that icebox will create if a snapshot is
+  // generated.
+  string snapshot_id = 3;
+
+  // True if icebox failed to track the given target.
+  bool failed = 4;
+
+  // Detailed error message that might provide more information.
+  string err = 5;
+}
diff --git a/darwin-x86_64/lib/waterfall.proto b/darwin-x86_64/lib/waterfall.proto
index cda1e26..ef7cecf 100644
--- a/darwin-x86_64/lib/waterfall.proto
+++ b/darwin-x86_64/lib/waterfall.proto
@@ -57,7 +57,7 @@
   // Whether to pipe stdin to the command
   bool pipeIn = 4;
 
-  // Enviroment to use
+  // Environment to use
   map<string, string> env = 5;
 
 }
@@ -99,7 +99,7 @@
   string addr = 3;
   // Data to be pushed to connection established on addr.
   bytes payload = 4;
-  // Wheter or not to rebind the port
+  // Whether or not to rebind the port.
   bool rebind = 5;
 }
 
@@ -117,7 +117,7 @@
   // Pull file/dir from device to host.
   rpc Pull(Transfer) returns (stream Transfer);
 
-  // Exec executes cmd in the device and foward stdout and stderr to client
+  // Exec executes cmd in the device and forward stdout and stderr to client
   // Exec expects a single initial CmdProgress message if stdin is not
   // being redirected. Otherwise Exec will read std from the stream.
   rpc Exec(stream CmdProgress) returns (stream CmdProgress);
diff --git a/darwin-x86_64/lib64/emulator-studio-view.jar b/darwin-x86_64/lib64/emulator-studio-view.jar
index f923465..97c7341 100644
--- a/darwin-x86_64/lib64/emulator-studio-view.jar
+++ b/darwin-x86_64/lib64/emulator-studio-view.jar
Binary files differ
diff --git a/darwin-x86_64/lib64/libEGL_translator.dylib b/darwin-x86_64/lib64/libEGL_translator.dylib
index df1bdce..33784f6 100755
--- a/darwin-x86_64/lib64/libEGL_translator.dylib
+++ b/darwin-x86_64/lib64/libEGL_translator.dylib
Binary files differ
diff --git a/darwin-x86_64/lib64/libGLES12Translator.dylib b/darwin-x86_64/lib64/libGLES12Translator.dylib
index d2416bf..490000d 100755
--- a/darwin-x86_64/lib64/libGLES12Translator.dylib
+++ b/darwin-x86_64/lib64/libGLES12Translator.dylib
Binary files differ
diff --git a/darwin-x86_64/lib64/libGLES_CM_translator.dylib b/darwin-x86_64/lib64/libGLES_CM_translator.dylib
index 0672bfe..c7c535b 100755
--- a/darwin-x86_64/lib64/libGLES_CM_translator.dylib
+++ b/darwin-x86_64/lib64/libGLES_CM_translator.dylib
Binary files differ
diff --git a/darwin-x86_64/lib64/libGLES_V2_translator.dylib b/darwin-x86_64/lib64/libGLES_V2_translator.dylib
index 2c1c7d1..e7ae8c7 100755
--- a/darwin-x86_64/lib64/libGLES_V2_translator.dylib
+++ b/darwin-x86_64/lib64/libGLES_V2_translator.dylib
Binary files differ
diff --git a/darwin-x86_64/lib64/libOpenglRender.dylib b/darwin-x86_64/lib64/libOpenglRender.dylib
index ebe9c73..f85a9c4 100755
--- a/darwin-x86_64/lib64/libOpenglRender.dylib
+++ b/darwin-x86_64/lib64/libOpenglRender.dylib
Binary files differ
diff --git a/darwin-x86_64/lib64/libandroid-studio.dylib b/darwin-x86_64/lib64/libandroid-studio.dylib
index fa355a2..256f057 100755
--- a/darwin-x86_64/lib64/libandroid-studio.dylib
+++ b/darwin-x86_64/lib64/libandroid-studio.dylib
Binary files differ
diff --git a/darwin-x86_64/lib64/libemugl_common.dylib b/darwin-x86_64/lib64/libemugl_common.dylib
index 933b102..d66a4dc 100755
--- a/darwin-x86_64/lib64/libemugl_common.dylib
+++ b/darwin-x86_64/lib64/libemugl_common.dylib
Binary files differ
diff --git a/darwin-x86_64/mksdcard b/darwin-x86_64/mksdcard
index 864a615..00e56ba 100755
--- a/darwin-x86_64/mksdcard
+++ b/darwin-x86_64/mksdcard
Binary files differ
diff --git a/darwin-x86_64/qemu-img b/darwin-x86_64/qemu-img
index 3af92df..8373cd9 100755
--- a/darwin-x86_64/qemu-img
+++ b/darwin-x86_64/qemu-img
Binary files differ
diff --git a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-aarch64 b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-aarch64
index ca10a13..6e9cbfc 100755
--- a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-aarch64
+++ b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-aarch64
Binary files differ
diff --git a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-aarch64-headless b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-aarch64-headless
index 3ad040d..61699f4 100755
--- a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-aarch64-headless
+++ b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-aarch64-headless
Binary files differ
diff --git a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-armel b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-armel
index 87cd103..8fdef74 100755
--- a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-armel
+++ b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-armel
Binary files differ
diff --git a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-armel-headless b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-armel-headless
index 09e1c2e..d1dc062 100755
--- a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-armel-headless
+++ b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-armel-headless
Binary files differ
diff --git a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-i386 b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-i386
index f8c165e..e81438e 100755
--- a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-i386
+++ b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-i386
Binary files differ
diff --git a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-i386-headless b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-i386-headless
index 9fae4c9..15f053a 100755
--- a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-i386-headless
+++ b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-i386-headless
Binary files differ
diff --git a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-x86_64 b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-x86_64
index b789361..393b6ab 100755
--- a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-x86_64
+++ b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-x86_64
Binary files differ
diff --git a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-x86_64-headless b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-x86_64-headless
index 5d6d214..f923a3b 100755
--- a/darwin-x86_64/qemu/darwin-x86_64/qemu-system-x86_64-headless
+++ b/darwin-x86_64/qemu/darwin-x86_64/qemu-system-x86_64-headless
Binary files differ
diff --git a/darwin-x86_64/source.properties b/darwin-x86_64/source.properties
index 542d799..7216043 100644
--- a/darwin-x86_64/source.properties
+++ b/darwin-x86_64/source.properties
@@ -2,4 +2,4 @@
 Pkg.Revision=30.0.0
 Pkg.Path=emulator
 Pkg.Desc=Android Emulator
-Pkg.BuildId=6185563
\ No newline at end of file
+Pkg.BuildId=6212136
\ No newline at end of file
diff --git a/linux-x86_64/emulator b/linux-x86_64/emulator
index 9ef6dde..4b4d688 100755
--- a/linux-x86_64/emulator
+++ b/linux-x86_64/emulator
Binary files differ
diff --git a/linux-x86_64/emulator-check b/linux-x86_64/emulator-check
index a92a5d7..0b45458 100755
--- a/linux-x86_64/emulator-check
+++ b/linux-x86_64/emulator-check
Binary files differ
diff --git a/linux-x86_64/goldfish-webrtc-bridge b/linux-x86_64/goldfish-webrtc-bridge
index c437ca4..85b19b0 100755
--- a/linux-x86_64/goldfish-webrtc-bridge
+++ b/linux-x86_64/goldfish-webrtc-bridge
Binary files differ
diff --git a/linux-x86_64/lib/advancedFeatures.ini b/linux-x86_64/lib/advancedFeatures.ini
index ff99f47..a953124 100644
--- a/linux-x86_64/lib/advancedFeatures.ini
+++ b/linux-x86_64/lib/advancedFeatures.ini
@@ -291,3 +291,7 @@
 # (VkWriteDescriptorSet, and others)
 # Requires guest support
 VulkanIgnoredHandles = on
+
+# VirtioGpuNext-----------------------------------------------------------------
+# Whether virtio-gpu-next is supported. Requires guest support.
+VirtioGpuNext = on
diff --git a/linux-x86_64/lib/advancedFeaturesCanary.ini b/linux-x86_64/lib/advancedFeaturesCanary.ini
index ef59458..6baeb9d 100644
--- a/linux-x86_64/lib/advancedFeaturesCanary.ini
+++ b/linux-x86_64/lib/advancedFeaturesCanary.ini
@@ -296,3 +296,7 @@
 # (VkWriteDescriptorSet, and others)
 # Requires guest support
 VulkanIgnoredHandles = on
+
+# VirtioGpuNext-----------------------------------------------------------------
+# Whether virtio-gpu-next is supported. Requires guest support.
+VirtioGpuNext = on
diff --git a/linux-x86_64/lib/emulator_controller.proto b/linux-x86_64/lib/emulator_controller.proto
index 42181dd..ed8d54e 100644
--- a/linux-x86_64/lib/emulator_controller.proto
+++ b/linux-x86_64/lib/emulator_controller.proto
@@ -14,261 +14,435 @@
 syntax = "proto3";
 
 option java_multiple_files = true;
-option java_package = "com.android.emulator";
+option java_package = "com.android.emulator.control";
 option objc_class_prefix = "AEC";
 
 package android.emulation.control;
-
 import "google/protobuf/empty.proto";
 
 // An EmulatorController service lets you control the emulator.
+// Note that this is currently an experimental feature, and that the
+// service definition might change without notice. Use at your own risk!
+//
+// We use the following rough conventions:
+//
+// streamXXX --> streams values XXX (usually for emulator lifetime). Values
+//               are updated as soon as they become available.
+// getXXX    --> gets a single value XXX
+// setXXX    --> sets a single value XXX, does not returning state, these
+//               usually have an observable lasting side effect.
+// sendXXX   --> send a single event XXX, possibly returning state information.
+//               android usually responds to these events.
 service EmulatorController {
-    rpc setRotation(Rotation) returns (Rotation) {}
-    rpc getRotation(google.protobuf.Empty) returns (Rotation) {}
+  // set/get/stream the sensor data
+  rpc streamSensor(SensorValue) returns (stream SensorValue) {}
+  rpc getSensor(SensorValue) returns (SensorValue) {}
+  rpc setSensor(SensorValue) returns (google.protobuf.Empty) {}
 
-    rpc setBattery(BatteryState) returns (BatteryState) {}
-    rpc getBattery(google.protobuf.Empty) returns (BatteryState) {}
+  // set/get/stream the physical model, this is likely the one you are
+  // looking for when you wish to modify the device state.
+  rpc setPhysicalModel(PhysicalModelValue) returns (google.protobuf.Empty) {}
+  rpc getPhysicalModel(PhysicalModelValue) returns (PhysicalModelValue) {}
+  rpc streamPhysicalModel(PhysicalModelValue)
+      returns (stream PhysicalModelValue) {}
 
-    rpc getGps(google.protobuf.Empty) returns (GpsState) {}
-    rpc setGps(GpsState) returns (GpsState) {}
+  // Set/get the battery to the given state.
+  rpc setBattery(BatteryState) returns (google.protobuf.Empty) {}
+  rpc getBattery(google.protobuf.Empty) returns (BatteryState) {}
 
-    rpc sendFingerprint(FingerprintEvent) returns (google.protobuf.Empty) {}
-    rpc sendKey(KeyboardEvent) returns (google.protobuf.Empty) {}
+  // Set/get the state of the gps.
+  rpc getGps(google.protobuf.Empty) returns (GpsState) {}
+  rpc setGps(GpsState) returns (google.protobuf.Empty) {}
 
-    // Note that touch events can be used instead of mouse events if desired.
-    rpc sendTouch(TouchEvent) returns (google.protobuf.Empty) {}
-    rpc sendMouse(MouseEvent) returns (google.protobuf.Empty) {}
-    rpc sendRotary(RotaryEvent) returns (google.protobuf.Empty) {}
+  // Simulate a touch event on the finger print sensor.
+  rpc sendFingerprint(Fingerprint) returns (google.protobuf.Empty) {}
 
-    rpc getStatus(google.protobuf.Empty) returns (EmulatorStatus) {}
+  // Send a keyboard event. Translating the event.
+  rpc sendKey(KeyboardEvent) returns (google.protobuf.Empty) {}
 
-    rpc getScreenshot(ImageFormat) returns (Image) {}
+  // Send touch/mouse events. Note that mouse events can be simulated
+  // by touch events.
+  rpc sendTouch(TouchEvent) returns (google.protobuf.Empty) {}
+  rpc sendMouse(MouseEvent) returns (google.protobuf.Empty) {}
 
-    // Returns the last 128Kb of logcat output from the emulator
-    rpc getLogcat(LogMessage) returns (LogMessage) {}
+  // Make a phone call.
+  rpc sendPhone(PhoneCall) returns (PhoneResponse) {}
 
-    // Streams the logcat output from the emulator. The first call
-    // can retrieve up to 128Kb. This call will not return.
-    rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
+  // Retrieve the status of the emulator. This will contain general
+  // hardware information, and whether the device has booted or not.
+  rpc getStatus(google.protobuf.Empty) returns (EmulatorStatus) {}
 
-    rpc usePhone(TelephoneOperation) returns (TelephoneResponse) {}
+  // Gets an individual screenshot in the desired format.
+  //
+  // The image will be scaled to the desired ImageFormat, while maintaining the
+  // aspect ratio. The returned image will never exceed the provided width and
+  // height. Not setting the width or height (i.e. they are 0) will result in
+  // using the device width and height.
+  //
+  // The resulting image will be properly oriented and can be displayed directly
+  // without post processing. For example, if the device has a 1080x1920 screen
+  // and is in landscape mode and called with no width or height parameter, it
+  // will return an 1920x1080 image.
+  rpc getScreenshot(ImageFormat) returns (Image) {}
 
-    // The following endpoints are needed to establish the webrtc protocol
-    // Due to limitiations in Javascript we cannot make use of bidirectional
-    // endpoints See this [blog](https://grpc.io/blog/state-of-grpc-web) for
-    // details.
+  // Streams a series of screenshots in the desired format.
+  // A new frame will be delivered whenever the device produces a new frame.
+  // (Beware that this can produce a significant amout of data, and that
+  // certain translations are (png transform) can be costly).
+  rpc streamScreenshot(ImageFormat) returns (stream Image) {}
 
-    // This function will generate a new identifier that the client
-    // should use for further interaction. It will initiate the
-    // JSEP protocol on the server side.
-    rpc requestRtcStream(google.protobuf.Empty) returns (RtcId) {}
+  // Returns the last 128Kb of logcat output from the emulator
+  // Note that parsed logcat messages are only available after L (Api >23).
+  // it is possible that the logcat buffer gets overwritten, or falls behind.
+  rpc getLogcat(LogMessage) returns (LogMessage) {}
 
-    // Sends the given JsepMsg to the server. The RtcId in the
-    // message should point to an active stream negotiation in
-    // progress, otherwise the message will be ignored.
-    rpc sendJsepMessage(JsepMsg) returns (google.protobuf.Empty) {}
+  // Streams the logcat output from the emulator. The first call
+  // can retrieve up to 128Kb. This call will not return.
+  // Note that parsed logcat messages are only available after L (Api >23)
+  // it is possible that the logcat buffer gets overwritten, or falls behind.
+  rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
 
-    // Reads an available jsep messages for the given client id,
-    // blocking at most 5 seconds, or until one becomes available.
-    //
-    // The ice candidates for example will trickle in on this callback,
-    // as will the SDP negotation.
-    rpc receiveJsepMessage(RtcId) returns (JsepMsg) {}
+  // The following endpoints are needed to establish the webrtc protocol
+  // Due to limitiations in Javascript we cannot make use of bidirectional
+  // endpoints See this [blog](https://grpc.io/blog/state-of-grpc-web) for
+  // details. TODO(jansene): We should move this to a seperate service.
+
+  // This function will generate a new identifier that the client
+  // should use for further interaction. It will initiate the
+  // JSEP protocol on the server side.
+  rpc requestRtcStream(google.protobuf.Empty) returns (RtcId) {}
+
+  // Sends the given JsepMsg to the server. The RtcId in the
+  // message should point to an active stream negotiation in
+  // progress, otherwise the message will be ignored.
+  rpc sendJsepMessage(JsepMsg) returns (google.protobuf.Empty) {}
+
+  // Reads an available jsep messages for the given client id,
+  // blocking at most 5 seconds, or until one becomes available.
+  //
+  // The ice candidates for example will trickle in on this callback,
+  // as will the SDP negotation.
+  rpc receiveJsepMessage(RtcId) returns (JsepMsg) {}
 }
 
+message ParameterValue {
+  repeated float data = 1 [packed = true];
+}
+
+message PhysicalModelValue {
+  enum State {
+    OK = 0;
+    NO_SERVICE = -3;  // qemud service is not available/initiated.
+    DISABLED = -2;    // Sensor is disabled.
+    UNKNOWN = -1;     // Unknown sensor (should not happen)
+  }
+
+  // Details on the sensors documentation can be found here:
+  // https://developer.android.com/reference/android/hardware/Sensor.html#TYPE_
+  enum PhysicalType {
+    POSITION = 0;
+
+    // All values are angles in degrees.
+    // values = [x,y,z]
+    ROTATION = 1;
+
+    MAGNETIC_FIELD = 2;
+
+    // Temperature in °C
+    TEMPERATURE = 3;
+
+    // Proximity sensor distance measured in centimeters
+    PROXIMITY = 4;
+
+    // Ambient light level in SI lux units
+    LIGHT = 5;
+
+    // Atmospheric pressure in hPa (millibar)
+    PRESSURE = 6;
+
+    // Relative ambient air humidity in percent
+    HUMIDITY = 7;
+
+    VELOCITY = 8;
+    AMBIENT_MOTION = 9;
+  }
+  PhysicalType target = 1;
+
+  // [Output Only]
+  State status = 2;
+
+  // Value interpretation depends on sensor, will contain at most 3 values.
+  ParameterValue value = 3;
+}
+
+// A single sensor value.
+message SensorValue {
+  enum State {
+    OK = 0;
+    NO_SERVICE = -3;  // qemud service is not available/initiated.
+    DISABLED = -2;    // Sensor is disabled.
+    UNKNOWN = -1;     // Unknown sensor (should not happen)
+  }
+
+  // These are the various sensors that can be available in an emulated
+  // devices.
+  enum SensorType {
+    // Measures the acceleration force in m/s2 that is applied to a device
+    // on all three physical axes (x, y, and z), including the force of
+    // gravity.
+    ACCELERATION = 0;
+    // Measures a device's rate of rotation in rad/s around each of the
+    // three physical axes (x, y, and z).
+    GYROSCOPE = 1;
+    // Measures the ambient geomagnetic field for all three physical axes
+    // (x, y, z) in μT.
+    MAGNETIC_FIELD = 2;
+    // Measures degrees of rotation that a device makes around all three
+    // physical axes (x, y, z)
+    ORIENTATION = 3;
+    // Measures the temperature of the device in degrees Celsius (°C).
+    TEMPERATURE = 4;
+    // Measures the proximity of an object in cm relative to the view screen
+    // of a device. This sensor is typically used to determine whether a
+    // handset is being held up to a person's ear.
+    PROXIMITY = 5;
+    // Measures the ambient light level (illumination) in lx.
+    LIGHT = 6;
+    // Measures the ambient air pressure in hPa or mbar.
+    PRESSURE = 7;
+    // Measures the relative ambient humidity in percent (%).
+    HUMIDITY = 8;
+    MAGNETIC_FIELD_UNCALIBRATED = 9;
+    GYROSCOPE_UNCALIBRATED = 10;
+  }
+
+  // Type of sensor
+  SensorType target = 1;
+
+  // [Output Only]
+  State status = 2;
+
+  // Value interpretation depends on sensor enum, will contain at most 3 values.
+  ParameterValue value = 3;
+}
 
 message RtcId {
-    // The unique identifier of this connection. You will have to use the same
-    // identifier when sending/receiving messages. The server will generate a
-    // guid when receiving the start message.
-    string guid = 1;
+  // The unique identifier of this connection. You will have to use the
+  // same identifier when sending/receiving messages. The server will
+  // generate a guid when receiving the start message.
+  string guid = 1;
 }
 
 message JsepMsg {
-    // The unique identifier of this connection. You will have to use the same
-    // identifier when sending/receiving messages. The server will generate a
-    // guid when receiving the start message.
-    RtcId id = 1;
-    // The JSON payload. This usually can be directly handled by the Javascript
-    // The dictionary can contain the following properties
-    //
-    // - bye:
-    //        You can hang up now. No new message expected for you.
-    //        The server has stopped the RTC stream.
-    //
-    // - start:
-    //        An RTCConfiguration dictionary providing options to
-    //        configure the new connection. This can include the
-    //        turn configuration the serve is using. This dictionary can be
-    //        passed in directly to the
-    //        [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection)
-    //        object.
-    //
-    // - candidate:
-    //        The WebRTC API's RTCIceCandidateInit dictionary, which
-    //        contains the information needed to fundamentally describe an
-    //        RTCIceCandidate. See
-    //        [RTCIceCandidate](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate)
-    //        and [Session
-    //        Lifetime](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Session_lifetime)
-    //        for more details.
-    //
-    // - sdp:
-    //        RTCSessionDescriptionInit dictionary containing the values
-    //        to that can be assigned to a
-    //        [RTCSessionDescription](https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription)
-    string message = 2;
+  // The unique identifier of this connection. You will have to use the
+  // same identifier when sending/receiving messages. The server will
+  // generate a guid when receiving the start message.
+  RtcId id = 1;
+  // The JSON payload. This usually can be directly handled by the
+  // Javascript The dictionary can contain the following properties
+  //
+  // - bye:
+  //        You can hang up now. No new message expected for you.
+  //        The server has stopped the RTC stream.
+  //
+  // - start:
+  //        An RTCConfiguration dictionary providing options to
+  //        configure the new connection. This can include the
+  //        turn configuration the serve is using. This dictionary can be
+  //        passed in directly to the
+  //        [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection)
+  //        object.
+  //
+  // - candidate:
+  //        The WebRTC API's RTCIceCandidateInit dictionary, which
+  //        contains the information needed to fundamentally describe an
+  //        RTCIceCandidate. See
+  //        [RTCIceCandidate](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate)
+  //        and [Session
+  //        Lifetime](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Session_lifetime)
+  //        for more details.
+  //
+  // - sdp:
+  //        RTCSessionDescriptionInit dictionary containing the values
+  //        to that can be assigned to a
+  //        [RTCSessionDescription](https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription)
+  string message = 2;
 }
 
 message LogMessage {
-    // [Output Only] The contents of the log output.
-    string contents = 1;
-    // The starting byte position of the output that was returned. This should
-    // match the start parameter sent with the request. If the serial console
-    // output exceeds the size of the buffer, older output will be overwritten
-    // by newer content and the start values will be mismatched.
-    int64 start = 2;
-    //[Output Only] The position of the next byte of content from the serial
-    // console output. Use this value in the next request as the start
-    // parameter.
-    int64 next = 3;
+  // [Output Only] The contents of the log output.
+  string contents = 1;
+  // The starting byte position of the output that was returned. This
+  // should match the start parameter sent with the request. If the serial
+  // console output exceeds the size of the buffer, older output will be
+  // overwritten by newer content and the start values will be mismatched.
+  int64 start = 2;
+  //[Output Only] The position of the next byte of content from the serial
+  // console output. Use this value in the next request as the start
+  // parameter.
+  int64 next = 3;
 
-    // Set the sort of response you are interested it in.
-    // It the type is "Parsed" the entries field will contain the parsed
-    // results. otherwise the contents field will be set.
-    LogType sort = 4;
+  // Set the sort of response you are interested it in.
+  // It the type is "Parsed" the entries field will contain the parsed
+  // results. otherwise the contents field will be set.
+  LogType sort = 4;
 
-    // [Output Only] The parsed logcat entries so far. Only set if sort is set
-    // to Parsed
-    repeated LogcatEntry entries = 5;
+  // [Output Only] The parsed logcat entries so far. Only set if sort is
+  // set to Parsed
+  repeated LogcatEntry entries = 5;
 
-    enum LogType {
-        Text = 0;
-        Parsed = 1;
-    }
+  enum LogType {
+    Text = 0;
+    Parsed = 1;
+  }
 }
 
+// A parsed logcat entry.
 message LogcatEntry {
-    enum LogLevel {
-        UNKNOWN = 0;
-        DEFAULT = 1;
-        VERBOSE = 2;
-        DEBUG = 3;
-        INFO = 4;
-        WARN = 5;
-        ERR = 6;
-        FATAL = 7;
-        SILENT = 8;
-    };
+  // The possible log levels.
+  enum LogLevel {
+    UNKNOWN = 0;
+    DEFAULT = 1;
+    VERBOSE = 2;
+    DEBUG = 3;
+    INFO = 4;
+    WARN = 5;
+    ERR = 6;
+    FATAL = 7;
+    SILENT = 8;
+  };
 
-    uint64 timestamp = 1;
-    uint32 pid = 2;
-    uint32 tid = 3;
-    LogLevel level = 4;
-    string tag = 5;
-    string msg = 6;
+  // A Unix timestamps in  milliseconds (The number of milliseconds that
+  // have elapsed since January 1, 1970 (midnight UTC/GMT), not counting
+  // leap seconds)
+  uint64 timestamp = 1;
+
+  // Process id.
+  uint32 pid = 2;
+
+  // Thread id.
+  uint32 tid = 3;
+  LogLevel level = 4;
+  string tag = 5;
+  string msg = 6;
 }
 
+// Information about the hypervisor that is currently in use.
 message VmConfiguration {
-    enum VmHypervisorType {
-        HV_UNKNOWN = 0;
-        HV_NONE = 1;
-        HV_KVM = 2;
-        HV_HAXM = 3;
-        HV_HVF = 4;
-        HV_WHPX = 5;
-        HV_GVM = 6;
-    };
+  enum VmHypervisorType {
+    // An unknown hypervisor
+    UNKNOWN = 0;
 
-    VmHypervisorType hypervisorType = 1;
-    int32 numberOfCpuCores = 2;
-    int64 ramSizeBytes = 3;
+    // No hypervisor is in use. This usually means that the guest is
+    // running on a different CPU than the host, or you are using a
+    // platform where no hypervisor is available.
+    NONE = 1;
+
+    // The Kernel based Virtual Machine
+    // (https://www.linux-kvm.org/page/Main_Page)
+    KVM = 2;
+
+    // Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
+    // https://github.com/intel/haxm
+    HAXM = 3;
+
+    // Hypervisor Framework.
+    // https://developer.apple.com/documentation/hypervisor
+    HVF = 4;
+
+    // Window Hypervisor Platform
+    // https://docs.microsoft.com/en-us/virtualization/api/
+    WHPX = 5;
+
+    GVM = 6;
+  };
+
+  VmHypervisorType hypervisorType = 1;
+  int32 numberOfCpuCores = 2;
+  int64 ramSizeBytes = 3;
 }
 
-message RotaryEvent {
-    int32 delta = 1;
-}
-
-// The Touch interface represents a single contact point on a touch-sensitive
-// device. The contact point is commonly a finger or stylus and the device may
-// be a touchscreen or trackpad.
+// The Touch interface represents a single contact point on a
+// touch-sensitive device. The contact point is commonly a finger or stylus
+// and the device may be a touchscreen or trackpad.
 message Touch {
-    // The horizontal coordinate. This is the physical location on the screen
-    // For example 0 indicates the leftmost coordinate.
-    int32 x = 1;
+  // The horizontal coordinate. This is the physical location on the
+  // screen For example 0 indicates the leftmost coordinate.
+  int32 x = 1;
 
-    // The vertical coordinate. This is the physical location on the screen
-    // For example 0 indicates the top left coordinate.
-    int32 y = 2;
+  // The vertical coordinate. This is the physical location on the screen
+  // For example 0 indicates the top left coordinate.
+  int32 y = 2;
 
-    // The identifier is an arbitrary non-negative integer that is used to
-    // identify and track each tool independently when multiple tools are
-    // active. For example, when multiple fingers are touching the device, each
-    // finger should be assigned a distinct tracking id that is used as long as
-    // the finger remains in contact. Tracking ids may be reused when their
-    // associated tools move out of range.
-    //
-    // The emulator currently supports up to 10 concurrent touch events. The
-    // identifier should be a value from the set [0, 10]
-    int32 identifier = 3;
+  // The identifier is an arbitrary non-negative integer that is used to
+  // identify and track each tool independently when multiple tools are
+  // active. For example, when multiple fingers are touching the device,
+  // each finger should be assigned a distinct tracking id that is used as
+  // long as the finger remains in contact. Tracking ids may be reused
+  // when their associated tools move out of range.
+  //
+  // The emulator currently supports up to 10 concurrent touch events. The
+  // identifier should be a value from the set [0, 10]
+  int32 identifier = 3;
 
-    // Reports the physical pressure applied to the tip of the tool or the
-    // signal strength of the touch contact.
-    //
-    // The values reported must be non-zero when the tool is touching the device
-    // and zero otherwise to indicate that the touch event is completed.
-    //
-    // Make sure to deliver a pressure of 0 for the given identifier when the
-    // touch event is completed, otherwise the touch identifier will not be
-    // unregistered!
-    int32 pressure = 4;
+  // Reports the physical pressure applied to the tip of the tool or the
+  // signal strength of the touch contact.
+  //
+  // The values reported must be non-zero when the tool is touching the
+  // device and zero otherwise to indicate that the touch event is
+  // completed.
+  //
+  // Make sure to deliver a pressure of 0 for the given identifier when
+  // the touch event is completed, otherwise the touch identifier will not
+  // be unregistered!
+  int32 pressure = 4;
 
-    // Optionally reports the cross-sectional area of the touch contact, or the
-    // length of the longer dimension of the touch contact.
-    int32 touch_major = 5;
+  // Optionally reports the cross-sectional area of the touch contact, or
+  // the length of the longer dimension of the touch contact.
+  int32 touch_major = 5;
 
-    // Optionally reports the length of the shorter dimension of the touch
-    // contact. This axis will be ignored if touch_major is reporting an area
-    // measurement greater than 0.
-    int32 touch_minor = 6;
+  // Optionally reports the length of the shorter dimension of the touch
+  // contact. This axis will be ignored if touch_major is reporting an
+  // area measurement greater than 0.
+  int32 touch_minor = 6;
 }
 
-// A TouchEvent contains a list of Touch objects that are in contact with the
-// touch surface.
+// A TouchEvent contains a list of Touch objects that are in contact with
+// the touch surface.
 //
 // Touch events are delivered in sequence as specified in the touchList.
 //
 // TouchEvents are delivered to the emulated devices using ["Protocol
 // B"](https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt)
 message TouchEvent {
-    // The list of Touch objects, note that these do not need to be unique
-    repeated Touch touches = 1;
+  // The list of Touch objects, note that these do not need to be unique
+  repeated Touch touches = 1;
 
-    // The display device where the touch event occurred.
-    // Omitting or using the value 0 indicates the main display.
-    int32 device = 2;
+  // The display device where the touch event occurred.
+  // Omitting or using the value 0 indicates the main display.
+  int32 device = 2;
 }
 
 // The MouseEvent interface represents events that occur due to the user
 // interacting with a pointing device (such as a mouse).
 message MouseEvent {
-    // The horizontal coordinate. This is the physical location on the screen
-    // For example 0 indicates the leftmost coordinate.
-    int32 x = 1;
+  // The horizontal coordinate. This is the physical location on the
+  // screen For example 0 indicates the leftmost coordinate.
+  int32 x = 1;
 
-    // The vertical coordinate. This is the physical location on the screen
-    // For example 0 indicates the top left coordinate.
-    int32 y = 2;
+  // The vertical coordinate. This is the physical location on the screen
+  // For example 0 indicates the top left coordinate.
+  int32 y = 2;
 
-    // Indicates which buttons are pressed.
-    // 0: No button was pressed
-    // 1: Primary button (left)
-    // 2: Secondary button (right)
-    int32 buttons = 3;
+  // Indicates which buttons are pressed.
+  // 0: No button was pressed
+  // 1: Primary button (left)
+  // 2: Secondary button (right)
+  int32 buttons = 3;
 
-    // The display device where the mouse event occurred.
-    // Omitting or using the value 0 indicates the main display.
-    int32 device = 4;
+  // The display device where the mouse event occurred.
+  // Omitting or using the value 0 indicates the main display.
+  int32 device = 4;
 }
 
 // KeyboardEvent objects describe a user interaction with the keyboard; each
@@ -280,201 +454,249 @@
 // Note: that only keyCode, key, or text can be set and that the semantics
 // will slightly vary.
 message KeyboardEvent {
-    // Code types that the emulator can receive. Note that the emulator
-    // will do its best to translate the code to an evdev value that
-    // will be send to the emulator. This translation is based on
-    // the chromium translation tables. See
-    // https://chromium.googlesource.com/chromium/src/+/lkgr/ui/events/keycodes/dom/keycode_converter_data.inc
-    // for details on the translation.
-    enum KeyCodeType {
-        Usb = 0;
-        Evdev = 1;
-        XKB = 2;
-        Win = 3;
-        Mac = 4;
-    };
+  // Code types that the emulator can receive. Note that the emulator
+  // will do its best to translate the code to an evdev value that
+  // will be send to the emulator. This translation is based on
+  // the chromium translation tables. See
+  // https://chromium.googlesource.com/chromium/src/+/lkgr/ui/events/keycodes/dom/keycode_converter_data.inc
+  // for details on the translation.
+  enum KeyCodeType {
+    Usb = 0;
+    Evdev = 1;
+    XKB = 2;
+    Win = 3;
+    Mac = 4;
+  };
 
-    enum KeyEventType {
-        // Indicates that this keyevent should be send to the emulator
-        // as a key down event. Meaning that the key event will be
-        // translated to an EvDev event type and bit 11 (0x400) will be
-        // set before it is sent to the emulator.
-        keydown = 0;
+  enum KeyEventType {
+    // Indicates that this keyevent should be send to the emulator
+    // as a key down event. Meaning that the key event will be
+    // translated to an EvDev event type and bit 11 (0x400) will be
+    // set before it is sent to the emulator.
+    keydown = 0;
 
-        // Indicates that the keyevent should be send to the emulator
-        // as a key up event. Meaning that the key event will be
-        // translated to an EvDev event type and
-        // sent to the emulator.
-        keyup = 1;
+    // Indicates that the keyevent should be send to the emulator
+    // as a key up event. Meaning that the key event will be
+    // translated to an EvDev event type and
+    // sent to the emulator.
+    keyup = 1;
 
-        // Indicates that the keyevent will be send to the emulator
-        // as e key down event and immediately followed by a keyup event.
-        keypress = 2;
-    };
+    // Indicates that the keyevent will be send to the emulator
+    // as e key down event and immediately followed by a keyup event.
+    keypress = 2;
+  };
 
-    // Type of keycode contained in the keyCode field.
-    KeyCodeType codeType = 1;
+  // Type of keycode contained in the keyCode field.
+  KeyCodeType codeType = 1;
 
-    // The type of keyboard event that should be sent to the emulator
-    KeyEventType eventType = 2;
+  // The type of keyboard event that should be sent to the emulator
+  KeyEventType eventType = 2;
 
-    // This property represents a physical key on the keyboard (as opposed to
-    // the character generated by pressing the key). In other words, this
-    // property is a value which isn't altered by keyboard layout or the state
-    // of the modifier keys. This value will be interpreted by
-    // the emulator depending on the KeyCodeType. The incoming key code will be
-    // translated to an evdev code type and send to the emulator.
-    // The values in key and text will be ignored.
-    int32 keyCode = 3;
+  // This property represents a physical key on the keyboard (as opposed
+  // to the character generated by pressing the key). In other words, this
+  // property is a value which isn't altered by keyboard layout or the
+  // state of the modifier keys. This value will be interpreted by the
+  // emulator depending on the KeyCodeType. The incoming key code will be
+  // translated to an evdev code type and send to the emulator.
+  // The values in key and text will be ignored.
+  int32 keyCode = 3;
 
-    // The value of the key pressed by the user, taking into consideration the
-    // state of modifier keys such as Shift as well as the keyboard locale and
-    // layout. This follows the  w3c standard used in browsers.
-    // You can find an accurate description of valid values
-    // (here)[https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values]
-    // The values in text, keyCode, eventType and codeType will be ignored and a
-    // keypress event will be delivered to the emulator.
-    string key = 4;
+  // The value of the key pressed by the user, taking into consideration
+  // the state of modifier keys such as Shift as well as the keyboard
+  // locale and layout. This follows the  w3c standard used in browsers.
+  // You can find an accurate description of valid values
+  // (here)[https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values]
+  // The values in text, keyCode, eventType and codeType will be ignored
+  // and a keypress event will be delivered to the emulator.
+  string key = 4;
 
-    // Series of utf8 encoded characters to send to the emulator. Every
-    // character will be translated to an EvDev event type and send to the
-    // emulator as a keypress event. The values in keyCode, eventType, codeType
-    // and key will be ignored.
-    string text = 5;
+  // Series of utf8 encoded characters to send to the emulator. Every
+  // character will be translated to an EvDev event type and send to the
+  // emulator as a keypress event. The values in keyCode, eventType,
+  // codeType and key will be ignored.
+  string text = 5;
 }
 
-message FingerprintEvent {
-    bool isTouching = 1;
-    int32 touchId = 2;
+message Fingerprint {
+  // True when the fingprint is touched.
+  bool isTouching = 1;
+
+  // The identifier of the registered fingerprint.
+  int32 touchId = 2;
 }
 
 message GpsState {
-    bool passiveUpdate = 1;
-    double latitude = 2;
-    double longitude = 3;
-    double speed = 4;
-    double heading = 5;
-    double elevation = 6;
-    int32 satellites = 7;
+  bool passiveUpdate = 1;
+
+  // The latitude, in degrees.
+  double latitude = 2;
+
+  // The longitude, in degrees.
+  double longitude = 3;
+
+  // The speed if it is available, in meters/second over ground
+  double speed = 4;
+
+  // gets the horizontal direction of travel of this device, and is not
+  // related to the device orientation. It is guaranteed to be in the
+  // range [0.0, 360.0] if the device has a bearing. 0=North, 90=East,
+  // 180=South, etc..
+  double bearing = 5;
+
+  // The altitude if available, in meters above the WGS 84 reference
+  // ellipsoid.
+  double altitude = 6;
+
+  // The number of satellites used to derive the fix
+  int32 satellites = 7;
 }
 
 message BatteryState {
-    enum BatteryStatus {
-        BATTERY_STATUS_UNKNOWN = 0;
-        BATTERY_STATUS_CHARGING = 1;
-        BATTERY_STATUS_DISCHARGING = 2;
-        BATTERY_STATUS_NOT_CHARGING = 3;
-        BATTERY_STATUS_FULL = 4;
-    };
-    enum BatteryCharger {
-        BATTERY_CHARGER_NONE = 0;
-        BATTERY_CHARGER_AC = 1;
-        BATTERY_CHARGER_USB = 2;
-        BATTERY_CHARGER_WIRELESS = 3;
-    };
+  enum BatteryStatus {
+    UNKNOWN = 0;
+    CHARGING = 1;
+    DISCHARGING = 2;
+    NOT_CHARGING = 3;
+    FULL = 4;
+  };
+  enum BatteryCharger {
+    NONE = 0;
+    AC = 1;
+    USB = 2;
+    WIRELESS = 3;
+  };
 
-    enum BatteryHealth {
-        BATTERY_HEALTH_GOOD = 0;
-        BATTERY_HEALTH_FAILED = 1;
-        BATTERY_HEALTH_DEAD = 2;
-        BATTERY_HEALTH_OVERVOLTAGE = 3;
-        BATTERY_HEALTH_OVERHEATED = 4;
-    };
-    bool hasBattery = 1;
-    bool isPresent = 2;
-    BatteryCharger charger = 3;
-    int32 chargeLevel = 4;
-    BatteryHealth health = 5;
-    BatteryStatus status = 6;
-}
-
-message ImageStream {
-    uint32 framerate = 1;
-    ImageFormat format = 2;
+  enum BatteryHealth {
+    GOOD = 0;
+    FAILED = 1;
+    DEAD = 2;
+    OVERVOLTAGE = 3;
+    OVERHEATED = 4;
+  };
+  bool hasBattery = 1;
+  bool isPresent = 2;
+  BatteryCharger charger = 3;
+  int32 chargeLevel = 4;
+  BatteryHealth health = 5;
+  BatteryStatus status = 6;
 }
 
 message ImageFormat {
-    enum ImgFormat {
-        PNG = 0;
-        RAW = 1;
-        RGB888 = 2;
-        RGBA8888 = 3;
-    }
-    ImgFormat format = 1;
-    Rotation rotation = 2;
+  enum ImgFormat {
+    // Portable Network Graphics format
+    // (https://en.wikipedia.org/wiki/Portable_Network_Graphics)
+    PNG = 0;
+
+    // Three-channel RGB color model supplemented with a fourth alpha
+    // channel. https://en.wikipedia.org/wiki/RGBA_color_model
+    // Each pixel consists of 4 bytes.
+    RGBA8888 = 1;
+
+    // Three-channel RGB color model, each pixel consists of 3 bytes
+    RGB888 = 2;
+  }
+
+  // The (desired) format of the resulting bytes.
+  ImgFormat format = 1;
+
+  // [Output Only] The rotation of the image. The image will be rotated
+  // based upon the coarse grained orientation of the device.
+  Rotation rotation = 2;
+
+  // The (desired) width of the image. When passed as input
+  // the image will be scaled to match the given
+  // width, while maintaining the aspect ratio of the device.
+  // The returned image will never exceed the given width, but can be less.
+  // Omitting this value (or passing in 0) will result in no scaling,
+  // and the width of the actual device will be used.
+  uint32 width = 3;
+
+  // The (desired) height of the image.  When passed as input
+  // the image will be scaled to match the given
+  // height, while maintaining the aspect ratio of the device.
+  // The returned image will never exceed the given height, but can be less.
+  // Omitting this value (or passing in 0) will result in no scaling,
+  // and the height of the actual device will be used.
+  uint32 height = 4;
 }
 
 message Image {
-    ImageFormat format = 1;
-    uint32 width = 2;
-    uint32 height = 3;
+  ImageFormat format = 1;
 
-    // The organization of the pixels in the image buffer is from left to
-    // right and bottom up.
-    bytes image = 4;
+  uint32 width = 2 [deprecated = true];   // width is contained in format.
+  uint32 height = 3 [deprecated = true];  // height is contained in format.
+
+  // The organization of the pixels in the image buffer is from left to
+  // right and bottom up.
+  bytes image = 4;
 }
 
 message Rotation {
-    enum SkinRotation {
-        SKIN_ROTATION_0 = 0;
-        SKIN_ROTATION_90 = 1;
-        SKIN_ROTATION_180 = 2;
-        SKIN_ROTATION_270 = 3;
-    }
-    SkinRotation rotation = 1;
+  enum SkinRotation {
+    PORTRAIT = 0;           // 0 degrees
+    REVERSE_LANDSCAPE = 1;  // -90 degrees
+    REVERSE_PORTRAIT = 2;   // -180 degrees
+    LANDSCAPE = 3;          // 90 degrees
+  }
+  SkinRotation rotation = 1;  // Can be inferred from z-axis as well.
+
+  // Specifies the angle of rotation, in degrees [-180, 180]
+  double xAxis = 2;
+  double yAxis = 3;
+  double zAxis = 4;
 }
 
-message TelephoneOperation {
-    enum Operation {
-        InitCall = 0;
-        AcceptCall = 1;
-        RejectCallExplicit = 2;
-        RejectCallBusy = 3;
-        DisconnectCall = 4;
-        PlaceCallOnHold = 5;
-        TakeCallOffHold = 6;
-    }
-    Operation operation = 1;
-    string number = 2;
+message PhoneCall {
+  enum Operation {
+    InitCall = 0;
+    AcceptCall = 1;
+    RejectCallExplicit = 2;
+    RejectCallBusy = 3;
+    DisconnectCall = 4;
+    PlaceCallOnHold = 5;
+    TakeCallOffHold = 6;
+  }
+  Operation operation = 1;
+  string number = 2;
 }
 
-message TelephoneResponse {
-    enum Response {
-        OK = 0;
-        BadOperation = 1;   // Enum out of range
-        BadNumber = 2;      // Mal-formed telephone number
-        InvalidAction = 3;  // E.g., disconnect when no call is in progress
-        ActionFailed = 4;   // Internal error
-        RadioOff = 5;       // Radio power off
-    }
-    Response response = 1;
+message PhoneResponse {
+  enum Response {
+    OK = 0;
+    BadOperation = 1;   // Enum out of range
+    BadNumber = 2;      // Mal-formed telephone number
+    InvalidAction = 3;  // E.g., disconnect when no call is in progress
+    ActionFailed = 4;   // Internal error
+    RadioOff = 5;       // Radio power off
+  }
+  Response response = 1;
 }
 
 message Entry {
-    string key = 1;
-    string value = 2;
+  string key = 1;
+  string value = 2;
 }
 
 message EntryList {
-    repeated Entry entry = 1;
+  repeated Entry entry = 1;
 }
 
 message EmulatorStatus {
-    // The emulator version string.
-    string version = 1;
+  // The emulator version string.
+  string version = 1;
 
-    // The time the emulator has been active in .ms
-    uint64 uptime = 2;
+  // The time the emulator has been active in .ms
+  uint64 uptime = 2;
 
-    // True if the device has completed booting.
-    // For P and later this information will accurate,
-    // for older images we rely on adb.
-    bool booted = 3;
+  // True if the device has completed booting.
+  // For P and later this information will accurate,
+  // for older images we rely on adb.
+  bool booted = 3;
 
-    // The current vm configuration
-    VmConfiguration vmConfig = 4;
+  // The current vm configuration
+  VmConfiguration vmConfig = 4;
 
-    // The hardware configuration of the running emulator as
-    // key valure pairs.
-    EntryList hardwareConfig = 5;
+  // The hardware configuration of the running emulator as
+  // key valure pairs.
+  EntryList hardwareConfig = 5;
 };
diff --git a/linux-x86_64/lib/snapshot-service.proto b/linux-x86_64/lib/snapshot-service.proto
deleted file mode 100644
index 4718780..0000000
--- a/linux-x86_64/lib/snapshot-service.proto
+++ /dev/null
@@ -1,103 +0,0 @@
-// 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;
-}
diff --git a/linux-x86_64/lib/snapshot.proto b/linux-x86_64/lib/snapshot.proto
index 9229c09..2b73cb4 100644
--- a/linux-x86_64/lib/snapshot.proto
+++ b/linux-x86_64/lib/snapshot.proto
@@ -25,7 +25,7 @@
 
 package emulator_snapshot;
 
-option java_package = "com.android.emulator";
+option java_package = "com.android.emulator.snapshot";
 
 message Image {
     enum Type {
diff --git a/linux-x86_64/lib/snapshot_service.proto b/linux-x86_64/lib/snapshot_service.proto
new file mode 100644
index 0000000..75cbdb9
--- /dev/null
+++ b/linux-x86_64/lib/snapshot_service.proto
@@ -0,0 +1,103 @@
+// 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";
+
+package android.emulation.control;
+
+import "google/protobuf/empty.proto";
+import "snapshot.proto";
+
+option java_multiple_files = true;
+option java_package = "com.android.emulator.control";
+option objc_class_prefix = "AEC";
+
+// 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(SnapshotPackage) returns (stream SnapshotPackage) {}
+
+  // Push a tar.gz stream contain the snapshot.
+  rpc PushSnapshot(stream SnapshotPackage) returns (SnapshotPackage) {}
+
+  // Loads the given snapshot inside the emulator.
+  rpc LoadSnapshot(SnapshotPackage) returns (SnapshotPackage) {}
+
+  // Create as a snapshot of the current state of the emulator.
+  rpc SaveSnapshot(SnapshotPackage) returns (SnapshotPackage) {}
+
+  // Deletes the given snapshot from the avd.
+  rpc DeleteSnapshot(SnapshotPackage) returns (SnapshotPackage) {}
+
+  // Tracks the given process for automated snapshot creation in case of
+  // assert failures.
+  rpc TrackProcess(IceboxTarget) returns (IceboxTarget) {}
+}
+
+message SnapshotPackage {
+  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 package_name = 2;
+
+  // The name of the snapshot that icebox will create if a snapshot is
+  // generated.
+  string snapshot_id = 3;
+
+  // True if icebox failed to track the given target.
+  bool failed = 4;
+
+  // Detailed error message that might provide more information.
+  string err = 5;
+}
diff --git a/linux-x86_64/lib/waterfall.proto b/linux-x86_64/lib/waterfall.proto
index cda1e26..ef7cecf 100644
--- a/linux-x86_64/lib/waterfall.proto
+++ b/linux-x86_64/lib/waterfall.proto
@@ -57,7 +57,7 @@
   // Whether to pipe stdin to the command
   bool pipeIn = 4;
 
-  // Enviroment to use
+  // Environment to use
   map<string, string> env = 5;
 
 }
@@ -99,7 +99,7 @@
   string addr = 3;
   // Data to be pushed to connection established on addr.
   bytes payload = 4;
-  // Wheter or not to rebind the port
+  // Whether or not to rebind the port.
   bool rebind = 5;
 }
 
@@ -117,7 +117,7 @@
   // Pull file/dir from device to host.
   rpc Pull(Transfer) returns (stream Transfer);
 
-  // Exec executes cmd in the device and foward stdout and stderr to client
+  // Exec executes cmd in the device and forward stdout and stderr to client
   // Exec expects a single initial CmdProgress message if stdin is not
   // being redirected. Otherwise Exec will read std from the stream.
   rpc Exec(stream CmdProgress) returns (stream CmdProgress);
diff --git a/linux-x86_64/lib64/emulator-studio-view.jar b/linux-x86_64/lib64/emulator-studio-view.jar
index 623b42f..1ef4b26 100644
--- a/linux-x86_64/lib64/emulator-studio-view.jar
+++ b/linux-x86_64/lib64/emulator-studio-view.jar
Binary files differ
diff --git a/linux-x86_64/lib64/libGLES_CM_translator.so b/linux-x86_64/lib64/libGLES_CM_translator.so
index fc57fc8..4e9286a 100644
--- a/linux-x86_64/lib64/libGLES_CM_translator.so
+++ b/linux-x86_64/lib64/libGLES_CM_translator.so
Binary files differ
diff --git a/linux-x86_64/lib64/libGLES_V2_translator.so b/linux-x86_64/lib64/libGLES_V2_translator.so
index 6d39a99..7aeac2c 100644
--- a/linux-x86_64/lib64/libGLES_V2_translator.so
+++ b/linux-x86_64/lib64/libGLES_V2_translator.so
Binary files differ
diff --git a/linux-x86_64/lib64/libOpenglRender.so b/linux-x86_64/lib64/libOpenglRender.so
index d132a42..59a0677 100644
--- a/linux-x86_64/lib64/libOpenglRender.so
+++ b/linux-x86_64/lib64/libOpenglRender.so
Binary files differ
diff --git a/linux-x86_64/lib64/libemugl_common.so b/linux-x86_64/lib64/libemugl_common.so
index 880c254..b961692 100644
--- a/linux-x86_64/lib64/libemugl_common.so
+++ b/linux-x86_64/lib64/libemugl_common.so
Binary files differ
diff --git a/linux-x86_64/qemu-img b/linux-x86_64/qemu-img
index cd0ad2b..8e3ee03 100755
--- a/linux-x86_64/qemu-img
+++ b/linux-x86_64/qemu-img
Binary files differ
diff --git a/linux-x86_64/qemu/linux-x86_64/qemu-system-aarch64 b/linux-x86_64/qemu/linux-x86_64/qemu-system-aarch64
index 5c092d0..2e70f4a 100755
--- a/linux-x86_64/qemu/linux-x86_64/qemu-system-aarch64
+++ b/linux-x86_64/qemu/linux-x86_64/qemu-system-aarch64
Binary files differ
diff --git a/linux-x86_64/qemu/linux-x86_64/qemu-system-aarch64-headless b/linux-x86_64/qemu/linux-x86_64/qemu-system-aarch64-headless
index 08c4027..ec0fb52 100755
--- a/linux-x86_64/qemu/linux-x86_64/qemu-system-aarch64-headless
+++ b/linux-x86_64/qemu/linux-x86_64/qemu-system-aarch64-headless
Binary files differ
diff --git a/linux-x86_64/qemu/linux-x86_64/qemu-system-armel b/linux-x86_64/qemu/linux-x86_64/qemu-system-armel
index ba446df..3e04ada 100755
--- a/linux-x86_64/qemu/linux-x86_64/qemu-system-armel
+++ b/linux-x86_64/qemu/linux-x86_64/qemu-system-armel
Binary files differ
diff --git a/linux-x86_64/qemu/linux-x86_64/qemu-system-armel-headless b/linux-x86_64/qemu/linux-x86_64/qemu-system-armel-headless
index 40ef61f..d18ef14 100755
--- a/linux-x86_64/qemu/linux-x86_64/qemu-system-armel-headless
+++ b/linux-x86_64/qemu/linux-x86_64/qemu-system-armel-headless
Binary files differ
diff --git a/linux-x86_64/qemu/linux-x86_64/qemu-system-i386 b/linux-x86_64/qemu/linux-x86_64/qemu-system-i386
index 8c94cc9..10ba566 100755
--- a/linux-x86_64/qemu/linux-x86_64/qemu-system-i386
+++ b/linux-x86_64/qemu/linux-x86_64/qemu-system-i386
Binary files differ
diff --git a/linux-x86_64/qemu/linux-x86_64/qemu-system-i386-headless b/linux-x86_64/qemu/linux-x86_64/qemu-system-i386-headless
index cd71e6f..b78743f 100755
--- a/linux-x86_64/qemu/linux-x86_64/qemu-system-i386-headless
+++ b/linux-x86_64/qemu/linux-x86_64/qemu-system-i386-headless
Binary files differ
diff --git a/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64 b/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64
index 6f79356..f693538 100755
--- a/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64
+++ b/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64
Binary files differ
diff --git a/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64-headless b/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64-headless
index ec85a1e..1e7fa5d 100755
--- a/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64-headless
+++ b/linux-x86_64/qemu/linux-x86_64/qemu-system-x86_64-headless
Binary files differ
diff --git a/linux-x86_64/source.properties b/linux-x86_64/source.properties
index 542d799..7216043 100644
--- a/linux-x86_64/source.properties
+++ b/linux-x86_64/source.properties
@@ -2,4 +2,4 @@
 Pkg.Revision=30.0.0
 Pkg.Path=emulator
 Pkg.Desc=Android Emulator
-Pkg.BuildId=6185563
\ No newline at end of file
+Pkg.BuildId=6212136
\ No newline at end of file
diff --git a/update_emulator_linux.sh b/update_emulator_linux.sh
new file mode 100755
index 0000000..c32ea2e
--- /dev/null
+++ b/update_emulator_linux.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# Find builds here:
+# https://android-build.googleplex.com/builds/branches/aosp-emu-master-dev/grid?
+set -e
+
+function update_binaries {
+	local src="$1"
+	local dst="$2"
+
+	rm -rf "$dst"
+	rm -rf "emulator"
+	unzip "$src"
+	rm -f "./emulator/emulator64-crash-service"
+	rm -f "./emulator/emulator64-mips"
+	rm -f "./emulator/qemu/linux-x86_64/qemu-system-mipsel"
+	rm -f "./emulator/qemu/linux-x86_64/qemu-system-mips64el"
+	mv "emulator" "$dst"
+	git add "$dst"
+}
+
+if [ $# == 1 ]
+then
+build=$1
+else
+	echo  Usage: $0 build
+	exit 1
+fi
+
+linux_zip="sdk-repo-linux-emulator-$build.zip"
+
+echo Fetching Linux $build
+/google/data/ro/projects/android/fetch_artifact --bid $build --target sdk_tools_linux "$linux_zip"
+update_binaries "$linux_zip" "linux-x86_64"
+
+printf "Upgrade emulator to emu-master-dev build $build\n\n" > emulator.commitmsg
+
+git commit -s -t emulator.commitmsg
+
+rm -f "emulator.commitmsg"
+rm -f "$linux_zip"