diff --git a/automotive/remoteaccess/Android.bp b/automotive/remoteaccess/Android.bp index 7cd6f60fe9..e1e90414c6 100644 --- a/automotive/remoteaccess/Android.bp +++ b/automotive/remoteaccess/Android.bp @@ -42,6 +42,5 @@ aidl_interface { imports: [], }, ], - frozen: true, - + frozen: false, } diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl index b0935c2fb2..ccfa22de4e 100644 --- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -40,4 +40,10 @@ interface IRemoteAccess { void setRemoteTaskCallback(android.hardware.automotive.remoteaccess.IRemoteTaskCallback callback); void clearRemoteTaskCallback(); void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state); + boolean isTaskScheduleSupported(); + void scheduleTask(in android.hardware.automotive.remoteaccess.ScheduleInfo scheduleInfo); + void unscheduleTask(String clientId, String scheduleId); + void unscheduleAllTasks(String clientId); + boolean isTaskScheduled(String clientId, String scheduleId); + List getAllScheduledTasks(String clientId); } diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl new file mode 100644 index 0000000000..a929e10827 --- /dev/null +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 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. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.remoteaccess; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ScheduleInfo { + String clientId; + String scheduleId; + byte[] taskData; + int count; + long startTimeInEpochSeconds; + long periodicInSeconds; +} diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl index 0f4125f475..4912651294 100644 --- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl +++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -18,6 +18,7 @@ package android.hardware.automotive.remoteaccess; import android.hardware.automotive.remoteaccess.ApState; import android.hardware.automotive.remoteaccess.IRemoteTaskCallback; +import android.hardware.automotive.remoteaccess.ScheduleInfo; /** * Interface representing a remote wakeup client. @@ -96,4 +97,69 @@ interface IRemoteAccess { *

If {@code isWakeupRequired} is false, it must not try to wake up AP. */ void notifyApStateChange(in ApState state); + + /** + * Returns whether task scheduling is supported. + * + *

If this returns {@code true}, user may use {@link scheduleTask} to schedule a task to be + * executed at a later time. If the device is off when the task is scheduled to be executed, + * the device will be woken up to execute the task. + * + * @return {@code true} if serverless remote task scheduling is supported. + */ + boolean isTaskScheduleSupported(); + + /** + * Schedules a task to be executed later even when the vehicle is off. + * + *

If {@link isTaskScheduleSupported} returns {@code false}. This is no-op. + * + *

This sends a scheduled task message to a device external to Android so that the device + * can wake up Android and deliver the task through {@link IRemoteTaskCallback}. + * + *

Note that the scheduled task execution is on a best-effort basis. Multiple situations + * might cause the task not to execute successfully: + * + *