1 /* 2 * Copyright (C) 2018 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 CHRE_PLATFORM_SLPI_SEE_SEE_CLIENT_H_ 18 #define CHRE_PLATFORM_SLPI_SEE_SEE_CLIENT_H_ 19 20 #include "chre/platform/slpi/see/see_helper.h" 21 #include "chre/util/singleton.h" 22 23 /** 24 * @file 25 * Exposes the SEE helper used by the platform sensor implementation, for use 26 * in other modules. 27 */ 28 29 namespace chre { 30 31 //! A singleton instance of SeeHelper that can be used for making sensor 32 //! requests. This must only be used from the CHRE thread. 33 typedef Singleton<SeeHelper> SeeHelperSingleton; 34 35 /** 36 * Convenience method for fetching the SEE helper singleton instance. Must only 37 * be used from the CHRE thread. 38 */ getSeeHelper()39inline SeeHelper *getSeeHelper() { 40 return SeeHelperSingleton::get(); 41 } 42 43 #ifdef CHRE_SLPI_UIMG_ENABLED 44 typedef Singleton<BigImageSeeHelper> BigImageSeeHelperSingleton; 45 getBigImageSeeHelper()46inline SeeHelper *getBigImageSeeHelper() { 47 return BigImageSeeHelperSingleton::get(); 48 } 49 #endif // CHRE_SLPI_UIMG_ENABLED 50 51 } // namespace chre 52 53 #endif // CHRE_PLATFORM_SLPI_SEE_SEE_CLIENT_H_ 54