1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.car.remoteaccess;
18 
19 import android.car.remoteaccess.RemoteTaskClientRegistrationInfo;
20 
21 /** @hide */
22 oneway interface ICarRemoteAccessCallback {
23     /**
24      * Called when the remote task client is successfully registered or the client ID is
25      * updated by CarRemoteAccessService.
26      *
27      * @param info {@code RemoteTaskClientRegistrationInfo} instance which contains service ID,
28      *             vehicle ID, processor ID and client ID.
29      */
onClientRegistrationUpdated(in RemoteTaskClientRegistrationInfo info)30      void onClientRegistrationUpdated(in RemoteTaskClientRegistrationInfo info);
31 
32      /**
33       * Called when a serverless remote task client is registered.
34       *
35       * @param clientId The pre-configured client ID for the serverless remote task client.
36       */
onServerlessClientRegistered(in String clientId)37     void onServerlessClientRegistered(in String clientId);
38 
39     /**
40      * Called when registering the remote task client fails.
41      */
onClientRegistrationFailed()42     void onClientRegistrationFailed();
43 
44     /**
45      * Called when a remote task request is received from the wake-up service.
46      *
47      * @param clientID Client ID that is asked to execute the remote task.
48      * @param taskId ID of the task that is requested by the remote task server.
49      * @param data Extra data passed along with the wake-up request. Can be {@code null}.
50      * @param taskMaxDurationInSec The timeout before the system goes back to the previous power
51      *                             state.
52      */
onRemoteTaskRequested(in String clientId, in String taskId, in byte[] data, int taskMaxDurationInSec)53     void onRemoteTaskRequested(in String clientId, in String taskId, in byte[] data,
54             int taskMaxDurationInSec);
55 
56     /**
57      * Called when the device is about to shutdown.
58      */
onShutdownStarting()59     void onShutdownStarting();
60 }
61