1// Copyright 2016 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// Next MinVersion: 6
6
7module arc.mojom;
8
9import "mojo/public/mojom/base/time.mojom";
10
11[Extensible]
12//See depot/google3/wireless/android/enterprise/clouddps/proto/clouddps.proto
13enum InstallErrorReason {
14    // If the reason is unspecified, this error should be treated as a
15    // non-transient error.
16    REASON_UNSPECIFIED = 0,
17
18    // The server didn't get a response from Play in time. The install may
19    // still succeed or may fail with any error.
20    TIMEOUT = 1,
21
22    // A potentially transient error, for example, the device is not found (due
23    // to replication delay), or Play was unavailable. A retry in a short amount
24    // of time is likely to succeed.
25    TRANSIENT_ERROR = 2,
26
27    // The app was not found in Play.
28    NOT_FOUND = 3,
29
30    // The app is incompatible with the device.
31    NOT_COMPATIBLE_WITH_DEVICE = 4,
32
33    // The app has not been approved by the admin.
34    NOT_APPROVED = 5,
35
36    // The app has new permissions that have not been accepted by the admin.
37    PERMISSIONS_NOT_ACCEPTED = 6,
38
39    // The app is not available in the user's country.
40    NOT_AVAILABLE_IN_COUNTRY = 7,
41
42    // There are no more licenses to assign to the user.
43    NO_LICENSES_REMAINING = 8,
44
45    // The enterprise is no longer enrolled with Play for Work or CloudDPC is
46    // not enabled for the enterprise.
47    NOT_ENROLLED = 9,
48
49    // The user is no longer valid. The user may have been deleted or disabled.
50    USER_INVALID = 10,
51};
52
53// Should be kept in sync with device_management_backend.proto/
54// RemoteCommandResult/ResultType.
55[Extensible]
56enum CommandResultType {
57  IGNORED = 0,  // The command was ignored as obsolete.
58  FAILURE = 1,  // The command could not be executed.
59  SUCCESS = 2,  // The command was successfully executed.
60};
61
62// Next Method ID: 7
63interface PolicyHost {
64  // Get policies from Chrome OS, as JSON-encoded dictionary with the policies'
65  // names as keys and their values as values. The list of possible policies can
66  // be found in components/policy/resources/policy_templates.json
67  GetPolicies@0() => (string policies);
68
69  // Pass a JSON with policy compliance details that reference fields in
70  // CloudDps NonComplianceReason. Should return ChromeOS response to the report
71  // in JSON format as in CloudDps PolicyComplianceReportResponse.
72  // ChromeOS always returns that it's compliant with the report.
73  [MinVersion=1] ReportCompliance@1(string request) => (string response);
74
75  // Reports that request was sent to CloudDPS for set of packages.
76  [MinVersion=3] ReportCloudDpsRequested@2(mojo_base.mojom.Time time,
77                                         array<string> package_names);
78  // Reports that successful response was received from CloudDPS for set of
79  // packages.
80  [MinVersion=3] ReportCloudDpsSucceeded@3(mojo_base.mojom.Time time,
81                                         array<string> package_names);
82  // Reports that CloudDPS reports an error for packages.
83  [MinVersion=3] ReportCloudDpsFailed@4(mojo_base.mojom.Time time,
84                                      string package_name,
85                                      InstallErrorReason reason);
86
87  // Reports that packages were scheduled for force installing
88  // via Play Store directly.
89  [MinVersion=5] ReportDirectInstall@5(mojo_base.mojom.Time time,
90                                     array<string> package_names);
91
92  // Reports that CloudDPC is giving up after several retries to
93  // force install the packages.
94  [MinVersion=5] ReportForceInstallMainLoopFailed@6(mojo_base.mojom.Time time,
95                                          array<string> package_names);
96};
97
98// Next Method ID: 4
99interface PolicyInstance {
100  // DEPRECATED: Please use Init@2 instead.
101  InitDeprecated@0(pending_remote<PolicyHost> host_remote);
102
103  // Establishes full-duplex communication with the host.
104  [MinVersion=2] Init@2(pending_remote<PolicyHost> host_remote) => ();
105
106  // Indicates some policies have changed
107  OnPolicyUpdated@1();
108
109  // Forwards a command received from the management server. The payload is
110  // opaque to Chrome (it contains JSON from the RemoteCommand.payload field for
111  // the USER_ARC_COMMAND RemoteCommand - cf. device_management_backend.proto).
112  [MinVersion=4] OnCommandReceived@3(string command)
113      => (CommandResultType result);
114};
115