Home | History | Annotate | Download | only in include
      1 /*
      2  * Copyright (C) 2016 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 #ifndef ANDROID_IVEHICLE_MONITOR_H
     18 #define ANDROID_IVEHICLE_MONITOR_H
     19 
     20 #include <binder/Parcel.h>
     21 
     22 #include <IVehicleMonitorListener.h>
     23 
     24 namespace android {
     25 
     26 // ----------------------------------------------------------------------------
     27 
     28 /**
     29  * Application priorities used in vehicle monitoring.
     30  */
     31 enum vehicle_app_priority {
     32     VEHICLE_APP_PRIORITY_NONE = 0,
     33     VEHICLE_APP_PRIORITY_FOREGROUND = 1,
     34 };
     35 
     36 // ----------------------------------------------------------------------------
     37 
     38 class IVehicleMonitor : public IInterface {
     39 public:
     40     static const char SERVICE_NAME[];
     41     DECLARE_META_INTERFACE(VehicleMonitor);
     42 
     43     virtual status_t setAppPriority(
     44             uint32_t pid, uint32_t uid, vehicle_app_priority priority) = 0;
     45     virtual status_t setMonitorListener(
     46             const sp<IVehicleMonitorListener> &listener) = 0;
     47 };
     48 // ----------------------------------------------------------------------------
     49 
     50 class BnVehicleMonitor : public BnInterface<IVehicleMonitor> {
     51     virtual status_t  onTransact(uint32_t code,
     52                                  const Parcel& data,
     53                                  Parcel* reply,
     54                                  uint32_t flags = 0);
     55 };
     56 
     57 // ----------------------------------------------------------------------------
     58 }; // namespace android
     59 
     60 #endif /* ANDROID_IVEHICLE_MONITOR_H */
     61