[ VM / Service ] Roll back major revision, update to 3.39

The major revision bump is causing Intellij users to be unable to debug
as the Dart and Flutter plugins both bail out if the VM service major
revision is not 3. This change will allow for these plugins to keep
working.

This is technically breaking the semver contract as the following RPCs
and objects have been removed:

- getClientName
- getWebSocketTarget
- setClientName
- requireResumeApproval
- ClientName
- WebSocketTarget

However, these RPCs were never used by first party tooling and it's
highly unlikely that they were used externally, so removing these RPCs
is unlikely to break anyone.

Change-Id: Ie8e2705545682e96c3dab4c0787a1e88cd8a19d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162240
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
diff --git a/pkg/vm_service/CHANGELOG.md b/pkg/vm_service/CHANGELOG.md
index 466d85f..049e01d1 100644
--- a/pkg/vm_service/CHANGELOG.md
+++ b/pkg/vm_service/CHANGELOG.md
@@ -2,7 +2,7 @@
 
 ## 5.0.0
 
-- **breaking**: Update to version `4.0.0` of the spec.
+- **breaking**: Update to version `3.39.0` of the spec.
   - Removes `ClientName` and `WebSocketTarget` objects
   - Removes `getClientName`, `getWebSocketTarget`, `requirePermissionToResume`,
     and `setClientName` RPCs.
diff --git a/pkg/vm_service/java/version.properties b/pkg/vm_service/java/version.properties
index db1ef8e5..e076127 100644
--- a/pkg/vm_service/java/version.properties
+++ b/pkg/vm_service/java/version.properties
@@ -1 +1 @@
-version=4.0
+version=3.39
diff --git a/pkg/vm_service/lib/src/vm_service.dart b/pkg/vm_service/lib/src/vm_service.dart
index c518b25..4f63e01 100644
--- a/pkg/vm_service/lib/src/vm_service.dart
+++ b/pkg/vm_service/lib/src/vm_service.dart
@@ -28,7 +28,7 @@
         HeapSnapshotObjectNoData,
         HeapSnapshotObjectNullData;
 
-const String vmServiceVersion = '4.0.0';
+const String vmServiceVersion = '3.39.0';
 
 /// @optional
 const String optional = 'optional';
diff --git a/pkg/vm_service/pubspec.yaml b/pkg/vm_service/pubspec.yaml
index fff9595..66b2910 100644
--- a/pkg/vm_service/pubspec.yaml
+++ b/pkg/vm_service/pubspec.yaml
@@ -2,7 +2,7 @@
 description: >-
   A library to communicate with a service implementing the Dart VM
   service protocol.
-version: 5.0.0
+version: 5.0.0+1
 
 homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm_service
 
diff --git a/runtime/observatory/tests/service/get_version_rpc_test.dart b/runtime/observatory/tests/service/get_version_rpc_test.dart
index 7ee46a0..8e949ec 100644
--- a/runtime/observatory/tests/service/get_version_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_version_rpc_test.dart
@@ -11,8 +11,8 @@
   (VM vm) async {
     var result = await vm.invokeRpcNoUpgrade('getVersion', {});
     expect(result['type'], equals('Version'));
-    expect(result['major'], equals(4));
-    expect(result['minor'], equals(0));
+    expect(result['major'], equals(3));
+    expect(result['minor'], equals(39));
     expect(result['_privateMajor'], equals(0));
     expect(result['_privateMinor'], equals(0));
   },
diff --git a/runtime/vm/service.h b/runtime/vm/service.h
index b4f7acd..a3cf970 100644
--- a/runtime/vm/service.h
+++ b/runtime/vm/service.h
@@ -14,8 +14,8 @@
 
 namespace dart {
 
-#define SERVICE_PROTOCOL_MAJOR_VERSION 4
-#define SERVICE_PROTOCOL_MINOR_VERSION 0
+#define SERVICE_PROTOCOL_MAJOR_VERSION 3
+#define SERVICE_PROTOCOL_MINOR_VERSION 39
 
 class Array;
 class EmbedderServiceHandler;
diff --git a/runtime/vm/service/service.md b/runtime/vm/service/service.md
index 5eeb755..69dde47 100644
--- a/runtime/vm/service/service.md
+++ b/runtime/vm/service/service.md
@@ -1,8 +1,8 @@
-# Dart VM Service Protocol 4.0 
+# Dart VM Service Protocol 3.39
 
 > Please post feedback to the [observatory-discuss group][discuss-list]
 
-This document describes of _version 4.0_ of the Dart VM Service Protocol. This
+This document describes of _version 3.39_ of the Dart VM Service Protocol. This
 protocol is used to communicate with a running Dart Virtual Machine.
 
 To use the Service Protocol, start the VM with the *--observe* flag.
@@ -3834,6 +3834,6 @@
 3.36 | Added `getProcessMemoryUsage` RPC and `ProcessMemoryUsage` and `ProcessMemoryItem` objects.
 3.37 | Added `getWebSocketTarget` RPC and `WebSocketTarget` object.
 3.38 | Added `isSystemIsolate` property to `@Isolate` and `Isolate`, `isSystemIsolateGroup` property to `@IsolateGroup` and `IsolateGroup`, and properties `systemIsolates` and `systemIsolateGroups` to `VM`.
-4.0 | Removed the following deprecated RPCs and objects: `getClientName`, `getWebSocketTarget`, `setClientName`, `requireResumeApproval`, `ClientName`, and `WebSocketTarget`.
+3.39 | Removed the following deprecated RPCs and objects: `getClientName`, `getWebSocketTarget`, `setClientName`, `requireResumeApproval`, `ClientName`, and `WebSocketTarget`.
 
 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observatory-discuss