Home | History | Annotate | Download | only in nanoapp
      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 #include "chre/platform/shared/nanoapp_support_lib_dso.h"
     18 
     19 #include <chre.h>
     20 
     21 #include "chre/util/macros.h"
     22 
     23 /**
     24  * @file
     25  * The Nanoapp Support Library (NSL) that gets built with nanoapps to act as an
     26  * intermediary to the reference CHRE implementation. It provides hooks so the
     27  * app can be registered with the system, and also provides a layer where we can
     28  * implement cross-version compatibility features as needed.
     29  */
     30 
     31 #ifdef CHRE_SLPI_UIMG_ENABLED
     32 static const int kIsTcmNanoapp = 1;
     33 #else
     34 static const int kIsTcmNanoapp = 0;
     35 #endif  // CHRE_SLPI_UIMG_ENABLED
     36 
     37 DLL_EXPORT const struct chreNslNanoappInfo _chreNslDsoNanoappInfo = {
     38   .magic = CHRE_NSL_NANOAPP_INFO_MAGIC,
     39   .structMinorVersion = CHRE_NSL_NANOAPP_INFO_STRUCT_MINOR_VERSION,
     40   .targetApiVersion = CHRE_API_VERSION,
     41 
     42   // These values are supplied by the build environment
     43   .vendor = NANOAPP_VENDOR_STRING,
     44   .name = NANOAPP_NAME_STRING,
     45   .isSystemNanoapp = NANOAPP_IS_SYSTEM_NANOAPP,
     46   .isTcmNanoapp = kIsTcmNanoapp,
     47   .appId = NANOAPP_ID,
     48   .appVersion = NANOAPP_VERSION,
     49 
     50   .entryPoints = {
     51     .start = nanoappStart,
     52     .handleEvent = nanoappHandleEvent,
     53     .end = nanoappEnd,
     54   },
     55 };
     56 
     57