Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8459a068 authored by Yu Shan's avatar Yu Shan
Browse files

Add TaskType to ScheduleInfo.

Add a task type field to schedule serverless remote task. We want
to introduce an ENTER_GARAGE_MODE type where the external system
can set the AP_POWER_BOOT_UP_REASON and makes android enter
garage mode.

Test: atest RemoteAccessServiceUnitTest
Bug: 316233421
Change-Id: Iddbd2a14aa6f4672a2e27f0a05ec2b73b7d1aab2
parent efa6db77
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ interface IRemoteAccess {
  void clearRemoteTaskCallback();
  void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state);
  boolean isTaskScheduleSupported();
  android.hardware.automotive.remoteaccess.TaskType[] getSupportedTaskTypesForScheduling();
  void scheduleTask(in android.hardware.automotive.remoteaccess.ScheduleInfo scheduleInfo);
  void unscheduleTask(String clientId, String scheduleId);
  void unscheduleAllTasks(String clientId);
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ package android.hardware.automotive.remoteaccess;
parcelable ScheduleInfo {
  String clientId;
  String scheduleId;
  android.hardware.automotive.remoteaccess.TaskType taskType;
  byte[] taskData;
  int count;
  long startTimeInEpochSeconds;
+39 −0
Original line number Diff line number Diff line
/*
 * 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 <name>-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;
@Backing(type="int") @VintfStability
enum TaskType {
  CUSTOM = 0,
  ENTER_GARAGE_MODE = 1,
}
+43 −3
Original line number Diff line number Diff line
@@ -19,12 +19,39 @@ package android.hardware.automotive.remoteaccess;
import android.hardware.automotive.remoteaccess.ApState;
import android.hardware.automotive.remoteaccess.IRemoteTaskCallback;
import android.hardware.automotive.remoteaccess.ScheduleInfo;
import android.hardware.automotive.remoteaccess.TaskType;

/**
 * Interface representing a remote wakeup client.
 *
 * A wakeup client is a binary outside Android framework that communicates with
 * a wakeup server and receives wake up command.
 * The remote access HAL.
 *
 * <p>This HAL represents an external system that is always on even when Android
 * is powered off. It is capable of wakeing up and notifying Android when a
 * remote task arrives.
 *
 * <p>For cloud-based remote access, a cloud server will issue the remote task
 * to the external system, which will then be forwarded to Android. The client
 * is expected to call {@code setRemoteTaskCallback} to register the remote
 * task callback and uses the information returned from {@code getVehicleId},
 * {@code getWakeupServiceName} and {@code getProcessorId} to register with
 * a remote server.
 *
 * <p>For serverless remote access, the remote task comes from the external
 * system alone and no server is involved. The external system may support
 * scheduling a remote task to executed later through {@code scheduleTask}.
 *
 * <p>For both cloud-based and serverless remote access, the ideal use case
 * is to wake up Android when the vehicle is not in use and then shutdown
 * Android after the task is complete. However, user may access the vehicle
 * during this period, and Android must not be shutdown if this happens.
 *
 * <p>If this interface is implemented, then VHAL property
 * {@code VEHICLE_IN_USE} must be supported to represent whether the vehicle is
 * currently in use. Android will check this before sending the shutdown
 * request.
 *
 * <p>The external power controller system must also check whether vehicle is
 * in use upon receiving the shutdown request and makes sure that an
 * user-unexpected shutdown must not happen.
 */
@VintfStability
interface IRemoteAccess {
@@ -109,6 +136,17 @@ interface IRemoteAccess {
     */
    boolean isTaskScheduleSupported();

    /**
     * Returns the supported task types for scheduling.
     *
     * <p>If task scheduling is not supported, this returns an empty array.
     *
     * <p>Otherwise, at least {@code TaskType.CUSTOM} must be supported.
     *
     * @return An array of supported task types.
     */
    TaskType[] getSupportedTaskTypesForScheduling();

    /**
     * Schedules a task to be executed later even when the vehicle is off.
     *
@@ -127,6 +165,8 @@ interface IRemoteAccess {
     *
     * <p>Must return {@code EX_ILLEGAL_ARGUMENT} if a pending schedule with the same
     * {@code scheduleId} for this client exists.
     *
     * <p>Must return {@code EX_ILLEGAL_ARGUMENT} if the task type is not supported.
     */
    void scheduleTask(in ScheduleInfo scheduleInfo);

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ package android.hardware.automotive.remoteaccess;
@VintfStability
interface IRemoteTaskCallback {
    /**
     * A callback that is called when a remote task is requested.
     * A callback that is called when a custom type remote task is requested.
     *
     * The data is passed down from the remote server to the remote task client
     * which is an Android application, and is not interpreted/parsed by the
Loading