├── Android.mk ├── AndroidProducts.mk ├── BoardConfig.mk ├── CleanSpec.mk ├── README.md ├── aosp_condor.mk ├── bluetooth └── bdroid_buildcfg.h ├── charge_only_mode ├── Android.mk ├── NOTICE ├── alarm.c ├── alarm.h ├── assets │ ├── 24to16.py │ ├── battery_charge_background.gif │ ├── battery_charge_background.h │ ├── battery_charge_background.png │ ├── battery_green_ani.gif │ ├── battery_green_ani.h │ ├── battery_green_img.h │ ├── battery_green_img.png │ ├── battery_numbers │ │ ├── 0.png │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── 7.png │ │ ├── 8.png │ │ ├── 9.png │ │ └── percentage.png │ ├── battery_numbers_0.h │ ├── battery_numbers_1.h │ ├── battery_numbers_2.h │ ├── battery_numbers_3.h │ ├── battery_numbers_4.h │ ├── battery_numbers_5.h │ ├── battery_numbers_6.h │ ├── battery_numbers_7.h │ ├── battery_numbers_8.h │ ├── battery_numbers_9.h │ ├── battery_numbers_percentage.h │ ├── battery_orange_ani.gif │ ├── battery_orange_ani.h │ ├── battery_orange_img.h │ ├── battery_orange_img.png │ ├── battery_red_ani.gif │ ├── battery_red_ani.h │ ├── battery_red_img.h │ ├── battery_red_img.png │ ├── bin2c.py │ ├── ecomoto_icon.png │ ├── extract │ ├── ic_pane_battery_charge.h │ ├── ic_pane_battery_charge.png │ ├── ic_pane_battery_complete.h │ ├── ic_pane_battery_complete.png │ ├── ic_pane_battery_error.h │ ├── ic_pane_battery_error.png │ ├── instruction.png │ └── screen_size.h ├── draw.c ├── draw.h ├── events.c ├── events.h ├── hardware.c ├── hardware.h ├── main.c ├── screen.c ├── screen.h └── screen_tegra.c ├── device.mk ├── egl.cfg ├── extract-files.sh ├── gps ├── Android.mk ├── core │ ├── Android.mk │ ├── ContextBase.cpp │ ├── ContextBase.h │ ├── LBSProxyBase.h │ ├── LocAdapterBase.cpp │ ├── LocAdapterBase.h │ ├── LocApiBase.cpp │ ├── LocApiBase.h │ ├── LocDualContext.cpp │ ├── LocDualContext.h │ ├── MsgTask.cpp │ ├── MsgTask.h │ ├── UlpProxyBase.h │ ├── gps_extended.h │ ├── gps_extended_c.h │ ├── loc_core_log.cpp │ └── loc_core_log.h ├── loc_api │ ├── Android.mk │ └── libloc_api_50001 │ │ ├── Android.mk │ │ ├── LocEngAdapter.cpp │ │ ├── LocEngAdapter.h │ │ ├── Makefile.am │ │ ├── gps.c │ │ ├── loc.cpp │ │ ├── loc.h │ │ ├── loc_eng.cpp │ │ ├── loc_eng.h │ │ ├── loc_eng_agps.cpp │ │ ├── loc_eng_agps.h │ │ ├── loc_eng_dmn_conn.cpp │ │ ├── loc_eng_dmn_conn.h │ │ ├── loc_eng_dmn_conn_glue_msg.c │ │ ├── loc_eng_dmn_conn_glue_msg.h │ │ ├── loc_eng_dmn_conn_glue_pipe.c │ │ ├── loc_eng_dmn_conn_glue_pipe.h │ │ ├── loc_eng_dmn_conn_handler.cpp │ │ ├── loc_eng_dmn_conn_handler.h │ │ ├── loc_eng_dmn_conn_thread_helper.c │ │ ├── loc_eng_dmn_conn_thread_helper.h │ │ ├── loc_eng_log.cpp │ │ ├── loc_eng_log.h │ │ ├── loc_eng_msg.h │ │ ├── loc_eng_ni.cpp │ │ ├── loc_eng_ni.h │ │ ├── loc_eng_nmea.cpp │ │ ├── loc_eng_nmea.h │ │ ├── loc_eng_xtra.cpp │ │ └── loc_eng_xtra.h ├── platform_lib_abstractions │ ├── elapsed_millis_since_boot.cpp │ ├── platform_lib_includes.h │ ├── platform_lib_macros.h │ └── platform_lib_time.h └── utils │ ├── Android.mk │ ├── Makefile.am │ ├── linked_list.c │ ├── linked_list.h │ ├── loc_cfg.cpp │ ├── loc_cfg.h │ ├── loc_log.cpp │ ├── loc_log.h │ ├── loc_target.cpp │ ├── loc_target.h │ ├── loc_timer.c │ ├── loc_timer.h │ ├── log_util.h │ ├── msg_q.c │ └── msg_q.h ├── include └── private │ └── android_filesystem_config.h ├── init ├── Android.mk ├── init_condor.c └── init_msm.h ├── liblight ├── Android.mk ├── NOTICE └── lights.c ├── mkbootimg.mk ├── overlay ├── frameworks │ └── base │ │ ├── core │ │ └── res │ │ │ └── res │ │ │ ├── values │ │ │ └── config.xml │ │ │ └── xml │ │ │ ├── power_profile.xml │ │ │ └── storage_list.xml │ │ └── packages │ │ ├── SettingsProvider │ │ └── res │ │ │ └── values │ │ │ └── defaults.xml │ │ └── SystemUI │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ ├── apps │ ├── Bluetooth │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ ├── Phone │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ └── Settings │ │ └── res │ │ └── values │ │ └── config.xml │ └── services │ ├── Telecomm │ └── res │ │ └── values │ │ └── config.xml │ └── Telephony │ └── res │ ├── values-mcc310-mnc120 │ └── config.xml │ └── values │ └── config.xml ├── prebuilt └── system │ └── etc │ ├── audio_policy.conf │ ├── hostapd │ ├── hostapd.accept │ ├── hostapd.deny │ └── hostapd_default.conf │ ├── hsic.control.bt.sh │ ├── init.ath3k.bt.sh │ ├── init.crda.sh │ ├── init.qcom.audio.sh │ ├── init.qcom.bt.sh │ ├── init.qcom.fm.sh │ ├── media_codecs.xml │ ├── media_profiles.xml │ ├── mixer_paths.xml │ └── wifi │ ├── p2p_supplicant_overlay.conf │ └── wpa_supplicant_overlay.conf ├── proprietary-blobs.txt ├── ramdisk ├── fstab.qcom ├── init.mmi.boot.sh ├── init.mmi.touch.sh ├── init.mmi.usb.rc ├── init.qcom.rc ├── init.qcom.ssr.sh ├── init.qcom.usb.rc └── ueventd.qcom.rc ├── sec_config ├── sepolicy ├── atvc.te ├── batt_health.te ├── device.te ├── file.te ├── file_contexts ├── hw_revs.te ├── init.te ├── init_shell.te ├── keystore.te ├── mediaserver.te ├── mm-qcamerad.te ├── mpdecision.te ├── platform_app.te ├── property.te ├── property_contexts ├── rild.te ├── rmt_storage.te ├── system_app.te ├── system_init.te ├── system_server.te ├── thermal-engine.te ├── ueventd.te └── vold.te ├── setup-makefiles.sh ├── system.prop ├── thermal-engine-8610.conf ├── touch_dev.idc └── vendorsetup.sh /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014 Prashant Gahlot (proxthehacker@gmail.com) 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 | PRODUCT_MAKEFILES := \ 18 | $(LOCAL_DIR)/aosp_condor.mk 19 | -------------------------------------------------------------------------------- /CleanSpec.mk: -------------------------------------------------------------------------------- 1 | # Copyright Copyright (C) Prashant Gahlot (proxthehacker@gmail.com) 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # If you don't need to do a full clean build but would like to touch 17 | # a file or delete some intermediate files, add a clean step to the end 18 | # of the list. These steps will only be run once, if they haven't been 19 | # run before. 20 | # 21 | # E.g.: 22 | # $(call add-clean-step, touch -c external/sqlite/sqlite3.h) 23 | # $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) 24 | # 25 | # Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with 26 | # files that are missing or have been moved. 27 | # 28 | # Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. 29 | # Use $(OUT_DIR) to refer to the "out" directory. 30 | # 31 | # If you need to re-do something that's already mentioned, just copy 32 | # the command and add it to the bottom of the list. E.g., if a change 33 | # that you made last week required touching a file and a change you 34 | # made today requires touching the same file, just copy the old 35 | # touch step and add it to the end of the list. 36 | # 37 | # ************************************************ 38 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 39 | # ************************************************ 40 | 41 | # For example: 42 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) 43 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) 44 | #$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) 45 | #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) 46 | 47 | $(call add-clean-step, find $(PRODUCT_OUT) -name "*audio.primary.msm8610*" -print0 | xargs -0 rm -rf) 48 | $(call add-clean-step, rm -f $(OUT_DIR)/target/product/condor/system/lib/modules/adsp*.ko) 49 | $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop) 50 | 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Unified Device Tree For Motorola E 2 | ================================== 3 | 4 | The Motorola (codenamed _"Condor"_) is a low-range smartphone from Motorola mobility. 5 | It was announced on May 2014. 6 | 7 | Basic | Spec Sheet 8 | -------:|:------------------------- 9 | CPU | Dual-core 1.2 GHz Cortex-A7 10 | CHIPSET | Qualcomm Snapdragon 200 11 | GPU | Adreno 302 12 | Memory | 1GB RAM 13 | Shipped Android Version | 4.4.2 14 | Storage | 4GB 15 | MicroSD | Upto 32 GB 16 | Battery | 1980 mAh 17 | Display | 4.91 x 2.55 x 0.48 in 18 | Camera | 5 MP, 2592 х 1944 pixels 19 | 20 | ![Motorola E](https://camo.githubusercontent.com/65db99a8598e2e96a3b1e88f76020559ac23618c/687474703a2f2f63646e322e67736d6172656e612e636f6d2f76762f6269677069632f6d6f746f726f6c612d6d6f746f2d652e6a7067 "Motorola E") -------------------------------------------------------------------------------- /aosp_condor.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014 Prashant Gahlot (proxthehacker@gmail.com) 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 | # Sample: This is where we'd set a backup provider if we had one 18 | # $(call inherit-product, device/sample/products/backup_overlay.mk) 19 | 20 | # Inherit from those products. Most specific first. 21 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 22 | 23 | # Inherit from condor device 24 | $(call inherit-product, device/motorola/condor/device.mk) 25 | 26 | PRODUCT_NAME := aosp_condor 27 | PRODUCT_DEVICE := condor 28 | PRODUCT_BRAND := motorola 29 | PRODUCT_MODEL := condor 30 | PRODUCT_MANUFACTURER := motorola 31 | 32 | $(call inherit-product-if-exists, vendor/motorola/condor/condor-vendor.mk) 33 | -------------------------------------------------------------------------------- /bluetooth/bdroid_buildcfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 The CyanogenMod 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 _BDROID_BUILDCFG_H 18 | #define _BDROID_BUILDCFG_H 19 | 20 | #define BTM_DEF_LOCAL_NAME "Motorola Moto E" 21 | #define BTA_DISABLE_DELAY 1000 /* in milliseconds */ 22 | #define BLUETOOTH_QCOM_SW TRUE 23 | #define BLUETOOTH_QCOM_LE_INTL_SCAN TRUE 24 | #define BTC_INCLUDED TRUE 25 | #endif 26 | -------------------------------------------------------------------------------- /charge_only_mode/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2005 The Android Open Source Project 2 | 3 | LOCAL_PATH:= $(call my-dir) 4 | include $(CLEAR_VARS) 5 | 6 | LOCAL_SRC_FILES:= \ 7 | alarm.c \ 8 | events.c \ 9 | hardware.c \ 10 | main.c 11 | 12 | LOCAL_SRC_FILES += \ 13 | draw.c \ 14 | screen.c 15 | 16 | LOCAL_FORCE_STATIC_EXECUTABLE := true 17 | 18 | LOCAL_STATIC_LIBRARIES := libunz libcutils libc liblog 19 | 20 | LOCAL_C_INCLUDES := external/zlib 21 | 22 | LOCAL_CFLAGS := -I$(LOCAL_PATH)/assets 23 | 24 | LOCAL_MODULE_TAGS:= optional 25 | LOCAL_MODULE:= charge_only_mode 26 | 27 | include $(BUILD_EXECUTABLE) 28 | -------------------------------------------------------------------------------- /charge_only_mode/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2009, Motorola, Inc. 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | - Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | - Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | - Neither the name of the Motorola, Inc. nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /charge_only_mode/alarm.c: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | Copyright (c) 2008-2009, Motorola, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted 6 | provided that the following conditions are met: 7 | - Redistributions of source code must retain the above copyright notice, this list of conditions 8 | and the following disclaimer. 9 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10 | and the following disclaimer in the documentation and/or other materials provided with the 11 | distribution. 12 | - Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or 13 | promote products derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 21 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 22 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | **************************************************************************************************/ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "alarm.h" 30 | #define LOG_TAG "CHARGE_ONLY_MODE" 31 | #include 32 | 33 | struct alarm_node 34 | { 35 | struct alarm_node *next; 36 | struct timeval alarm_time; 37 | void (*f)(void *); 38 | void *cookie; 39 | }; 40 | 41 | static struct alarm_node *alarms = NULL; 42 | 43 | void alarm_process(void) 44 | { 45 | struct alarm_node *a; 46 | struct timeval now; 47 | gettimeofday(&now, NULL); 48 | 49 | while ((a = alarms) != NULL) { 50 | if (now.tv_sec < a->alarm_time.tv_sec) 51 | break; 52 | if ( (now.tv_sec == a->alarm_time.tv_sec) && 53 | (now.tv_usec < a->alarm_time.tv_usec)) 54 | break; 55 | alarms = a->next; 56 | 57 | (a->f)(a->cookie); 58 | free(a); 59 | } 60 | } 61 | 62 | int alarm_get_time_until_next(void) 63 | { 64 | struct timeval now; 65 | int delta; 66 | if (!alarms) 67 | return 0x7fffffff; 68 | gettimeofday(&now, NULL); 69 | delta = (alarms->alarm_time.tv_sec - now.tv_sec) * 1000 + 70 | (alarms->alarm_time.tv_usec - now.tv_usec) / 1000; 71 | ALOGD("alarm_get_time_until_next, delta = %d\n", delta); 72 | return delta; 73 | } 74 | 75 | int alarm_set_relative(void (*f)(void *), void *cookie, int ms) 76 | { 77 | struct alarm_node *p, *c, *a = malloc(sizeof(*a)); 78 | if (!a) 79 | return -1; 80 | a->next = NULL; 81 | gettimeofday(&a->alarm_time, NULL); 82 | a->alarm_time.tv_usec += ms * 1000; 83 | if (a->alarm_time.tv_usec >= 1000000) { 84 | a->alarm_time.tv_sec += (a->alarm_time.tv_usec / 1000000); 85 | a->alarm_time.tv_usec %= 1000000; 86 | } 87 | a->f = f; 88 | a->cookie = cookie; 89 | 90 | p = NULL; 91 | c = alarms; 92 | while (c) { 93 | if (c->alarm_time.tv_sec > a->alarm_time.tv_sec) 94 | break; 95 | if ( (c->alarm_time.tv_sec == a->alarm_time.tv_sec) && 96 | (c->alarm_time.tv_usec > a->alarm_time.tv_usec)) 97 | break; 98 | 99 | p = c; 100 | c = c->next; 101 | } 102 | 103 | if (!p) { 104 | a->next = alarms; 105 | alarms = a; 106 | } else { 107 | a->next = p->next; 108 | p->next = a; 109 | } 110 | return 0; 111 | } 112 | 113 | int alarm_cancel(void (*f)(void *)) 114 | { 115 | struct alarm_node *p, *c; 116 | int cancelled = 0; 117 | p = NULL; 118 | c = alarms; 119 | while (c) { 120 | if (c->f == f) { 121 | struct alarm_node *a = c; 122 | if (p) 123 | p->next = c->next; 124 | else 125 | alarms = c->next; 126 | c = c->next; 127 | free(a); 128 | cancelled++; 129 | continue; 130 | } 131 | p = c; 132 | c = c->next; 133 | } 134 | return cancelled; 135 | } 136 | -------------------------------------------------------------------------------- /charge_only_mode/alarm.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | Copyright (c) 2008-2009, Motorola, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted 6 | provided that the following conditions are met: 7 | - Redistributions of source code must retain the above copyright notice, this list of conditions 8 | and the following disclaimer. 9 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10 | and the following disclaimer in the documentation and/or other materials provided with the 11 | distribution. 12 | - Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or 13 | promote products derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 21 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 22 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | **************************************************************************************************/ 24 | 25 | #ifndef _X_ALARM_H 26 | #define _X_ALARM_H 27 | 28 | void alarm_process(); 29 | int alarm_get_time_until_next(); 30 | int alarm_set_relative(void (*f)(void *), void *cookie, int ms); 31 | int alarm_cancel(void (*f)(void *)); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /charge_only_mode/assets/24to16.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | b = '' 4 | while True: 5 | c = sys.stdin.read() 6 | if len(c) == 0: break 7 | b += c 8 | 9 | if len(b) % 3 != 0: 10 | print 'incomplete data' 11 | sys.exit(1) 12 | 13 | while len(b) > 0: 14 | red,green,blue = [ ord(_) for _ in b[:3] ] 15 | c = ((red >> 3) << 11) | ((green >> 2) << 5) | (blue >> 3) 16 | sys.stdout.write(chr(c & 0xff)) 17 | sys.stdout.write(chr((c >> 8) & 0xff)) 18 | b = b[3:] 19 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_charge_background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_charge_background.gif -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_charge_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_charge_background.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_green_ani.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_green_ani.gif -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_green_img.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_green_img_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x7a,0x33,0xde,0x51,0x02,0x03,0x2d,0xca,0x31,0x0a,0x83,0x30, 3 | 0x00,0x85,0x61,0x90,0x98,0x4c,0x8e,0x3a,0x16,0x2c,0xe2,0xa8,0x63,0xc6,0x12,0x2c, 4 | 0xde,0x43,0xc4,0x9e,0x43,0x11,0xef,0x21,0x88,0xf7,0x10,0xa9,0xf7,0x08,0x41,0xec, 5 | 0x35,0xfa,0xf2,0x5a,0xbe,0xe9,0xe7,0x3d,0xab,0x2c,0x6c,0x34,0x43,0xaf,0x06,0x68, 6 | 0xc8,0x50,0x0a,0x77,0x15,0x90,0x93,0xde,0x4e,0x0b,0x8c,0xd4,0x52,0x05,0x4f,0x99, 7 | 0x91,0xa0,0x33,0xf4,0x0e,0x58,0x69,0xa2,0x0e,0x5e,0x61,0x4d,0x39,0x49,0xba,0xc4, 8 | 0x47,0x5c,0x42,0xfe,0xeb,0xb7,0xe0,0x13,0xd5,0x51,0x47,0x13,0xac,0x5e,0x7c,0xc0, 9 | 0x3b,0x3e,0x49,0x24,0x22,0xc9,0x6e,0x5e,0x45,0x2d,0x8c,0xb9,0xb7,0xc0,0x4e,0xae, 10 | 0x70,0x45,0x50,0x7a,0x29,0x98,0xd2,0x68,0xa3,0x1b,0x18,0xa0,0xd7,0xb3,0x9e,0x1f, 11 | 0x1b,0x59,0xf8,0x02,0xe6,0x57,0x39,0x93,0x10,0x01,0x00,0x00, 12 | }; 13 | 14 | struct asset battery_green_img = { 15 | 136, 1, battery_green_img_bits, sizeof(battery_green_img_bits) - 1, NULL }; 16 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_green_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_green_img.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/0.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/1.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/2.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/3.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/4.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/5.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/6.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/7.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/8.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/9.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers/percentage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_numbers/percentage.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_0.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_0_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6c,0x8d,0x72,0x4a,0x02,0x03,0xa5,0x53,0x6d,0x11,0xc3,0x20, 3 | 0x0c,0xc5,0x01,0x12,0x90,0x80,0x04,0x24,0x54,0x42,0x25,0x44,0x02,0x12,0x90,0x80, 4 | 0x84,0x49,0xa8,0x04,0x24,0x20,0x01,0x09,0x0c,0xba,0x00,0x49,0x7a,0xbd,0x75,0xb7, 5 | 0xfc,0x22,0x79,0x47,0x5e,0x3e,0x5e,0x94,0xfa,0x6e,0xda,0x35,0xbb,0x86,0x4d,0xc8, 6 | 0xf5,0xb4,0x04,0x9a,0x01,0x50,0xea,0xb4,0x4c,0x3f,0xc6,0xca,0x6c,0x9f,0x80,0xaf, 7 | 0xc2,0x36,0x04,0x9c,0x04,0x6a,0x41,0xae,0x63,0x06,0x26,0x5b,0x38,0x01,0x3b,0xe2, 8 | 0x8d,0xd9,0x0d,0xec,0xfc,0x14,0xd0,0x71,0x34,0x33,0x74,0x07,0x1b,0x39,0x58,0xea, 9 | 0xee,0x19,0x5e,0x2a,0xa0,0xdb,0x9e,0x1b,0x3e,0x8d,0x62,0xac,0x6e,0x35,0x33,0x9a, 10 | 0x5b,0x44,0x58,0x40,0x1a,0x48,0xfa,0xf8,0x9e,0x51,0x8a,0x12,0x9e,0x23,0x41,0x22, 11 | 0x5e,0x8c,0xf7,0x3f,0xe4,0x9e,0xe7,0xa7,0xaa,0x6f,0x66,0x10,0x6f,0xe7,0xe6,0xd7, 12 | 0xae,0x2c,0x9f,0x75,0x13,0x89,0xe6,0xfb,0xd9,0xc9,0x52,0x30,0xf1,0x8b,0x15,0x90, 13 | 0xe9,0x16,0x2d,0xd5,0x41,0x54,0x64,0xdd,0x4c,0x3b,0x96,0x6b,0x37,0xe7,0xf1,0xc2, 14 | 0xee,0x4c,0xb9,0x88,0x74,0x88,0x7e,0x97,0x40,0x98,0x92,0x17,0x50,0x24,0x67,0xb2, 15 | 0x91,0x84,0x05,0xf8,0x29,0x02,0xb6,0x95,0xbd,0xb9,0x5e,0x64,0xbf,0x53,0xfd,0xe0, 16 | 0xa0,0xd5,0x1b,0xcb,0xf2,0x3d,0x1f,0xf6,0x03,0x00,0x00, 17 | }; 18 | 19 | struct asset battery_numbers_0_a = { 20 | 26, 39, battery_numbers_0_a_bits, sizeof(battery_numbers_0_a_bits) - 1, NULL }; 21 | static const unsigned char battery_numbers_0_i_bits[] = { 22 | 0x1f,0x8b,0x08,0x00,0x6c,0x8d,0x72,0x4a,0x02,0x03,0xed,0x93,0x3b,0x0e,0x00,0x20, 23 | 0x08,0x43,0x39,0x7a,0x8f,0x6e,0x4c,0x1c,0xf8,0xa4,0x85,0xe8,0x6a,0xb7,0xf2,0x0c, 24 | 0x03,0xb6,0x66,0xbd,0xb0,0x45,0xc6,0x47,0x14,0x04,0x04,0x10,0x04,0x10,0x04,0x30, 25 | 0x44,0x89,0xb7,0x11,0xf5,0x26,0xae,0xce,0xaf,0x26,0x04,0x79,0x99,0xf7,0x9f,0xbc, 26 | 0x11,0x7e,0xeb,0x4a,0xf8,0x9f,0x0e,0x72,0x50,0xb3,0x73,0x93,0x44,0x91,0x6b,0xd1, 27 | 0x05,0xd1,0x1f,0xd1,0x39,0x55,0xd4,0xaa,0x05,0xe0,0x36,0xd3,0xd5,0xf6,0x03,0x00, 28 | 0x00, 29 | }; 30 | 31 | struct asset battery_numbers_0_i = { 32 | 26, 39, battery_numbers_0_i_bits, sizeof(battery_numbers_0_i_bits) - 1, NULL }; 33 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_1.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_1_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0x63,0x60,0xa0,0x14,0xf8,0xbf, 3 | 0xff,0x0f,0x02,0xf5,0x18,0x12,0xf5,0xff,0xff,0x63,0x95,0xe1,0x5f,0xff,0x1f,0xbb, 4 | 0x8c,0xfe,0xf9,0xff,0xd8,0x65,0xa0,0x56,0x60,0xca,0xf4,0xff,0xff,0x8f,0x55,0x86, 5 | 0x7f,0xff,0x7f,0xec,0x32,0xfa,0xf7,0xff,0x63,0x97,0x81,0x5b,0x71,0xfe,0x3c,0x9a, 6 | 0x8c,0x3e,0x4c,0x02,0x66,0x28,0xc2,0xb4,0x78,0x30,0x7f,0x3e,0x3f,0x03,0x86,0x0c, 7 | 0xc3,0x7c,0x20,0x37,0x1f,0x48,0x63,0xca,0x30,0x9c,0x7f,0x6f,0xcf,0x80,0x5d,0x86, 8 | 0x5f,0x9e,0x01,0x87,0x0c,0x14,0x8c,0xca,0x8c,0xca,0x80,0x13,0x5e,0x3d,0x18,0xd8, 9 | 0x93,0x9b,0x79,0x01,0x40,0x1f,0x16,0xe2,0xf6,0x03,0x00,0x00, 10 | }; 11 | 12 | struct asset battery_numbers_1_a = { 13 | 26, 39, battery_numbers_1_a_bits, sizeof(battery_numbers_1_a_bits) - 1, NULL }; 14 | static const unsigned char battery_numbers_1_i_bits[] = { 15 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xed,0xd0,0x31,0x0e,0x00,0x20, 16 | 0x08,0x04,0x41,0x9e,0xbe,0x4f,0xb7,0x21,0x31,0x31,0xac,0x1a,0x6d,0xb9,0x0e,0xa6, 17 | 0x81,0x8b,0xf8,0x0d,0x19,0x05,0x6c,0xbf,0x0a,0x26,0x98,0x20,0x02,0x22,0x98,0xf0, 18 | 0x20,0xf3,0x75,0xb9,0xa0,0x6e,0x27,0xa7,0x52,0xf6,0x8d,0xb6,0xb4,0x1c,0xe4,0x2e, 19 | 0x03,0xde,0x7e,0xe5,0xda,0xf6,0x03,0x00,0x00, 20 | }; 21 | 22 | struct asset battery_numbers_1_i = { 23 | 26, 39, battery_numbers_1_i_bits, sizeof(battery_numbers_1_i_bits) - 1, NULL }; 24 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_2.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_2_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xb5,0x92,0x6d,0x11,0xc3,0x20, 3 | 0x0c,0x86,0x71,0x80,0x04,0x24,0x54,0x02,0x12,0x2a,0x21,0x12,0x2a,0x01,0x09,0x93, 4 | 0x80,0x04,0x24,0x20,0xa1,0x12,0x90,0x10,0x09,0x74,0x83,0x94,0xf1,0x95,0xeb,0xae, 5 | 0xbb,0x3e,0xff,0x92,0xf7,0xde,0x24,0x24,0x08,0x71,0x8d,0xd2,0x6f,0x64,0x9f,0x95, 6 | 0xe0,0x30,0x26,0x82,0x5d,0xea,0xbc,0xa1,0x74,0xc6,0x15,0xe3,0x12,0x62,0x4b,0x20, 7 | 0x1b,0xc4,0x81,0x3d,0xb9,0x4c,0x9c,0x60,0x52,0x2d,0x9c,0x28,0x98,0x4c,0x6b,0x0e, 8 | 0x3c,0x28,0xa1,0x4a,0x01,0x48,0x8d,0xb6,0x4f,0x53,0xdd,0x36,0x35,0x39,0xb4,0xd5, 9 | 0xa0,0x34,0xa7,0xa7,0x10,0xbe,0x6f,0xf3,0xad,0x22,0x7e,0x51,0xda,0x3e,0x15,0x34, 10 | 0x68,0x5c,0xb9,0x62,0x38,0xec,0x5c,0x93,0xc5,0x0e,0xc7,0xa0,0x99,0x51,0xf5,0x8a, 11 | 0xe3,0xfa,0xdb,0x73,0xd5,0xbd,0x70,0x6e,0x66,0xa8,0x55,0xee,0xa4,0x39,0x01,0x3a, 12 | 0xa1,0x9c,0xe9,0x7f,0x41,0xb2,0xc2,0x7e,0x5b,0xd8,0xb8,0x9d,0xa0,0xa9,0x81,0xfc, 13 | 0x73,0x26,0x78,0xe6,0x8f,0x3e,0xa0,0x80,0x9f,0xf2,0x12,0x77,0x38,0x00,0x73,0x09, 14 | 0x2b,0x3d,0xf6,0x03,0x00,0x00, 15 | }; 16 | 17 | struct asset battery_numbers_2_a = { 18 | 26, 39, battery_numbers_2_a_bits, sizeof(battery_numbers_2_a_bits) - 1, NULL }; 19 | static const unsigned char battery_numbers_2_i_bits[] = { 20 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xdd,0xd2,0x51,0x0a,0x00,0x20, 21 | 0x08,0x44,0x41,0x8f,0xfe,0x8e,0x1e,0x04,0x11,0xa8,0x8b,0x18,0x04,0xd1,0xfe,0xd9, 22 | 0x80,0x56,0x68,0x56,0x87,0x99,0xfc,0x94,0x80,0xf8,0x48,0x58,0x04,0x82,0x68,0x8a, 23 | 0x23,0xf3,0x93,0xd2,0xa1,0xbb,0xf4,0x17,0x5d,0x65,0x7c,0x9b,0xfa,0xa3,0x96,0xd0, 24 | 0x97,0x1a,0xb8,0xd8,0xeb,0x7b,0xd0,0x6b,0xc5,0xc3,0x72,0x90,0x01,0x6f,0x1c,0xc0, 25 | 0xd5,0xf6,0x03,0x00,0x00, 26 | }; 27 | 28 | struct asset battery_numbers_2_i = { 29 | 26, 39, battery_numbers_2_i_bits, sizeof(battery_numbers_2_i_bits) - 1, NULL }; 30 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_3.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_3_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0x85,0x93,0x6d,0x19,0xc5,0x20, 3 | 0x08,0x85,0x6d,0x60,0x04,0x23,0x18,0xc1,0x08,0x8b,0x60,0x04,0x23,0x10,0xc1,0x08, 4 | 0x8b,0x60,0x04,0x23,0x18,0xc1,0x08,0x44,0xf0,0xea,0xd4,0xe1,0xf5,0xe3,0xd9,0xf9, 5 | 0x37,0x5e,0x15,0x38,0x30,0xc6,0xbe,0xa5,0xb2,0xe4,0x1c,0x14,0xc6,0x61,0xaa,0x0a, 6 | 0x76,0xa0,0xca,0xa5,0x3f,0xf9,0xc6,0xf8,0x14,0x2f,0xd2,0x0f,0xb1,0x69,0xa3,0xeb, 7 | 0xb9,0x13,0x36,0x04,0x79,0x41,0xb2,0x27,0x8f,0xcb,0x7b,0xba,0x44,0x4d,0x49,0xcb, 8 | 0x4d,0x3f,0x75,0xd7,0x22,0x2c,0xea,0xb7,0xce,0x5e,0x5f,0xfb,0xe6,0xd4,0x42,0xf8, 9 | 0x27,0x83,0x7c,0x25,0xee,0x48,0xcc,0x02,0x78,0xcb,0x23,0x16,0xd2,0x0c,0xb1,0x73, 10 | 0xfc,0x6a,0xf9,0x03,0x95,0xa4,0x00,0xc0,0xf9,0xde,0xe6,0x00,0x18,0x8c,0xce,0xc0, 11 | 0xf8,0x0c,0x11,0xbc,0x39,0xdb,0x93,0xd2,0x8b,0x3a,0x91,0xec,0x00,0xdd,0xd3,0x3e, 12 | 0x6b,0xf0,0x3a,0xf0,0x79,0x49,0x2c,0xa6,0x93,0x6f,0xa2,0xcf,0x71,0xd9,0x22,0x26, 13 | 0x1b,0x81,0xd5,0xd2,0xcf,0x31,0x6c,0x08,0x9e,0x88,0xa2,0x45,0x70,0x76,0x9c,0xc5, 14 | 0xbb,0x63,0xe6,0x79,0x37,0x80,0xea,0xfb,0xdd,0xfb,0x29,0xa3,0x6b,0x19,0x63,0x36, 15 | 0x01,0xc9,0x84,0x9b,0x6a,0x99,0x76,0x54,0x9c,0xc8,0xc5,0xf6,0x04,0xab,0x35,0x26, 16 | 0xce,0x71,0x78,0x8d,0x96,0x40,0xb9,0xa3,0xd3,0xf3,0x00,0xe4,0xf6,0x37,0xdd,0xeb, 17 | 0x07,0x84,0x15,0x39,0xd2,0xf6,0x03,0x00,0x00, 18 | }; 19 | 20 | struct asset battery_numbers_3_a = { 21 | 26, 39, battery_numbers_3_a_bits, sizeof(battery_numbers_3_a_bits) - 1, NULL }; 22 | static const unsigned char battery_numbers_3_i_bits[] = { 23 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xb5,0x53,0x41,0x0e,0xc0,0x30, 24 | 0x08,0xe2,0xe9,0x3c,0x7d,0xd9,0xc1,0xb5,0xa9,0x22,0xf5,0x30,0x4e,0x56,0xda,0x44, 25 | 0xc0,0x02,0x1e,0x7c,0x51,0x36,0x3f,0xa8,0xfe,0xe2,0x58,0x41,0x33,0xd4,0x0c,0xfb, 26 | 0x47,0x58,0x75,0x35,0x44,0x9a,0x33,0xce,0x59,0x82,0x70,0x62,0xc6,0xd0,0x32,0xda, 27 | 0x59,0x69,0xaa,0x8f,0xe1,0x60,0x9a,0xe8,0x88,0x26,0x3c,0x1b,0x6b,0x75,0x01,0x17, 28 | 0x8a,0xbc,0x3d,0xbf,0xc5,0xa0,0x24,0x47,0x9d,0x05,0x77,0x9b,0x38,0x65,0xe6,0x7f, 29 | 0xc1,0x2f,0xc1,0x46,0xe3,0x0a,0x0f,0xa9,0xa9,0x8e,0xc8,0xf6,0x03,0x00,0x00, 30 | }; 31 | 32 | struct asset battery_numbers_3_i = { 33 | 26, 39, battery_numbers_3_i_bits, sizeof(battery_numbers_3_i_bits) - 1, NULL }; 34 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_4.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_4_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xcd,0xd3,0x6d,0x0d,0xc3,0x30, 3 | 0x0c,0x45,0x51,0x33,0x28,0x84,0x42,0x28,0x84,0x42,0x18,0x84,0x41,0x08,0x84,0x42, 4 | 0x08,0x84,0x41,0x18,0x04,0x43,0x08,0x84,0x41,0x08,0x04,0xaf,0x8a,0xdd,0x26,0xf3, 5 | 0x9b,0xa5,0x49,0x93,0xa6,0xbd,0x5f,0x8d,0x8e,0x74,0xa5,0x7e,0x11,0x7d,0xbb,0x2b, 6 | 0xb7,0x65,0x80,0xb9,0x4a,0x1b,0x83,0xb0,0x04,0x92,0x24,0x90,0xa9,0x46,0x72,0x97, 7 | 0x40,0x2e,0x12,0x48,0x6f,0x79,0xe9,0x2d,0x27,0xda,0x7a,0x73,0x3f,0xd6,0xca,0x28, 8 | 0xda,0xba,0x6d,0x20,0xd6,0x9a,0x41,0xac,0x95,0x08,0x44,0xf3,0x85,0x40,0x56,0x3d, 9 | 0x2f,0xe7,0x23,0x3d,0x64,0x7a,0xb4,0xe3,0x46,0x20,0x67,0xcb,0x4b,0x6f,0x39,0x19, 10 | 0x5a,0x4e,0x86,0xd6,0xab,0x58,0x2b,0xad,0x6d,0x45,0x4f,0x65,0xbf,0x5c,0x58,0x82, 11 | 0xf1,0xaf,0x24,0xf3,0x38,0x7b,0xa7,0x15,0xbf,0x60,0x8e,0xbe,0xde,0x3f,0x90,0x1c, 12 | 0xfd,0x73,0x1f,0xee,0x09,0x97,0x40,0xab,0x8e,0xf6,0x03,0x00,0x00, 13 | }; 14 | 15 | struct asset battery_numbers_4_a = { 16 | 26, 39, battery_numbers_4_a_bits, sizeof(battery_numbers_4_a_bits) - 1, NULL }; 17 | static const unsigned char battery_numbers_4_i_bits[] = { 18 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xd5,0xd2,0x41,0x0a,0x00,0x20, 19 | 0x08,0x05,0x51,0x8f,0x3e,0x47,0x6f,0x13,0x11,0xd4,0x90,0xd2,0xa6,0xfe,0x4e,0x1f, 20 | 0x6e,0xd4,0x88,0xdb,0xd0,0xa3,0x50,0x10,0x4c,0xa8,0x0b,0x26,0xd4,0x05,0x13,0xea, 21 | 0x82,0xc9,0x68,0x98,0xac,0xbb,0xc6,0x64,0x2a,0xf7,0xb2,0x5e,0x0e,0x93,0x63,0xe1, 22 | 0xf3,0x7f,0x25,0xf9,0xd7,0x4f,0x4b,0x2e,0x0d,0x01,0x99,0xaa,0x17,0xf6,0x03,0x00, 23 | 0x00, 24 | }; 25 | 26 | struct asset battery_numbers_4_i = { 27 | 26, 39, battery_numbers_4_i_bits, sizeof(battery_numbers_4_i_bits) - 1, NULL }; 28 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_5.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_5_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xa5,0xd1,0x5b,0x11,0xc3,0x20, 3 | 0x10,0x05,0xd0,0x75,0x80,0x84,0x48,0x40,0xc2,0x4a,0x40,0x02,0x12,0x2a,0x61,0x25, 4 | 0x20,0x01,0x09,0x48,0x40,0x02,0x12,0x22,0x01,0x09,0x94,0xe1,0x51,0xa0,0x64,0xa7, 5 | 0x33,0xf4,0x7e,0xe6,0x04,0xb8,0x0b,0x00,0x47,0x79,0xa5,0x2d,0x4d,0xe8,0x40,0x2c, 6 | 0x2b,0xfe,0x5c,0x2c,0x8d,0x34,0x59,0xff,0x9b,0x73,0x20,0x57,0x05,0xbf,0x0b,0xfe, 7 | 0x92,0xa0,0x4a,0x2b,0x7d,0x0d,0x51,0x5f,0xb3,0x78,0x04,0xf6,0xda,0xac,0x60,0x2f, 8 | 0x34,0xb0,0x92,0x4c,0x11,0xf3,0x20,0xa9,0xf6,0xd0,0x77,0x5e,0xef,0x72,0x2f,0x17, 9 | 0xc7,0x51,0xbd,0x78,0x6f,0xa3,0xbb,0xc5,0x6d,0x38,0xb9,0x6e,0x37,0xa7,0x3f,0x30, 10 | 0x6e,0xa2,0x58,0xc1,0x03,0xe9,0x73,0x4b,0x00,0x21,0x66,0x10,0xf7,0x68,0x8d,0xc9, 11 | 0x8e,0x95,0x22,0xb4,0x25,0xae,0x6d,0x1c,0x1d,0x61,0x8e,0x32,0x9f,0x4b,0xc0,0xe9, 12 | 0xc8,0xf5,0x8d,0x80,0x91,0x28,0x19,0xa9,0xf0,0x20,0xb7,0x6c,0x75,0xc6,0xb1,0xf5, 13 | 0x3b,0xcd,0x73,0x93,0xf3,0x85,0x83,0x27,0x09,0xff,0xe4,0x0d,0x60,0x31,0x39,0x14, 14 | 0xf6,0x03,0x00,0x00, 15 | }; 16 | 17 | struct asset battery_numbers_5_a = { 18 | 26, 39, battery_numbers_5_a_bits, sizeof(battery_numbers_5_a_bits) - 1, NULL }; 19 | static const unsigned char battery_numbers_5_i_bits[] = { 20 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xd5,0xd2,0x4b,0x0a,0x00,0x20, 21 | 0x08,0x04,0xd0,0x39,0xfa,0x1c,0xbd,0x96,0x99,0x4e,0xa1,0x42,0x90,0xdb,0xd7,0x80, 22 | 0x9f,0x80,0x52,0xd1,0xd7,0x3f,0xa2,0xe7,0xc9,0x08,0x1b,0xe2,0x5f,0xc8,0x9e,0xa3, 23 | 0x71,0x58,0x11,0x6a,0xe1,0x25,0x34,0xcd,0x77,0x73,0x18,0x4e,0xd3,0x3b,0xb1,0xba, 24 | 0x46,0x4c,0x92,0xbb,0xc4,0x3b,0xd0,0x6b,0x4b,0x4a,0xfa,0x70,0xea,0xf7,0xa0,0x53, 25 | 0x03,0xa5,0xc3,0x32,0xaf,0xf6,0x03,0x00,0x00, 26 | }; 27 | 28 | struct asset battery_numbers_5_i = { 29 | 26, 39, battery_numbers_5_i_bits, sizeof(battery_numbers_5_i_bits) - 1, NULL }; 30 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_6.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_6_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0x8d,0x93,0x51,0x11,0xc4,0x20, 3 | 0x0c,0x44,0x71,0x80,0x04,0x24,0x20,0x01,0x09,0x48,0x40,0x42,0x25,0x20,0x01,0x09, 4 | 0x48,0xa8,0x04,0x24,0x54,0x02,0x12,0x22,0x81,0xeb,0x95,0x10,0x42,0xc9,0xcd,0x5c, 5 | 0xbe,0x28,0x6f,0x12,0x92,0xcd,0x56,0xa9,0x3f,0x43,0xbb,0x3b,0xb6,0x5b,0x9f,0xaf, 6 | 0x86,0xc1,0xa1,0x8e,0xd0,0x66,0x30,0xe2,0x6a,0x6b,0x22,0x09,0xad,0xc9,0xe4,0x0d, 7 | 0x88,0x58,0x76,0x57,0xee,0x00,0x22,0xa3,0xa5,0x7a,0x18,0x6c,0x47,0xaf,0xb5,0x8e, 8 | 0x6d,0x0e,0x4c,0xb1,0x1b,0xb0,0xbf,0x32,0x54,0xea,0x6f,0x08,0x52,0xf5,0x62,0x49, 9 | 0xd0,0x90,0x26,0x30,0xf1,0xdb,0x72,0xf2,0xa4,0x4b,0x27,0x4a,0x9f,0x63,0x24,0x08, 10 | 0xbc,0xe7,0x6a,0xb8,0xa0,0xf9,0x21,0xb1,0x8f,0x7e,0x2d,0xea,0xa4,0x49,0x24,0xe1, 11 | 0x8a,0x48,0x0a,0x27,0x10,0x8d,0x32,0x69,0x7c,0x99,0x49,0xc0,0x2a,0x5e,0x3c,0x4c, 12 | 0x82,0xad,0x6a,0xa0,0x1e,0x90,0x90,0x3a,0x27,0x3d,0x94,0xe7,0x93,0xbc,0x5c,0xe1, 13 | 0xa7,0x37,0xc1,0xbd,0xc1,0x4e,0x86,0x09,0xc6,0xe2,0xca,0x14,0xa8,0x72,0xad,0x86, 14 | 0xf4,0x2d,0xd2,0xe6,0x86,0x93,0x12,0x2b,0x61,0x98,0xf8,0x7a,0x80,0x3e,0x44,0x26, 15 | 0xb5,0xa6,0xe0,0xf1,0x21,0xcb,0x6a,0x30,0x05,0x0d,0xe7,0x37,0x42,0x0e,0x0b,0x6b, 16 | 0x16,0x78,0xe6,0x39,0xbe,0xa5,0xb2,0x7a,0xd2,0xe5,0x3e,0x57,0xcd,0x4e,0x70,0x9e, 17 | 0xf4,0x8b,0x4a,0xf1,0x01,0x95,0xba,0xc1,0xf5,0xf6,0x03,0x00,0x00, 18 | }; 19 | 20 | struct asset battery_numbers_6_a = { 21 | 26, 39, battery_numbers_6_a_bits, sizeof(battery_numbers_6_a_bits) - 1, NULL }; 22 | static const unsigned char battery_numbers_6_i_bits[] = { 23 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xb5,0x93,0x41,0x0e,0x00,0x21, 24 | 0x08,0x03,0xfb,0xf4,0x3e,0x7d,0x63,0xb2,0x1e,0x14,0x66,0xe9,0x65,0xb9,0xc9,0x44, 25 | 0xa5,0x50,0xa4,0x30,0xbc,0xa2,0xcf,0xbe,0x01,0xe9,0x83,0x98,0x88,0x89,0x98,0x88, 26 | 0x13,0xb2,0x13,0x17,0x40,0x1d,0x39,0x10,0x02,0x4d,0x57,0x5c,0x9f,0xdd,0x47,0x37, 27 | 0xb5,0x93,0x50,0x23,0x32,0xa2,0x8c,0x9c,0x1d,0xa4,0x6f,0x4b,0x3f,0x3d,0xea,0xfb, 28 | 0x8d,0xb8,0x8e,0x0b,0x6b,0x13,0xea,0x51,0x22,0x3b,0x9b,0xc3,0xe4,0x51,0x36,0xfc, 29 | 0xc7,0xf6,0x74,0xde,0xbe,0x69,0xb4,0xcf,0x0f,0xd3,0x5b,0x67,0x21,0xf6,0x03,0x00, 30 | 0x00, 31 | }; 32 | 33 | struct asset battery_numbers_6_i = { 34 | 26, 39, battery_numbers_6_i_bits, sizeof(battery_numbers_6_i_bits) - 1, NULL }; 35 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_7.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_7_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xbd,0x93,0x61,0x09,0x80,0x30, 3 | 0x14,0x84,0x5f,0x03,0x23,0x2c,0x82,0x11,0x5e,0x04,0x23,0x2c,0xc2,0x22,0x2c,0x82, 4 | 0x11,0x8c,0xb0,0x08,0x8b,0x60,0x84,0x45,0x58,0x04,0x15,0xf6,0x40,0xdc,0x71,0x88, 5 | 0x0a,0xde,0xdf,0x8f,0x83,0x6f,0xef,0x98,0xc8,0x8b,0x64,0x12,0x91,0x8d,0xe4,0x27, 6 | 0x72,0x18,0xc4,0x6b,0x92,0x11,0x0f,0x8f,0x30,0x52,0x00,0x38,0xab,0x44,0x20,0xb3, 7 | 0x91,0xa1,0x07,0x43,0x6d,0x60,0x81,0x8a,0xb7,0x8a,0x02,0x29,0x0d,0xac,0x00,0x94, 8 | 0x2a,0xe7,0x06,0x2a,0x55,0x9e,0x81,0x2c,0x46,0x1c,0x53,0x4e,0x50,0x09,0x77,0xca, 9 | 0x78,0xb2,0xc9,0x2a,0x81,0x2a,0xc3,0xc9,0xc6,0x8d,0x9d,0x8c,0x2b,0x9f,0x2b,0x77, 10 | 0x89,0xf4,0x64,0x54,0xd9,0xd3,0x95,0x33,0x5b,0x59,0x6f,0x95,0x95,0x0d,0xb3,0x3e, 11 | 0x50,0xae,0x6c,0x65,0xb5,0x6f,0x16,0xe4,0x6b,0x76,0x16,0x5a,0x15,0x13,0xf6,0x03, 12 | 0x00,0x00, 13 | }; 14 | 15 | struct asset battery_numbers_7_a = { 16 | 26, 39, battery_numbers_7_a_bits, sizeof(battery_numbers_7_a_bits) - 1, NULL }; 17 | static const unsigned char battery_numbers_7_i_bits[] = { 18 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0x63,0x60,0x20,0x03,0x34,0xe0, 19 | 0x00,0x83,0x5b,0x06,0x87,0x27,0x70,0xfb,0x8e,0x78,0x99,0x06,0x0a,0x0c,0xa3,0x8f, 20 | 0x96,0x81,0x76,0x72,0xc3,0xa8,0x93,0x69,0xe8,0x64,0x52,0x01,0x00,0x8a,0xd6,0x22, 21 | 0xc7,0xf6,0x03,0x00,0x00, 22 | }; 23 | 24 | struct asset battery_numbers_7_i = { 25 | 26, 39, battery_numbers_7_i_bits, sizeof(battery_numbers_7_i_bits) - 1, NULL }; 26 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_8.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_8_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0x8d,0x53,0x61,0x19,0x85,0x20, 3 | 0x0c,0xa4,0xc1,0x22,0x18,0xc1,0x08,0x44,0x30,0x02,0x11,0x88,0x40,0x04,0x22,0x10, 4 | 0xc1,0x08,0x8b,0x40,0x04,0x22,0x10,0x61,0x4f,0x64,0xe0,0x10,0xfd,0x9e,0xf7,0xcb, 5 | 0x71,0xdf,0xe6,0xee,0x0e,0x94,0xfa,0x80,0x55,0xeb,0xf5,0xe1,0xd4,0x47,0x3a,0x91, 6 | 0x82,0x96,0xe7,0x0b,0x92,0x00,0x5e,0x9d,0x6b,0xa6,0x01,0xd9,0xbc,0x10,0x07,0xb8, 7 | 0x0b,0x27,0x82,0xb0,0xb6,0xb4,0x32,0x18,0x13,0x86,0x26,0xc7,0xc5,0x39,0xdc,0x70, 8 | 0xe1,0x04,0xb3,0xd7,0xd1,0xfb,0xcc,0xb8,0xca,0xb8,0x57,0xc6,0x8b,0x6a,0x63,0xf1, 9 | 0x95,0x49,0xb5,0xda,0xca,0x37,0xb0,0x9c,0x50,0x0a,0x5e,0x2e,0x83,0x1c,0x4d,0x3b, 10 | 0x40,0xa0,0x61,0x34,0xc4,0xe6,0x4a,0x1e,0x84,0x3e,0xd8,0x83,0x70,0x79,0x1d,0x25, 11 | 0xe1,0x64,0x0c,0x80,0x93,0x9b,0x4c,0x04,0x99,0x81,0x55,0xea,0xef,0x7f,0xe6,0x7c, 12 | 0x62,0xa5,0x9a,0x52,0xf2,0x60,0xdb,0x67,0x54,0x52,0xb6,0x91,0x4b,0x96,0xfd,0x16, 13 | 0x19,0x4f,0x4f,0xa1,0xd8,0x63,0x47,0xd9,0x6d,0xb6,0xe9,0xb6,0xf7,0x55,0xd9,0x45, 14 | 0xdf,0xef,0x47,0xbf,0x7f,0xba,0xcf,0xc0,0x5b,0x8f,0xed,0xe1,0xbb,0x9b,0xbd,0xd8, 15 | 0x97,0x6b,0xb7,0x25,0x28,0xa9,0xa1,0x84,0x0a,0x4d,0x78,0x72,0xc6,0xb8,0x44,0x22, 16 | 0xfb,0x40,0x0f,0x38,0xd5,0x41,0x9a,0x09,0x1e,0xbd,0xc6,0x17,0xe2,0xe8,0xf2,0xc3, 17 | 0x79,0xda,0x64,0x74,0x16,0x73,0x7b,0x73,0xdb,0xfc,0x22,0xf5,0x81,0x2f,0xef,0x59, 18 | 0xfd,0x00,0x58,0x53,0x60,0x65,0xf6,0x03,0x00,0x00, 19 | }; 20 | 21 | struct asset battery_numbers_8_a = { 22 | 26, 39, battery_numbers_8_a_bits, sizeof(battery_numbers_8_a_bits) - 1, NULL }; 23 | static const unsigned char battery_numbers_8_i_bits[] = { 24 | 0x1f,0x8b,0x08,0x00,0x6d,0x8d,0x72,0x4a,0x02,0x03,0xb5,0x93,0xc1,0x0a,0x00,0x20, 25 | 0x08,0x43,0xfd,0xf4,0x7d,0x7a,0x5d,0x82,0x64,0x4e,0x8d,0x70,0xb7,0xf9,0xa2,0xcc, 26 | 0x95,0x59,0x43,0xd8,0x8a,0xab,0x47,0xaa,0xee,0x18,0x20,0x10,0xa0,0x90,0x24,0x80, 27 | 0x42,0xb5,0xf1,0x5b,0xcf,0x11,0x36,0x6f,0x37,0x2d,0xe7,0x46,0x48,0xc6,0x90,0xe4, 28 | 0x63,0x1f,0xf9,0xa0,0x26,0x6e,0x15,0xcd,0xe3,0xb6,0xea,0x50,0x22,0x36,0x4d,0x74, 29 | 0x6f,0xd9,0x7b,0xeb,0x91,0xf7,0xb4,0x3b,0x99,0x66,0xff,0x34,0xd0,0x02,0xe8,0x93, 30 | 0x2f,0xcf,0xf6,0x03,0x00,0x00, 31 | }; 32 | 33 | struct asset battery_numbers_8_i = { 34 | 26, 39, battery_numbers_8_i_bits, sizeof(battery_numbers_8_i_bits) - 1, NULL }; 35 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_9.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_9_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6e,0x8d,0x72,0x4a,0x02,0x03,0x8d,0x93,0x6d,0x15,0x85,0x20, 3 | 0x0c,0x86,0x69,0x40,0x04,0x22,0x10,0x81,0x08,0x46,0x20,0x02,0x11,0x88,0x40,0x04, 4 | 0x22,0xdc,0x08,0x44,0x20,0x02,0x11,0x88,0xb0,0x0b,0x32,0x60,0x80,0x9e,0xe3,0xfb, 5 | 0xc7,0xc9,0xe3,0x3e,0xdc,0x06,0x63,0x1f,0xa4,0x94,0x7a,0x3a,0xf5,0x09,0xaa,0x92, 6 | 0x5f,0xa9,0x08,0x30,0x15,0xe4,0x04,0x32,0x03,0x55,0xd6,0x2f,0xa0,0xe8,0x42,0x92, 7 | 0x76,0x00,0x59,0xdc,0xc0,0xc2,0x29,0xbf,0xb8,0x38,0xce,0x98,0xee,0x81,0xab,0x93, 8 | 0xec,0xa0,0x55,0x4f,0x9c,0x0c,0xda,0xbc,0x25,0xf5,0x98,0x69,0x9a,0xa1,0x17,0x8a, 9 | 0x1f,0x96,0x9f,0x0a,0x34,0x58,0x11,0x66,0xd2,0x83,0xd8,0x4e,0xe6,0xfb,0x0b,0xf9, 10 | 0x51,0x6b,0xf9,0xef,0x92,0xd7,0x61,0x31,0x58,0x5b,0x2f,0xbb,0x10,0x0d,0x34,0xdc, 11 | 0xe8,0x61,0x21,0xa2,0x77,0xc4,0x09,0xc6,0xcd,0x68,0x6e,0x98,0x29,0x37,0x05,0x12, 12 | 0xf9,0xa1,0xa7,0x6e,0x39,0x8a,0x81,0xa4,0xf5,0xcb,0x68,0xe2,0xfd,0x34,0xad,0x54, 13 | 0x92,0x98,0xb3,0x66,0x8c,0x45,0xd1,0x2e,0x14,0x59,0x39,0xd2,0xf2,0x73,0xbf,0xda, 14 | 0x54,0xd2,0xc3,0xe6,0xa5,0xb5,0xf5,0xbb,0x0b,0xc8,0x03,0x60,0x77,0xce,0x60,0x66, 15 | 0xce,0xad,0x8a,0x63,0x1d,0x42,0xf7,0x35,0x8a,0x7d,0xdb,0x21,0xd5,0x92,0xc9,0xa6, 16 | 0x4a,0xb6,0x8e,0x64,0x68,0xec,0xb5,0x7a,0x03,0x1b,0x49,0xe4,0x02,0x51,0x92,0x2d, 17 | 0x6d,0xcb,0x20,0xd1,0x5f,0x4f,0x57,0x54,0x71,0xf6,0x55,0x7f,0xf8,0x66,0xe6,0x39, 18 | 0xf6,0x03,0x00,0x00, 19 | }; 20 | 21 | struct asset battery_numbers_9_a = { 22 | 26, 39, battery_numbers_9_a_bits, sizeof(battery_numbers_9_a_bits) - 1, NULL }; 23 | static const unsigned char battery_numbers_9_i_bits[] = { 24 | 0x1f,0x8b,0x08,0x00,0x6e,0x8d,0x72,0x4a,0x02,0x03,0xb5,0x93,0x51,0x0e,0xc0,0x20, 25 | 0x08,0x43,0x7b,0xf4,0x77,0xf4,0x7d,0x6d,0x09,0x42,0x67,0x5d,0x32,0xbe,0x0c,0xcf, 26 | 0x68,0x81,0x22,0x05,0x01,0xcc,0xd9,0x3b,0x5c,0xbe,0x32,0x30,0x08,0x1c,0xc2,0x21, 27 | 0x02,0x52,0xcf,0x32,0xd7,0x1a,0xd1,0x40,0x56,0x39,0x8d,0xe8,0x6f,0x82,0x55,0xf0, 28 | 0x56,0x36,0x5a,0xfa,0x03,0xae,0x73,0x9e,0x08,0x3e,0xcc,0xa1,0xfe,0x1c,0x57,0xde, 29 | 0xec,0xa2,0x03,0x62,0x1f,0xdb,0x82,0x47,0xb3,0xf3,0xf6,0x89,0x47,0xb7,0x86,0x17, 30 | 0xe9,0x92,0x98,0xbd,0x9a,0xeb,0x50,0x1a,0x17,0x22,0x76,0x6d,0x2b,0xf6,0x03,0x00, 31 | 0x00, 32 | }; 33 | 34 | struct asset battery_numbers_9_i = { 35 | 26, 39, battery_numbers_9_i_bits, sizeof(battery_numbers_9_i_bits) - 1, NULL }; 36 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_numbers_percentage.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_numbers_percentage_a_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x6e,0x8d,0x72,0x4a,0x02,0x03,0xed,0x8e,0x01,0x0d,0xc4,0x20, 3 | 0x0c,0x45,0xeb,0x00,0x09,0x48,0x40,0x02,0x52,0x90,0x30,0x09,0x48,0x38,0x09,0x48, 4 | 0x98,0x84,0x4a,0x40,0x02,0x12,0x90,0xf0,0xd6,0xc2,0xb6,0xd3,0x70,0xc9,0xfd,0x84, 5 | 0xb4,0x79,0xb4,0xfd,0x5f,0xa4,0x4c,0xf8,0x88,0x69,0xd0,0xbc,0x48,0xc4,0x55,0x44, 6 | 0x0a,0x33,0x2e,0x72,0x40,0x1a,0xa8,0x84,0x49,0x5d,0x40,0x2a,0x88,0x1a,0xa9,0xcc, 7 | 0xf0,0x25,0x27,0x1a,0x27,0xc7,0x06,0xbe,0x15,0x3b,0xda,0x18,0x75,0xd2,0xd3,0x7b, 8 | 0xb9,0xc1,0xe9,0x75,0x6d,0x16,0x6b,0xd4,0xa6,0x4e,0x46,0x59,0xa6,0x22,0x21,0xa7, 9 | 0x0c,0xd9,0xcf,0xf3,0xf8,0xad,0x70,0x6a,0xef,0x25,0x36,0x1d,0x8d,0xf4,0xf0,0x90, 10 | 0x1d,0xce,0x4c,0x87,0xa5,0xbd,0x23,0xb9,0x45,0xe8,0xee,0xb9,0x97,0x52,0xde,0x3f, 11 | 0xf9,0xae,0x7f,0xfd,0xb6,0x2e,0xb6,0xc4,0x48,0x71,0xbe,0x02,0x00,0x00, 12 | }; 13 | 14 | struct asset battery_numbers_percentage_a = { 15 | 18, 39, battery_numbers_percentage_a_bits, sizeof(battery_numbers_percentage_a_bits) - 1, NULL }; 16 | static const unsigned char battery_numbers_percentage_i_bits[] = { 17 | 0x1f,0x8b,0x08,0x00,0x6e,0x8d,0x72,0x4a,0x02,0x03,0x63,0x60,0x68,0x00,0x01,0x06, 18 | 0x20,0x80,0x52,0x10,0x01,0x10,0xbb,0x01,0x5d,0x04,0x2e,0xc0,0x00,0xe5,0x61,0x8a, 19 | 0x20,0x04,0x60,0xbc,0x06,0x84,0x68,0x03,0x41,0x21,0x54,0x7d,0x0c,0x28,0x86,0x31, 20 | 0xa0,0x88,0x34,0xa0,0x5b,0x88,0x70,0x33,0x36,0x11,0x84,0x29,0xc8,0xf4,0x28,0x18, 21 | 0xda,0x00,0x00,0xd3,0x8f,0xef,0xc9,0xbe,0x02,0x00,0x00, 22 | }; 23 | 24 | struct asset battery_numbers_percentage_i = { 25 | 18, 39, battery_numbers_percentage_i_bits, sizeof(battery_numbers_percentage_i_bits) - 1, NULL }; 26 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_orange_ani.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_orange_ani.gif -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_orange_img.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_orange_img_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x7a,0x33,0xde,0x51,0x02,0x03,0x35,0xd0,0xb1,0x0a,0x83,0x30, 3 | 0x10,0x06,0x60,0x48,0xd1,0xe7,0x28,0x08,0x79,0x8e,0x82,0xd0,0xe7,0xb0,0x28,0xfa, 4 | 0x1c,0x82,0xd0,0xe7,0x28,0x74,0xeb,0xe8,0x98,0xa9,0x51,0xb7,0x8c,0x8e,0x4e,0xa5, 5 | 0x6e,0x75,0x74,0x2c,0x78,0xff,0xdd,0x85,0x6f,0x0a,0x21,0x97,0xff,0xbf,0xfb,0xbf, 6 | 0x81,0xbd,0xd9,0xaf,0xcc,0xc2,0x66,0xb7,0x94,0x24,0x64,0xfd,0xad,0x5f,0x98,0xd8, 7 | 0x73,0x11,0x9d,0x98,0x2b,0x52,0x92,0x1c,0x42,0x1e,0x32,0x66,0x60,0x34,0xe3,0x67, 8 | 0x10,0xde,0x79,0xf7,0x26,0x0f,0xd1,0xb7,0xec,0xd6,0x17,0xf0,0xba,0xa8,0x33,0x8b, 9 | 0xa7,0x02,0xe8,0xbe,0x55,0xfa,0x96,0xe7,0x78,0x17,0x27,0xe3,0x17,0x13,0x4e,0xfa, 10 | 0x2f,0x12,0x20,0x49,0xc9,0xb9,0xba,0x19,0x19,0x63,0x62,0xc9,0x2f,0x5d,0xd0,0x0b, 11 | 0xfd,0xd0,0xd3,0x6a,0xef,0x9a,0x36,0x80,0x4d,0x1c,0x0e,0x39,0x9a,0x34,0x10,0x01, 12 | 0x00,0x00, 13 | }; 14 | 15 | struct asset battery_orange_img = { 16 | 136, 1, battery_orange_img_bits, sizeof(battery_orange_img_bits) - 1, NULL }; 17 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_orange_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_orange_img.png -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_red_ani.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_red_ani.gif -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_red_img.h: -------------------------------------------------------------------------------- 1 | static const unsigned char battery_red_img_bits[] = { 2 | 0x1f,0x8b,0x08,0x00,0x7a,0x33,0xde,0x51,0x02,0x03,0x45,0xd0,0xa1,0x12,0xc0,0x20, 3 | 0x0c,0x83,0x61,0x1e,0x1f,0x89,0x9c,0xac,0x44,0x22,0x91,0x93,0x93,0x93,0x48,0xe4, 4 | 0xe4,0xe4,0xe4,0x4c,0xf3,0xe7,0x3e,0xd7,0xeb,0x95,0x84,0xf2,0x15,0x79,0xf1,0x60, 5 | 0xa7,0x85,0x1b,0x17,0x4e,0x4c,0x0c,0x74,0x44,0x3a,0xd0,0x50,0xe1,0x99,0xf7,0x02, 6 | 0xbe,0xa6,0xfb,0x7e,0x53,0x29,0x9c,0x4c,0x59,0x95,0x5e,0x7d,0xdc,0x50,0x9d,0xf3, 7 | 0x17,0x7e,0x6f,0x8d,0x55,0x71,0x10,0x01,0x00,0x00, 8 | }; 9 | 10 | struct asset battery_red_img = { 11 | 136, 1, battery_red_img_bits, sizeof(battery_red_img_bits) - 1, NULL }; 12 | -------------------------------------------------------------------------------- /charge_only_mode/assets/battery_red_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/battery_red_img.png -------------------------------------------------------------------------------- /charge_only_mode/assets/bin2c.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | if len(sys.argv) != 4: 4 | print 'Usage: %s name width height' % sys.argv[0] 5 | sys.exit(1) 6 | 7 | NAME, WIDTH, HEIGHT = sys.argv[1:] 8 | 9 | print 'static const unsigned char %s_bits[] = {' % NAME 10 | 11 | while True: 12 | b = sys.stdin.read(16) 13 | if len(b) == 0: break 14 | print ''.join( [ '0x%02x,' % ord(c) for c in b ] ) 15 | 16 | print '};\n\nstruct asset %s = {\n\t%s, %s, %s_bits, sizeof(%s_bits) - 1, NULL };' % (NAME, WIDTH, HEIGHT, NAME, NAME) 17 | -------------------------------------------------------------------------------- /charge_only_mode/assets/ecomoto_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/ecomoto_icon.png -------------------------------------------------------------------------------- /charge_only_mode/assets/extract: -------------------------------------------------------------------------------- 1 | function extract_rgb16() 2 | { 3 | DIMENSIONS=`identify $1 | awk '{print $3}'` 4 | WIDTH=`echo $DIMENSIONS | awk -Fx '{print $1}'` 5 | HEIGHT=`echo $DIMENSIONS | awk -Fx '{print $2}'` 6 | NAME=`echo $1 | sed 's/\..*//'` 7 | convert -colorspace RGB -type TrueColor $1 - | stream -map bgr -storage-type char - - | \ 8 | python 24to16.py | gzip -9c | python bin2c.py $NAME $WIDTH $HEIGHT > ${NAME}.h 9 | } 10 | 11 | function extract_ai() 12 | { 13 | DIMENSIONS=`identify $1 | awk '{print $3}'` 14 | WIDTH=`echo $DIMENSIONS | awk -Fx '{print $1}'` 15 | HEIGHT=`echo $DIMENSIONS | awk -Fx '{print $2}'` 16 | NAME=`echo $1 | sed 's/\..*//' | sed 's/\//_/'` 17 | convert -colorspace Gray $1 - | stream -map a -storage-type char - - | \ 18 | gzip -9c | python bin2c.py ${NAME}_a $WIDTH $HEIGHT > ${NAME}.h 19 | convert -colorspace Gray $1 -type TrueColor - | stream -map i -storage-type char - - | \ 20 | gzip -9c | python bin2c.py ${NAME}_i $WIDTH $HEIGHT >> ${NAME}.h 21 | } 22 | 23 | function extract_rgb16_strip() 24 | { 25 | # Stored in an animated GIF, but only last frame looks valid 26 | convert -colorspace RGB -type TrueColor $1 /tmp/temp-extract.png 27 | DIMENSIONS=`identify /tmp/temp-extract-4.png | awk '{print $3}'` 28 | WIDTH=`echo $DIMENSIONS | awk -Fx '{print $1}'` 29 | HEIGHT=`echo $DIMENSIONS | awk -Fx '{print $2}'` 30 | NAME=`echo $1 | sed 's/\..*//'` 31 | stream -map rgb -storage-type char /tmp/temp-extract-4.png - | \ 32 | python 24to16.py | gzip -9c | python bin2c.py $NAME $WIDTH $HEIGHT > ${NAME}.h 33 | rm -f /tmp/temp-extract-*.png 34 | } 35 | 36 | function extract_rgb16_ani() 37 | { 38 | NAME=`echo $1 | sed 's/\..*//'` 39 | convert -colorspace RGB $1 /tmp/temp-extract.png 40 | rm -f ${NAME}.h 41 | touch ${NAME}.h 42 | let x=0 43 | for j in 0 1 2 3; do 44 | foo="/tmp/temp-extract-$j.png" 45 | DIMENSIONS=`identify $foo | awk '{print $3}'` 46 | WIDTH=`echo $DIMENSIONS | awk -Fx '{print $1}'` 47 | HEIGHT=`echo $DIMENSIONS | awk -Fx '{print $2}'` 48 | stream -map bgr -storage-type char $foo - | \ 49 | python 24to16.py | gzip -9c | python bin2c.py ${NAME}_$x $WIDTH $HEIGHT >> ${NAME}.h 50 | echo >> ${NAME}.h 51 | let x++ 52 | done 53 | 54 | let x=0 55 | echo "struct asset *${NAME}[] = {" >> ${NAME}.h 56 | for foo in /tmp/temp-extract-*.png; do 57 | echo " &${NAME}_$x," >> ${NAME}.h 58 | let x++ 59 | done 60 | echo " NULL" >> ${NAME}.h 61 | echo "};" >> ${NAME}.h 62 | 63 | rm -f /tmp/temp-extract-*.png 64 | } 65 | 66 | extract_rgb16 battery_charge_background.png 67 | 68 | for foo in ic_pane_*.png; do 69 | extract_ai $foo 70 | done 71 | 72 | for foo in battery_*_img.png; do 73 | extract_rgb16 $foo 74 | done 75 | 76 | for foo in battery_*_ani.gif; do 77 | extract_rgb16_ani $foo 78 | done 79 | 80 | for foo in battery_numbers/?.png battery_numbers/percentage.png; do 81 | extract_ai $foo 82 | done 83 | -------------------------------------------------------------------------------- /charge_only_mode/assets/ic_pane_battery_charge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/ic_pane_battery_charge.png -------------------------------------------------------------------------------- /charge_only_mode/assets/ic_pane_battery_complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/ic_pane_battery_complete.png -------------------------------------------------------------------------------- /charge_only_mode/assets/ic_pane_battery_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/ic_pane_battery_error.png -------------------------------------------------------------------------------- /charge_only_mode/assets/instruction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/percy-g2/android_device_motorola_condor/e9bc790b4042ee64e25337497f1775333c1d2606/charge_only_mode/assets/instruction.png -------------------------------------------------------------------------------- /charge_only_mode/assets/screen_size.h: -------------------------------------------------------------------------------- 1 | #define PNG_TOP 71 2 | #define PNG_BOTTOM 317 3 | #define PNG_LEFT 105 4 | 5 | 6 | -------------------------------------------------------------------------------- /charge_only_mode/draw.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | Copyright (c) 2008-2009, Motorola, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted 6 | provided that the following conditions are met: 7 | - Redistributions of source code must retain the above copyright notice, this list of conditions 8 | and the following disclaimer. 9 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10 | and the following disclaimer in the documentation and/or other materials provided with the 11 | distribution. 12 | - Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or 13 | promote products derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 21 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 22 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | **************************************************************************************************/ 24 | 25 | #ifndef _MOT_CHARGE_ONLY_MODE_DRAW_H 26 | #define _MOT_CHARGE_ONLY_MODE_DRAW_H 27 | 28 | int draw_init(int width, int height, int size); 29 | void draw_uninit(void); 30 | void draw(int w, int h, unsigned short *fb, int percentage, int error); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /charge_only_mode/events.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | Copyright (c) 2008-2009, Motorola, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted 6 | provided that the following conditions are met: 7 | - Redistributions of source code must retain the above copyright notice, this list of conditions 8 | and the following disclaimer. 9 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10 | and the following disclaimer in the documentation and/or other materials provided with the 11 | distribution. 12 | - Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or 13 | promote products derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 21 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 22 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | **************************************************************************************************/ 24 | 25 | #ifndef _M_EVENTS_H 26 | #define _M_EVENTS_H 27 | 28 | #define EVENT_QUIT 1 29 | #define EVENT_BATTERY 2 30 | #define EVENT_POWER_KEY_DOWN 3 31 | #define EVENT_POWER_KEY_UP 4 32 | #define EVENT_VOLUMEDOWN_KEY_DOWN 5 33 | #define EVENT_VOLUMEDOWN_KEY_UP 6 34 | #define EVENT_VOLUMEUP_KEY_DOWN 7 35 | #define EVENT_VOLUMEUP_KEY_UP 8 36 | #define EVENT_CAMERA_KEY_DOWN 9 37 | #define EVENT_CAMERA_KEY_UP 10 38 | 39 | extern int ev_init(); 40 | extern int ev_get(int); 41 | extern int uev_get(int); 42 | extern void ev_exit(); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /charge_only_mode/hardware.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | Copyright (c) 2008-2009, Motorola, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted 6 | provided that the following conditions are met: 7 | - Redistributions of source code must retain the above copyright notice, this list of conditions 8 | and the following disclaimer. 9 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10 | and the following disclaimer in the documentation and/or other materials provided with the 11 | distribution. 12 | - Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or 13 | promote products derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 21 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 22 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | **************************************************************************************************/ 24 | 25 | #ifndef _M_HARDWARE_H 26 | #define _M_HARDWARE_H 27 | 28 | struct device_state 29 | { 30 | int is_plugged_into_ac; 31 | int is_plugged_into_usb; 32 | int is_battery_present; 33 | int is_charging; 34 | int is_discharging; 35 | int is_unknown; 36 | int charge_level; 37 | int voltage_level; 38 | }; 39 | 40 | int boot_reason_charge_only(); 41 | void get_device_state(struct device_state *s); 42 | void set_battery_led(struct device_state *s); 43 | void set_brightness(float percent); 44 | void set_button_brightness(float percent); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /charge_only_mode/screen.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | Copyright (c) 2008-2009, Motorola, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted 6 | provided that the following conditions are met: 7 | - Redistributions of source code must retain the above copyright notice, this list of conditions 8 | and the following disclaimer. 9 | - Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10 | and the following disclaimer in the documentation and/or other materials provided with the 11 | distribution. 12 | - Neither the name of the Motorola, Inc. nor the names of its contributors may be used to endorse or 13 | promote products derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 21 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 22 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | **************************************************************************************************/ 24 | 25 | #ifndef _M_SCREEN_H 26 | #define _M_SCREEN_H 27 | 28 | int screen_init(); 29 | int screen_update(int percentage, int error); 30 | void screen_uninit(); 31 | void display_blank(void); 32 | void display_unblank(void); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /egl.cfg: -------------------------------------------------------------------------------- 1 | 0 0 android 2 | 0 1 adreno 3 | -------------------------------------------------------------------------------- /extract-files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | VENDOR=motorola 4 | DEVICE=condor 5 | 6 | BASE=../../../vendor/$VENDOR/$DEVICE/proprietary 7 | 8 | while getopts ":nh" options 9 | do 10 | case $options in 11 | n ) NC=1 ;; 12 | h ) echo "Usage: `basename $0` [OPTIONS] " 13 | echo " -n No clenup" 14 | echo " -h Show this help" 15 | exit ;; 16 | * ) ;; 17 | esac 18 | done 19 | 20 | if [ "x$NC" != "x1" ]; 21 | then 22 | rm -rf $BASE/* 23 | fi 24 | 25 | for FILE in `cat proprietary-blobs.txt | grep -v ^# | grep -v ^$`; do 26 | DIR=`dirname $FILE` 27 | if [ ! -d $BASE/$DIR ]; then 28 | mkdir -p $BASE/$DIR 29 | fi 30 | adb pull /system/$FILE $BASE/$FILE 31 | done 32 | 33 | ./setup-makefiles.sh 34 | -------------------------------------------------------------------------------- /gps/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(call all-makefiles-under,$(LOCAL_PATH)) 4 | -------------------------------------------------------------------------------- /gps/core/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BUILD_TINY_ANDROID),true) 2 | 3 | LOCAL_PATH := $(call my-dir) 4 | 5 | include $(CLEAR_VARS) 6 | 7 | LOCAL_MODULE := libloc_core 8 | LOCAL_MODULE_OWNER := qcom 9 | 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | libgps.utils \ 16 | libdl 17 | 18 | LOCAL_SRC_FILES += \ 19 | MsgTask.cpp \ 20 | LocApiBase.cpp \ 21 | LocAdapterBase.cpp \ 22 | ContextBase.cpp \ 23 | LocDualContext.cpp \ 24 | loc_core_log.cpp 25 | 26 | LOCAL_CFLAGS += \ 27 | -fno-short-enums \ 28 | -D_ANDROID_ 29 | 30 | LOCAL_C_INCLUDES:= \ 31 | $(TARGET_OUT_HEADERS)/gps.utils 32 | 33 | LOCAL_COPY_HEADERS_TO:= libloc_core/ 34 | LOCAL_COPY_HEADERS:= \ 35 | MsgTask.h \ 36 | LocApiBase.h \ 37 | LocAdapterBase.h \ 38 | ContextBase.h \ 39 | LocDualContext.h \ 40 | LBSProxyBase.h \ 41 | UlpProxyBase.h \ 42 | gps_extended_c.h \ 43 | gps_extended.h \ 44 | loc_core_log.h 45 | 46 | LOCAL_PRELINK_MODULE := false 47 | 48 | include $(BUILD_SHARED_LIBRARY) 49 | 50 | endif # not BUILD_TINY_ANDROID 51 | -------------------------------------------------------------------------------- /gps/core/ContextBase.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #define LOG_NDDEBUG 0 30 | #define LOG_TAG "LocSvc_CtxBase" 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace loc_core { 42 | 43 | LBSProxyBase* ContextBase::getLBSProxy(const char* libName) 44 | { 45 | LBSProxyBase* proxy = NULL; 46 | LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName); 47 | void* lib = dlopen(libName, RTLD_NOW); 48 | 49 | if ((void*)NULL != lib) { 50 | getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy"); 51 | if (NULL != getter) { 52 | proxy = (*getter)(); 53 | } 54 | } 55 | if (NULL == proxy) { 56 | proxy = new LBSProxyBase(); 57 | } 58 | LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__); 59 | return proxy; 60 | } 61 | 62 | LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) 63 | { 64 | LocApiBase* locApi = NULL; 65 | 66 | // first if can not be MPQ 67 | if (TARGET_MPQ != loc_get_target()) { 68 | if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) { 69 | // only RPC is the option now 70 | void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); 71 | if (NULL != handle) { 72 | getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); 73 | if (NULL != getter) { 74 | locApi = (*getter)(mMsgTask, exMask); 75 | } 76 | } 77 | } 78 | } 79 | 80 | // locApi could still be NULL at this time 81 | // we would then create a dummy one 82 | if (NULL == locApi) { 83 | locApi = new LocApiBase(mMsgTask, exMask); 84 | } 85 | 86 | return locApi; 87 | } 88 | 89 | ContextBase::ContextBase(const MsgTask* msgTask, 90 | LOC_API_ADAPTER_EVENT_MASK_T exMask, 91 | const char* libName) : 92 | mLBSProxy(getLBSProxy(libName)), 93 | mMsgTask(msgTask), 94 | mLocApi(createLocApi(exMask)), 95 | mLocApiProxy(mLocApi->getLocApiProxy()) 96 | { 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /gps/core/ContextBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __LOC_CONTEXT_BASE__ 30 | #define __LOC_CONTEXT_BASE__ 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | namespace loc_core { 39 | 40 | class LocAdapterBase; 41 | 42 | class ContextBase { 43 | static LBSProxyBase* getLBSProxy(const char* libName); 44 | LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask); 45 | protected: 46 | const LBSProxyBase* mLBSProxy; 47 | const MsgTask* mMsgTask; 48 | LocApiBase* mLocApi; 49 | LocApiProxyBase *mLocApiProxy; 50 | public: 51 | ContextBase(const MsgTask* msgTask, 52 | LOC_API_ADAPTER_EVENT_MASK_T exMask, 53 | const char* libName); 54 | inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; } 55 | 56 | inline const MsgTask* getMsgTask() { return mMsgTask; } 57 | inline LocApiBase* getLocApi() { return mLocApi; } 58 | inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } 59 | inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } 60 | inline bool hasCPIExt() { return mLBSProxy->hasCPIExt(); } 61 | inline void requestUlp(LocAdapterBase* adapter, 62 | unsigned long capabilities) { 63 | mLBSProxy->requestUlp(adapter, capabilities); 64 | } 65 | }; 66 | 67 | } // namespace loc_core 68 | 69 | #endif //__LOC_CONTEXT_BASE__ 70 | -------------------------------------------------------------------------------- /gps/core/LBSProxyBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef IZAT_PROXY_BASE_H 30 | #define IZAT_PROXY_BASE_H 31 | #include 32 | #include 33 | 34 | namespace loc_core { 35 | 36 | class LocApiBase; 37 | class LocAdapterBase; 38 | 39 | class LBSProxyBase { 40 | friend class ContextBase; 41 | inline virtual LocApiBase* 42 | getLocApi(const MsgTask* msgTask, 43 | LOC_API_ADAPTER_EVENT_MASK_T exMask) const { 44 | return NULL; 45 | } 46 | protected: 47 | inline LBSProxyBase() {} 48 | public: 49 | inline virtual ~LBSProxyBase() {} 50 | inline virtual void requestUlp(LocAdapterBase* adapter, 51 | unsigned long capabilities) const {} 52 | inline virtual bool hasAgpsExt() const { return false; } 53 | inline virtual bool hasCPIExt() const { return false; } 54 | }; 55 | 56 | typedef LBSProxyBase* (getLBSProxy_t)(); 57 | 58 | } // namespace loc_core 59 | 60 | #endif // IZAT_PROXY_BASE_H 61 | -------------------------------------------------------------------------------- /gps/core/LocAdapterBase.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #define LOG_NDDEBUG 0 30 | #define LOG_TAG "LocSvc_LocAdapterBase" 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | namespace loc_core { 38 | 39 | // This is the top level class, so the constructor will 40 | // always gets called. Here we prepare for the default. 41 | // But if getLocApi(targetEnumType target) is overriden, 42 | // the right locApi should get created. 43 | LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, 44 | ContextBase* context) : 45 | mEvtMask(mask), mContext(context), 46 | mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask()) 47 | { 48 | mLocApi->addAdapter(this); 49 | } 50 | 51 | void LocAdapterBase:: 52 | handleEngineDownEvent() 53 | DEFAULT_IMPL() 54 | 55 | void LocAdapterBase:: 56 | reportPosition(UlpLocation &location, 57 | GpsLocationExtended &locationExtended, 58 | void* locationExt, 59 | enum loc_sess_status status, 60 | LocPosTechMask loc_technology_mask) 61 | DEFAULT_IMPL() 62 | 63 | void LocAdapterBase:: 64 | reportSv(GpsSvStatus &svStatus, 65 | GpsLocationExtended &locationExtended, 66 | void* svExt) 67 | DEFAULT_IMPL() 68 | 69 | 70 | void LocAdapterBase:: 71 | reportStatus(GpsStatusValue status) 72 | DEFAULT_IMPL() 73 | 74 | 75 | void LocAdapterBase:: 76 | reportNmea(const char* nmea, int length) 77 | DEFAULT_IMPL() 78 | 79 | bool LocAdapterBase:: 80 | reportXtraServer(const char* url1, const char* url2, 81 | const char* url3, const int maxlength) 82 | DEFAULT_IMPL(false) 83 | 84 | bool LocAdapterBase:: 85 | requestXtraData() 86 | DEFAULT_IMPL(false) 87 | 88 | bool LocAdapterBase:: 89 | requestTime() 90 | DEFAULT_IMPL(false) 91 | 92 | bool LocAdapterBase:: 93 | requestLocation() 94 | DEFAULT_IMPL(false) 95 | 96 | bool LocAdapterBase:: 97 | requestATL(int connHandle, AGpsType agps_type) 98 | DEFAULT_IMPL(false) 99 | 100 | bool LocAdapterBase:: 101 | releaseATL(int connHandle) 102 | DEFAULT_IMPL(false) 103 | 104 | bool LocAdapterBase:: 105 | requestSuplES(int connHandle) 106 | DEFAULT_IMPL(false) 107 | 108 | bool LocAdapterBase:: 109 | reportDataCallOpened() 110 | DEFAULT_IMPL(false) 111 | 112 | bool LocAdapterBase:: 113 | reportDataCallClosed() 114 | DEFAULT_IMPL(false) 115 | 116 | bool LocAdapterBase:: 117 | requestNiNotify(GpsNiNotification ¬ify, const void* data) 118 | DEFAULT_IMPL(false) 119 | } // namespace loc_core 120 | -------------------------------------------------------------------------------- /gps/core/LocDualContext.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __LOC_ENG_CONTEXT__ 30 | #define __LOC_ENG_CONTEXT__ 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | namespace loc_core { 38 | 39 | class LocDualContext : public ContextBase { 40 | static const MsgTask* mMsgTask; 41 | static ContextBase* mFgContext; 42 | static ContextBase* mBgContext; 43 | 44 | static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, 45 | const char* name); 46 | static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, 47 | const char* name); 48 | 49 | protected: 50 | LocDualContext(const MsgTask* msgTask, 51 | LOC_API_ADAPTER_EVENT_MASK_T exMask); 52 | inline virtual ~LocDualContext() {} 53 | 54 | public: 55 | static const char* mIzatLibName; 56 | static const LOC_API_ADAPTER_EVENT_MASK_T mFgExclMask; 57 | static const LOC_API_ADAPTER_EVENT_MASK_T mBgExclMask; 58 | static const char* mLocationHalName; 59 | 60 | static ContextBase* getLocFgContext(MsgTask::tCreate tCreator, 61 | const char* name); 62 | static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate, 63 | const char* name); 64 | static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, 65 | const char* name); 66 | static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate, 67 | const char* name); 68 | }; 69 | 70 | } 71 | 72 | #endif //__LOC_ENG_CONTEXT__ 73 | -------------------------------------------------------------------------------- /gps/core/MsgTask.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __MSG_TASK__ 30 | #define __MSG_TASK__ 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | namespace loc_core { 38 | 39 | struct LocMsg { 40 | inline LocMsg() {} 41 | inline virtual ~LocMsg() {} 42 | virtual void proc() const = 0; 43 | inline virtual void log() const {} 44 | }; 45 | 46 | class MsgTask { 47 | public: 48 | typedef void* (*tStart)(void*); 49 | typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); 50 | typedef int (*tAssociate)(); 51 | MsgTask(tCreate tCreator, const char* threadName); 52 | MsgTask(tAssociate tAssociator, const char* threadName); 53 | ~MsgTask(); 54 | void sendMsg(const LocMsg* msg) const; 55 | 56 | private: 57 | const void* mQ; 58 | tAssociate mAssociator; 59 | MsgTask(const void* q, tAssociate associator); 60 | static void* loopMain(void* copy); 61 | void createPThread(const char* name); 62 | }; 63 | 64 | } // namespace loc_core 65 | 66 | #endif //__MSG_TASK__ 67 | -------------------------------------------------------------------------------- /gps/core/UlpProxyBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef ULP_PROXY_BASE_H 30 | #define ULP_PROXY_BASE_H 31 | 32 | #include 33 | 34 | namespace loc_core { 35 | 36 | class LocAdapterBase; 37 | 38 | class UlpProxyBase { 39 | public: 40 | inline UlpProxyBase() {} 41 | inline virtual ~UlpProxyBase() {} 42 | inline virtual bool sendStartFix() { return false;} 43 | inline virtual bool sendStopFix() { return false;} 44 | inline virtual bool sendFixMode(LocPosMode ¶ms) { return false;} 45 | inline virtual bool reportPosition(UlpLocation &location, 46 | GpsLocationExtended &locationExtended, 47 | void* locationExt, 48 | enum loc_sess_status status, 49 | LocPosTechMask loc_technology_mask) { 50 | return false; 51 | } 52 | inline virtual bool reportSv(GpsSvStatus &svStatus, 53 | GpsLocationExtended &locationExtended, 54 | void* svExt) { 55 | return false; 56 | } 57 | inline virtual bool reportStatus(GpsStatusValue status) { 58 | return false; 59 | } 60 | inline virtual void setAdapter(LocAdapterBase* adapter) {} 61 | inline virtual void setCapabilities(unsigned long capabilities) {} 62 | }; 63 | 64 | } // namespace loc_core 65 | 66 | #endif // ULP_PROXY_BASE_H 67 | -------------------------------------------------------------------------------- /gps/core/gps_extended.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef GPS_EXTENDED_H 30 | #define GPS_EXTENDED_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #include 37 | 38 | struct LocPosMode 39 | { 40 | LocPositionMode mode; 41 | GpsPositionRecurrence recurrence; 42 | uint32_t min_interval; 43 | uint32_t preferred_accuracy; 44 | uint32_t preferred_time; 45 | char credentials[14]; 46 | char provider[8]; 47 | LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, 48 | uint32_t gap, uint32_t accu, uint32_t time, 49 | const char* cred, const char* prov) : 50 | mode(m), recurrence(recr), 51 | min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), 52 | preferred_accuracy(accu), preferred_time(time) { 53 | memset(credentials, 0, sizeof(credentials)); 54 | memset(provider, 0, sizeof(provider)); 55 | if (NULL != cred) { 56 | memcpy(credentials, cred, sizeof(credentials)-1); 57 | } 58 | if (NULL != prov) { 59 | memcpy(provider, prov, sizeof(provider)-1); 60 | } 61 | } 62 | 63 | inline LocPosMode() : 64 | mode(LOC_POSITION_MODE_MS_BASED), 65 | recurrence(GPS_POSITION_RECURRENCE_PERIODIC), 66 | min_interval(MIN_POSSIBLE_FIX_INTERVAL), 67 | preferred_accuracy(50), preferred_time(120000) { 68 | memset(credentials, 0, sizeof(credentials)); 69 | memset(provider, 0, sizeof(provider)); 70 | } 71 | 72 | inline bool equals(const LocPosMode &anotherMode) const 73 | { 74 | return anotherMode.mode == mode && 75 | anotherMode.recurrence == recurrence && 76 | anotherMode.min_interval == min_interval && 77 | anotherMode.preferred_accuracy == preferred_accuracy && 78 | anotherMode.preferred_time == preferred_time && 79 | !strncmp(anotherMode.credentials, credentials, sizeof(credentials)-1) && 80 | !strncmp(anotherMode.provider, provider, sizeof(provider)-1); 81 | } 82 | 83 | void logv() const; 84 | }; 85 | 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif /* __cplusplus */ 90 | 91 | #endif /* GPS_EXTENDED_H */ 92 | 93 | -------------------------------------------------------------------------------- /gps/core/loc_core_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_CORE_LOG_H 31 | #define LOC_CORE_LOG_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif 37 | 38 | #include 39 | #include 40 | 41 | const char* loc_get_gps_status_name(GpsStatusValue gps_status); 42 | const char* loc_get_position_mode_name(GpsPositionMode mode); 43 | const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur); 44 | const char* loc_get_aiding_data_mask_names(GpsAidingData data); 45 | const char* loc_get_agps_type_name(AGpsType type); 46 | const char* loc_get_ni_type_name(GpsNiType type); 47 | const char* loc_get_ni_response_name(GpsUserResponseType response); 48 | const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding); 49 | const char* loc_get_agps_bear_name(AGpsBearerType bear); 50 | const char* loc_get_server_type_name(LocServerType type); 51 | const char* loc_get_position_sess_status_name(enum loc_sess_status status); 52 | const char* loc_get_agps_status_name(AGpsStatusValue status); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* LOC_CORE_LOG_H */ 59 | -------------------------------------------------------------------------------- /gps/loc_api/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(call all-makefiles-under,$(LOCAL_PATH)) 4 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BUILD_TINY_ANDROID),true) 2 | #Compile this library only for builds with the latest modem image 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := libloc_eng 9 | LOCAL_MODULE_OWNER := qcom 10 | 11 | LOCAL_MODULE_TAGS := optional 12 | 13 | LOCAL_SHARED_LIBRARIES := \ 14 | libutils \ 15 | libcutils \ 16 | libdl \ 17 | liblog \ 18 | libloc_core \ 19 | libgps.utils 20 | 21 | LOCAL_SRC_FILES += \ 22 | loc_eng.cpp \ 23 | loc_eng_agps.cpp \ 24 | loc_eng_xtra.cpp \ 25 | loc_eng_ni.cpp \ 26 | loc_eng_log.cpp \ 27 | loc_eng_nmea.cpp \ 28 | LocEngAdapter.cpp 29 | 30 | LOCAL_SRC_FILES += \ 31 | loc_eng_dmn_conn.cpp \ 32 | loc_eng_dmn_conn_handler.cpp \ 33 | loc_eng_dmn_conn_thread_helper.c \ 34 | loc_eng_dmn_conn_glue_msg.c \ 35 | loc_eng_dmn_conn_glue_pipe.c 36 | 37 | LOCAL_CFLAGS += \ 38 | -fno-short-enums \ 39 | -D_ANDROID_ 40 | 41 | LOCAL_C_INCLUDES:= \ 42 | $(TARGET_OUT_HEADERS)/gps.utils \ 43 | $(TARGET_OUT_HEADERS)/libloc_core \ 44 | $(LOCAL_DIR) 45 | 46 | LOCAL_COPY_HEADERS_TO:= libloc_eng/ 47 | LOCAL_COPY_HEADERS:= \ 48 | LocEngAdapter.h \ 49 | loc.h \ 50 | loc_eng.h \ 51 | loc_eng_xtra.h \ 52 | loc_eng_ni.h \ 53 | loc_eng_agps.h \ 54 | loc_eng_msg.h \ 55 | loc_eng_log.h 56 | 57 | LOCAL_PRELINK_MODULE := false 58 | 59 | include $(BUILD_SHARED_LIBRARY) 60 | 61 | include $(CLEAR_VARS) 62 | 63 | LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM) 64 | LOCAL_MODULE_OWNER := qcom 65 | 66 | LOCAL_MODULE_TAGS := optional 67 | 68 | ## Libs 69 | 70 | LOCAL_SHARED_LIBRARIES := \ 71 | libutils \ 72 | libcutils \ 73 | liblog \ 74 | libloc_eng \ 75 | libloc_core \ 76 | libgps.utils \ 77 | libdl 78 | 79 | LOCAL_SRC_FILES += \ 80 | loc.cpp \ 81 | gps.c 82 | 83 | LOCAL_CFLAGS += \ 84 | -fno-short-enums \ 85 | -D_ANDROID_ \ 86 | 87 | ifeq ($(TARGET_USES_QCOM_BSP), true) 88 | LOCAL_CFLAGS += -DTARGET_USES_QCOM_BSP 89 | endif 90 | 91 | ## Includes 92 | LOCAL_C_INCLUDES:= \ 93 | $(TARGET_OUT_HEADERS)/gps.utils \ 94 | $(TARGET_OUT_HEADERS)/libloc_core 95 | 96 | LOCAL_PRELINK_MODULE := false 97 | LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw 98 | 99 | include $(BUILD_SHARED_LIBRARY) 100 | 101 | endif # not BUILD_TINY_ANDROID 102 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | -I../../utils \ 3 | -I../../platform_lib_abstractions \ 4 | -fno-short-enums \ 5 | -DFEATURE_GNSS_BIT_API 6 | 7 | libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp 8 | 9 | if USE_GLIB 10 | libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 11 | libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 12 | libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 13 | else 14 | libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS) 15 | libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 16 | libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 17 | endif 18 | libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la 19 | 20 | 21 | libloc_eng_so_la_SOURCES = \ 22 | loc_eng.cpp \ 23 | loc_eng_agps.cpp \ 24 | loc_eng_xtra.cpp \ 25 | loc_eng_ni.cpp \ 26 | loc_eng_log.cpp \ 27 | loc_eng_dmn_conn.cpp \ 28 | loc_eng_dmn_conn_handler.cpp \ 29 | loc_eng_dmn_conn_thread_helper.c \ 30 | loc_eng_dmn_conn_glue_msg.c \ 31 | loc_eng_dmn_conn_glue_pipe.c 32 | 33 | 34 | if USE_GLIB 35 | libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 36 | libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 37 | libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 38 | else 39 | libloc_eng_so_la_CFLAGS = $(AM_CFLAGS) 40 | libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 41 | libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 42 | endif 43 | 44 | libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la 45 | 46 | 47 | libgps_default_so_la_SOURCES = \ 48 | loc.cpp \ 49 | gps.c 50 | 51 | if USE_GLIB 52 | libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 53 | libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 54 | libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 55 | else 56 | libgps_default_so_la_CFLAGS = $(AM_CFLAGS) 57 | libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 58 | libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 59 | endif 60 | 61 | libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la 62 | 63 | library_include_HEADERS = \ 64 | LocEngAdapter.h \ 65 | loc.h \ 66 | loc_eng.h \ 67 | loc_eng_xtra.h \ 68 | loc_eng_ni.h \ 69 | loc_eng_agps.h \ 70 | loc_eng_msg.h \ 71 | loc_eng_log.h 72 | 73 | library_includedir = $(pkgincludedir)/libloc_api_50001 74 | 75 | #Create and Install libraries 76 | lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la libgps_default_so.la 77 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/gps.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | 34 | extern const GpsInterface* get_gps_interface(); 35 | 36 | const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev) 37 | { 38 | return get_gps_interface(); 39 | } 40 | 41 | static int open_gps(const struct hw_module_t* module, char const* name, 42 | struct hw_device_t** device) 43 | { 44 | struct gps_device_t *dev = (struct gps_device_t *) malloc(sizeof(struct gps_device_t)); 45 | 46 | if(dev == NULL) 47 | return -1; 48 | 49 | memset(dev, 0, sizeof(*dev)); 50 | 51 | dev->common.tag = HARDWARE_DEVICE_TAG; 52 | dev->common.version = 0; 53 | dev->common.module = (struct hw_module_t*)module; 54 | dev->get_gps_interface = gps__get_gps_interface; 55 | 56 | *device = (struct hw_device_t*)dev; 57 | return 0; 58 | } 59 | 60 | static struct hw_module_methods_t gps_module_methods = { 61 | .open = open_gps 62 | }; 63 | 64 | struct hw_module_t HAL_MODULE_INFO_SYM = { 65 | .tag = HARDWARE_MODULE_TAG, 66 | .module_api_version = 1, 67 | .hal_api_version = 0, 68 | .id = GPS_HARDWARE_MODULE_ID, 69 | .name = "loc_api GPS Module", 70 | .author = "Qualcomm USA, Inc.", 71 | .methods = &gps_module_methods, 72 | }; 73 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __LOC_H__ 31 | #define __LOC_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif /* __cplusplus */ 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt); 43 | typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt); 44 | typedef void* (*loc_ext_parser)(void* data); 45 | 46 | typedef struct { 47 | loc_location_cb_ext location_cb; 48 | gps_status_callback status_cb; 49 | loc_sv_status_cb_ext sv_status_cb; 50 | gps_nmea_callback nmea_cb; 51 | gps_set_capabilities set_capabilities_cb; 52 | gps_acquire_wakelock acquire_wakelock_cb; 53 | gps_release_wakelock release_wakelock_cb; 54 | gps_create_thread create_thread_cb; 55 | loc_ext_parser location_ext_parser; 56 | loc_ext_parser sv_ext_parser; 57 | gps_request_utc_time request_utc_time_cb; 58 | } LocCallbacks; 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif /* __cplusplus */ 63 | 64 | #endif //__LOC_H__ 65 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_ENG_DATA_SERVER_H 30 | #define LOC_ENG_DATA_SERVER_H 31 | 32 | #include "loc_eng_dmn_conn_thread_helper.h" 33 | 34 | #ifdef _ANDROID_ 35 | 36 | #define GPSONE_LOC_API_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_q" 37 | #define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q" 38 | #define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q" 39 | #define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_ctrl_q" 40 | #define MSAPU_CTRL_Q_PATH "/data/misc/gpsone_d/msapu_ctrl_q" 41 | 42 | #else 43 | 44 | #define GPSONE_LOC_API_Q_PATH "/tmp/gpsone_loc_api_q" 45 | #define GPSONE_LOC_API_RESP_Q_PATH "/tmp/gpsone_loc_api_resp_q" 46 | #define QUIPC_CTRL_Q_PATH "/tmp/quipc_ctrl_q" 47 | #define MSAPM_CTRL_Q_PATH "/tmp/msapm_ctrl_q" 48 | #define MSAPU_CTRL_Q_PATH "/tmp/msapu_ctrl_q" 49 | 50 | #endif 51 | 52 | int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread_cb, 53 | const char * loc_api_q_path, const char * ctrl_q_path, void *agps_handle); 54 | int loc_eng_dmn_conn_loc_api_server_unblock(void); 55 | int loc_eng_dmn_conn_loc_api_server_join(void); 56 | int loc_eng_dmn_conn_loc_api_server_data_conn(int, int); 57 | 58 | #endif /* LOC_ENG_DATA_SERVER_H */ 59 | 60 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_ENG_DMN_CONN_GLUE_MSG_H 30 | #define LOC_ENG_DMN_CONN_GLUE_MSG_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | 37 | #include 38 | #include "loc_eng_dmn_conn_glue_pipe.h" 39 | 40 | int loc_eng_dmn_conn_glue_msgget(const char * q_path, int mode); 41 | int loc_eng_dmn_conn_glue_msgremove(const char * q_path, int msgqid); 42 | int loc_eng_dmn_conn_glue_msgsnd(int msgqid, const void * msgp, size_t msgsz); 43 | int loc_eng_dmn_conn_glue_msgrcv(int msgqid, void *msgp, size_t msgsz); 44 | int loc_eng_dmn_conn_glue_msgflush(int msgqid); 45 | int loc_eng_dmn_conn_glue_msgunblock(int msgqid); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif /* __cplusplus */ 50 | 51 | #endif /* LOC_ENG_DMN_CONN_GLUE_MSG_H */ 52 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_ENG_DMN_CONN_GLUE_PIPE_H 30 | #define LOC_ENG_DMN_CONN_GLUE_PIPE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #include 37 | 38 | int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode); 39 | int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd); 40 | int loc_eng_dmn_conn_glue_pipewrite(int fd, const void * buf, size_t sz); 41 | int loc_eng_dmn_conn_glue_piperead(int fd, void * buf, size_t sz); 42 | 43 | int loc_eng_dmn_conn_glue_pipeflush(int fd); 44 | int loc_eng_dmn_conn_glue_pipeunblock(int fd); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif /* __cplusplus */ 49 | 50 | #endif /* LOC_ENG_DMN_CONN_GLUE_PIPE_H */ 51 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_ENG_DATA_SERVER_HANDLER 30 | #define LOC_ENG_DATA_SERVER_HANDLER 31 | 32 | #include 33 | #include 34 | 35 | //for SSID_BUF_SIZE 36 | #include 37 | 38 | #ifndef SSID_BUF_SIZE 39 | #define SSID_BUF_SIZE (32+1) 40 | #endif 41 | 42 | enum { 43 | /* 0x0 - 0xEF is reserved for daemon internal */ 44 | GPSONE_LOC_API_IF_REQUEST = 0xF0, 45 | GPSONE_LOC_API_IF_RELEASE, 46 | GPSONE_LOC_API_RESPONSE, 47 | GPSONE_UNBLOCK, 48 | }; 49 | 50 | enum { 51 | GPSONE_LOC_API_IF_REQUEST_SUCCESS = 0xF0, 52 | GPSONE_LOC_API_IF_RELEASE_SUCCESS, 53 | GPSONE_LOC_API_IF_FAILURE, 54 | }; 55 | 56 | 57 | struct ctrl_msg_response { 58 | int result; 59 | }; 60 | 61 | struct ctrl_msg_unblock { 62 | int reserved; 63 | }; 64 | 65 | typedef enum { 66 | IF_REQUEST_TYPE_SUPL = 0, 67 | IF_REQUEST_TYPE_WIFI, 68 | IF_REQUEST_TYPE_ANY 69 | } ctrl_if_req_type_e_type; 70 | 71 | typedef enum { 72 | IF_REQUEST_SENDER_ID_QUIPC = 0, 73 | IF_REQUEST_SENDER_ID_MSAPM, 74 | IF_REQUEST_SENDER_ID_MSAPU, 75 | IF_REQUEST_SENDER_ID_GPSONE_DAEMON, 76 | IF_REQUEST_SENDER_ID_MODEM 77 | } ctrl_if_req_sender_id_e_type; 78 | 79 | struct ctrl_msg_if_request { 80 | ctrl_if_req_type_e_type type; 81 | ctrl_if_req_sender_id_e_type sender_id; 82 | unsigned long ipv4_addr; 83 | unsigned char ipv6_addr[16]; 84 | char ssid[SSID_BUF_SIZE]; 85 | char password[SSID_BUF_SIZE]; 86 | }; 87 | 88 | /* do not change this structure */ 89 | struct ctrl_msgbuf { 90 | size_t msgsz; 91 | uint16_t reserved1; 92 | uint32_t reserved2; 93 | uint8_t ctrl_type; 94 | union { 95 | struct ctrl_msg_response cmsg_response; 96 | struct ctrl_msg_unblock cmsg_unblock; 97 | struct ctrl_msg_if_request cmsg_if_request; 98 | } cmsg; 99 | }; 100 | 101 | extern void* loc_api_handle; 102 | 103 | int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, int len); 104 | int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, int len); 105 | 106 | #endif /* LOC_ENG_DATA_SERVER_HANDLER */ 107 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ 30 | #define __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #include 37 | 38 | struct loc_eng_dmn_conn_thelper { 39 | unsigned char thread_exit; 40 | unsigned char thread_ready; 41 | pthread_cond_t thread_cond; 42 | pthread_mutex_t thread_mutex; 43 | pthread_t thread_id; 44 | void * thread_context; 45 | int (*thread_proc_init) (void * context); 46 | int (*thread_proc_pre) (void * context); 47 | int (*thread_proc) (void * context); 48 | int (*thread_proc_post) (void * context); 49 | }; 50 | 51 | typedef pthread_t (* thelper_create_thread)(const char* name, void (*start)(void *), void* arg); 52 | int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper, 53 | int (*thread_proc_init) (void * context), 54 | int (*thread_proc_pre) (void * context), 55 | int (*thread_proc) (void * context), 56 | int (*thread_proc_post) (void * context), 57 | thelper_create_thread create_thread_cb, 58 | void * context); 59 | 60 | int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper); 61 | int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper); 62 | 63 | /* if only need to use signal */ 64 | int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper); 65 | int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper); 66 | int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper); 67 | int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper); 68 | int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif /* __cplusplus */ 73 | 74 | #endif /* __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ */ 75 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_log.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #define LOG_NDDEBUG 0 31 | #define LOG_TAG "LocSvc_eng" 32 | 33 | #include "loc_log.h" 34 | #include "loc_eng_log.h" 35 | 36 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_ENG_LOG_H 31 | #define LOC_ENG_LOG_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif 37 | 38 | #include 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* LOC_ENG_LOG_H */ 45 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_ni.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009,2011 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_ENG_NI_H 31 | #define LOC_ENG_NI_H 32 | 33 | #include 34 | 35 | #define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ 36 | #define LOC_NI_NOTIF_KEY_ADDRESS "Address" 37 | 38 | typedef struct { 39 | pthread_t thread; /* NI thread */ 40 | int respTimeLeft; /* examine time for NI response */ 41 | bool respRecvd; /* NI User reponse received or not from Java layer*/ 42 | void* rawRequest; 43 | int reqID; /* ID to check against response */ 44 | GpsUserResponseType resp; 45 | pthread_cond_t tCond; 46 | pthread_mutex_t tLock; 47 | } loc_eng_ni_data_s_type; 48 | 49 | 50 | #endif /* LOC_ENG_NI_H */ 51 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_nmea.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_ENG_NMEA_H 31 | #define LOC_ENG_NMEA_H 32 | 33 | #include 34 | 35 | #define NMEA_SENTENCE_MAX_LENGTH 200 36 | 37 | void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p); 38 | int loc_eng_nmea_put_checksum(char *pNmea, int maxSize); 39 | void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended); 40 | void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended, unsigned char generate_nmea); 41 | 42 | #endif // LOC_ENG_NMEA_H 43 | -------------------------------------------------------------------------------- /gps/loc_api/libloc_api_50001/loc_eng_xtra.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009,2011 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_ENG_XTRA_H 31 | #define LOC_ENG_XTRA_H 32 | 33 | #include 34 | 35 | // Module data 36 | typedef struct 37 | { 38 | // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; 39 | gps_xtra_download_request download_request_cb; 40 | report_xtra_server report_xtra_server_cb; 41 | 42 | // XTRA data buffer 43 | char *xtra_data_for_injection; // NULL if no pending data 44 | int xtra_data_len; 45 | } loc_eng_xtra_data_s_type; 46 | 47 | #endif // LOC_ENG_XTRA_H 48 | -------------------------------------------------------------------------------- /gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include "platform_lib_time.h" 32 | 33 | int64_t systemTime(int clock) 34 | { 35 | struct timeval t; 36 | t.tv_sec = t.tv_usec = 0; 37 | gettimeofday(&t, NULL); 38 | return t.tv_sec*1000000LL + t.tv_usec; 39 | } 40 | 41 | 42 | int64_t elapsedMillisSinceBoot() 43 | { 44 | int64_t t_us = systemTime(0); 45 | return (int64_t) t_us / 1000LL; 46 | } 47 | -------------------------------------------------------------------------------- /gps/platform_lib_abstractions/platform_lib_includes.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _PLATFORM_LIB_INCLUDES_H_ 30 | #define _PLATFORM_LIB_INCLUDES_H_ 31 | 32 | #include "platform_lib_time.h" 33 | #include "platform_lib_macros.h" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /gps/platform_lib_abstractions/platform_lib_macros.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef __PLATFORM_LIB_MACROS_H__ 30 | #define __PLATFORM_LIB_MACROS_H__ 31 | 32 | #include 33 | 34 | #define TS_PRINTF(format, x...) \ 35 | { \ 36 | struct timeval tv; \ 37 | struct timezone tz; \ 38 | int hh, mm, ss; \ 39 | gettimeofday(&tv, &tz); \ 40 | hh = tv.tv_sec/3600%24; \ 41 | mm = (tv.tv_sec%3600)/60; \ 42 | ss = tv.tv_sec%60; \ 43 | fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_usec,##x); \ 44 | } 45 | 46 | 47 | #ifdef USE_GLIB 48 | 49 | #define strlcat g_strlcat 50 | #define strlcpy g_strlcpy 51 | 52 | #define ALOGE(format, x...) TS_PRINTF("E/%s (%d): " format , LOG_TAG, getpid(), ##x) 53 | #define ALOGW(format, x...) TS_PRINTF("W/%s (%d): " format , LOG_TAG, getpid(), ##x) 54 | #define ALOGI(format, x...) TS_PRINTF("I/%s (%d): " format , LOG_TAG, getpid(), ##x) 55 | #define ALOGD(format, x...) TS_PRINTF("D/%s (%d): " format , LOG_TAG, getpid(), ##x) 56 | #define ALOGV(format, x...) TS_PRINTF("V/%s (%d): " format , LOG_TAG, getpid(), ##x) 57 | 58 | #define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid)) 59 | 60 | #define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread 61 | #define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot()) 62 | 63 | 64 | #else 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | pid_t gettid(void); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) 76 | #define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread 77 | #define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) 78 | 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /gps/platform_lib_abstractions/platform_lib_time.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _PLATFORM_LIB_TIME_H_ 30 | #define _PLATFORM_LIB_TIME_H_ 31 | 32 | int64_t systemTime(int clock); 33 | int64_t elapsedMillisSinceBoot(); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /gps/utils/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BUILD_TINY_ANDROID),true) 2 | #Compile this library only for builds with the latest modem image 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | ## Libs 9 | LOCAL_SHARED_LIBRARIES := \ 10 | libutils \ 11 | libcutils \ 12 | liblog 13 | 14 | LOCAL_SRC_FILES += \ 15 | loc_log.cpp \ 16 | loc_cfg.cpp \ 17 | msg_q.c \ 18 | linked_list.c \ 19 | loc_target.cpp \ 20 | loc_timer.c \ 21 | ../platform_lib_abstractions/elapsed_millis_since_boot.cpp 22 | 23 | 24 | LOCAL_CFLAGS += \ 25 | -fno-short-enums \ 26 | -D_ANDROID_ 27 | 28 | LOCAL_LDFLAGS += -Wl,--export-dynamic 29 | 30 | ## Includes 31 | LOCAL_C_INCLUDES:= \ 32 | $(LOCAL_PATH)/../platform_lib_abstractions 33 | 34 | LOCAL_COPY_HEADERS_TO:= gps.utils/ 35 | LOCAL_COPY_HEADERS:= \ 36 | loc_log.h \ 37 | loc_cfg.h \ 38 | log_util.h \ 39 | linked_list.h \ 40 | msg_q.h \ 41 | loc_target.h \ 42 | loc_timer.h \ 43 | ../platform_lib_abstractions/platform_lib_includes.h \ 44 | ../platform_lib_abstractions/platform_lib_time.h \ 45 | ../platform_lib_abstractions/platform_lib_macros.h 46 | 47 | 48 | LOCAL_MODULE := libgps.utils 49 | 50 | LOCAL_MODULE_TAGS := optional 51 | 52 | LOCAL_PRELINK_MODULE := false 53 | 54 | LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) 55 | include $(BUILD_SHARED_LIBRARY) 56 | endif # not BUILD_TINY_ANDROID 57 | -------------------------------------------------------------------------------- /gps/utils/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -Wundef \ 2 | -MD \ 3 | -Wno-trigraphs \ 4 | -g -O0 \ 5 | -fno-inline \ 6 | -fno-short-enums \ 7 | -fpic \ 8 | -I../platform_lib_abstractions 9 | 10 | libgps_utils_so_la_h_sources = log_util.h \ 11 | msg_q.h \ 12 | linked_list.h \ 13 | loc_cfg.h \ 14 | loc_log.h \ 15 | ../platform_lib_abstractions/platform_lib_includes.h \ 16 | ../platform_lib_abstractions/platform_lib_time.h \ 17 | ../platform_lib_abstractions/platform_lib_macros.h 18 | 19 | libgps_utils_so_la_c_sources = linked_list.c \ 20 | msg_q.c \ 21 | loc_cfg.cpp \ 22 | loc_log.cpp \ 23 | ../platform_lib_abstractions/elapsed_millis_since_boot.cpp 24 | 25 | library_includedir = $(pkgincludedir)/utils 26 | 27 | library_include_HEADERS = $(libgps_utils_so_la_h_sources) 28 | 29 | libgps_utils_so_la_SOURCES = $(libgps_utils_so_la_c_sources) 30 | 31 | if USE_GLIB 32 | libgps_utils_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 33 | libgps_utils_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 34 | libgps_utils_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 35 | else 36 | libgps_utils_so_la_CFLAGS = $(AM_CFLAGS) 37 | libgps_utils_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 38 | libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 39 | endif 40 | 41 | libgps_utils_so_la_LIBADD = -lstdc++ -lcutils 42 | 43 | #Create and Install libraries 44 | lib_LTLIBRARIES = libgps_utils_so.la 45 | -------------------------------------------------------------------------------- /gps/utils/loc_cfg.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_CFG_H 31 | #define LOC_CFG_H 32 | 33 | #include 34 | 35 | #define LOC_MAX_PARAM_NAME 48 36 | #define LOC_MAX_PARAM_STRING 80 37 | #define LOC_MAX_PARAM_LINE 80 38 | 39 | #define UTIL_READ_CONF_DEFAULT(filename) \ 40 | loc_read_conf((filename), NULL, 0); 41 | 42 | #define UTIL_READ_CONF(filename, config_table) \ 43 | loc_read_conf((filename), (config_table), sizeof(config_table) / sizeof(config_table[0])) 44 | 45 | /*============================================================================= 46 | * 47 | * MODULE TYPE DECLARATION 48 | * 49 | *============================================================================*/ 50 | typedef struct 51 | { 52 | char param_name[LOC_MAX_PARAM_NAME]; 53 | void *param_ptr; 54 | uint8_t *param_set; /* was this value set by config file? */ 55 | char param_type; /* 'n' for number, 56 | 's' for string, 57 | 'f' for float */ 58 | } loc_param_s_type; 59 | 60 | /*============================================================================= 61 | * 62 | * MODULE EXTERNAL DATA 63 | * 64 | *============================================================================*/ 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | /*============================================================================= 71 | * 72 | * MODULE EXPORTED FUNCTIONS 73 | * 74 | *============================================================================*/ 75 | extern void loc_read_conf(const char* conf_file_name, 76 | loc_param_s_type* config_table, 77 | uint32_t table_length); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif /* LOC_CFG_H */ 84 | -------------------------------------------------------------------------------- /gps/utils/loc_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_LOG_H 31 | #define LOC_LOG_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif 37 | 38 | #include 39 | #include "loc_target.h" 40 | 41 | typedef struct 42 | { 43 | char name[128]; 44 | long val; 45 | } loc_name_val_s_type; 46 | 47 | #define NAME_VAL(x) {"" #x "", x } 48 | 49 | #define UNKNOWN_STR "UNKNOWN" 50 | 51 | #define CHECK_MASK(type, value, mask_var, mask) \ 52 | ((mask_var & mask) ? (type) value : (type) (-1)) 53 | 54 | /* Get names from value */ 55 | const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); 56 | const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); 57 | const char* loc_get_msg_q_status(int status); 58 | const char* loc_get_target_name(unsigned int target); 59 | 60 | extern const char* log_succ_fail_string(int is_succ); 61 | 62 | extern char *loc_get_time(char *time_string, unsigned long buf_size); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* LOC_LOG_H */ 69 | -------------------------------------------------------------------------------- /gps/utils/loc_target.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_TARGET_H 30 | #define LOC_TARGET_H 31 | #define TARGET_SET(gnss,ssc) ( (gnss<<1)|ssc ) 32 | #define TARGET_DEFAULT TARGET_SET(GNSS_MSM, HAS_SSC) 33 | #define TARGET_MDM TARGET_SET(GNSS_MDM, HAS_SSC) 34 | #define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC) 35 | #define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC) 36 | #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) 37 | #define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC) 38 | #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) 39 | #define getTargetGnssType(target) (target>>1) 40 | 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | 46 | unsigned int loc_get_target(void); 47 | 48 | /* Please remember to update 'target_name' in loc_log.cpp, 49 | if do any changes to this enum. */ 50 | typedef enum { 51 | GNSS_NONE = 0, 52 | GNSS_MSM, 53 | GNSS_GSS, 54 | GNSS_MDM, 55 | GNSS_QCA1530, 56 | GNSS_UNKNOWN 57 | }GNSS_TARGET; 58 | 59 | typedef enum { 60 | NO_SSC = 0, 61 | HAS_SSC 62 | }SSC_TYPE; 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /*LOC_TARGET_H*/ 69 | -------------------------------------------------------------------------------- /gps/utils/loc_timer.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __LOC_DELAY_H__ 31 | #define __LOC_DELAY_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif /* __cplusplus */ 36 | #include 37 | #include "log_util.h" 38 | 39 | /* 40 | Return values: 41 | Success = 0 42 | Failure = Non zero 43 | */ 44 | typedef void(*loc_timer_callback)(void *user_data, int result); 45 | 46 | 47 | /* 48 | Returns the handle, which can be used to stop the timer 49 | */ 50 | void* loc_timer_start(unsigned int delay_msec, 51 | loc_timer_callback, 52 | void* user_data); 53 | 54 | /* 55 | handle becomes invalid upon the return of the callback 56 | */ 57 | void loc_timer_stop(void* handle); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif /* __cplusplus */ 62 | 63 | #endif //__LOC_DELAY_H__ 64 | -------------------------------------------------------------------------------- /init/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ifeq ($(TARGET_DEVICE),condor) 4 | 5 | include $(CLEAR_VARS) 6 | 7 | LOCAL_MODULE_TAGS := optional 8 | LOCAL_C_INCLUDES := system/core/init 9 | LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\" 10 | LOCAL_SRC_FILES := init_condor.c 11 | LOCAL_MODULE := libinit_condor 12 | include $(BUILD_STATIC_LIBRARY) 13 | 14 | endif 15 | -------------------------------------------------------------------------------- /init/init_condor.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014, The Linux Foundation. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following 11 | disclaimer in the documentation and/or other materials provided 12 | with the distribution. 13 | * Neither the name of The Linux Foundation nor the names of its 14 | contributors may be used to endorse or promote products derived 15 | from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | #include 32 | 33 | #include "vendor_init.h" 34 | #include "property_service.h" 35 | #include "log.h" 36 | #include "util.h" 37 | 38 | #include "init_msm.h" 39 | 40 | void vendor_load_properties() 41 | { 42 | char platform[PROP_VALUE_MAX]; 43 | char radio[PROP_VALUE_MAX]; 44 | char device[PROP_VALUE_MAX]; 45 | char devicename[PROP_VALUE_MAX]; 46 | int rc; 47 | 48 | rc = property_get("ro.board.platform", platform); 49 | if (!rc || !ISMATCH(platform, ANDROID_TARGET)) 50 | return; 51 | 52 | property_set("ro.product.model", "Moto E"); 53 | property_get("ro.boot.radio", radio); 54 | if (ISMATCH(radio, "0x1")) { 55 | /* xt1021 */ 56 | property_set("ro.product.device", "condor_umts"); 57 | property_set("ro.build.product", "condor_umts"); 58 | property_set("ro.build.description", "condor_retgb-user 4.4.4 KXC21.5-40 46 release-keys"); 59 | property_set("ro.build.fingerprint", "motorola/condor_retgb/condor_umts:4.4.4/KXC21.5-40/46:user/release-keys"); 60 | property_set("ro.mot.build.customerid", "retgb"); 61 | property_set("ro.telephony.default_network", "0"); 62 | property_set("persist.radio.multisim.config", ""); 63 | } else if (ISMATCH(radio, "0x5")) { 64 | /* xt1022 */ 65 | property_set("ro.product.device", "condor_umtsds"); 66 | property_set("ro.build.product", "condor_umtsds"); 67 | property_set("ro.build.description", "condor_retaildsds-user 4.4.4 KXC21.5-40 46 release-keys"); 68 | property_set("ro.build.fingerprint", "motorola/condor_retaildsds/condor_umtsds:4.4.4/KXC21.5-40/46:user/release-keys"); 69 | property_set("ro.mot.build.customerid", "retaildsdsall"); 70 | property_set("ro.telephony.default_network", "0,1"); 71 | property_set("persist.radio.multisim.config", "dsds"); 72 | property_set("persist.radio.dont_use_dsd", "true"); 73 | property_set("persist.radio.plmn_name_cmp", "1"); 74 | } else if (ISMATCH(radio, "0x6")) { 75 | /* xt1023 */ 76 | property_set("ro.product.device", "condor_umts"); 77 | property_set("ro.build.product", "condor_umts"); 78 | property_set("ro.build.description", "condor_retuaws-user 4.4.3 KXC21.5-34 26 release-keys"); 79 | property_set("ro.build.fingerprint", "motorola/condor_retuaws/condor_umts:4.4.3/KXC21.5-34/26:user/release-keys"); 80 | property_set("ro.mot.build.customerid", "retusa_aws"); 81 | property_set("ro.telephony.default_network", "0"); 82 | property_set("persist.radio.multisim.config", ""); 83 | } 84 | property_get("ro.product.device", device); 85 | strlcpy(devicename, device, sizeof(devicename)); 86 | ERROR("Found radio id: %s setting build properties for %s device\n", radio, devicename); 87 | } 88 | -------------------------------------------------------------------------------- /init/init_msm.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013, The Linux Foundation. All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | * Neither the name of The Linux Foundation nor the names of its 13 | contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 16 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 19 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 25 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef __INIT_MSM__H__ 29 | #define __INIT_MSM__H__ 30 | 31 | #include 32 | 33 | #define ISMATCH(a,b) (!strncmp(a,b,PROP_VALUE_MAX)) 34 | 35 | #endif /* __INIT_MSM__H__ */ 36 | -------------------------------------------------------------------------------- /liblight/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014 The CyanogenMod 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 | LOCAL_PATH:= $(call my-dir) 17 | # HAL module implemenation stored in 18 | # hw/..so 19 | include $(CLEAR_VARS) 20 | 21 | LOCAL_SRC_FILES := lights.c 22 | LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw 23 | LOCAL_SHARED_LIBRARIES := liblog 24 | LOCAL_MODULE := lights.$(TARGET_BOARD_PLATFORM) 25 | LOCAL_MODULE_TAGS := optional 26 | 27 | include $(BUILD_SHARED_LIBRARY) 28 | -------------------------------------------------------------------------------- /mkbootimg.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ## Don't change anything under here. The variables are named MSM8610_whatever 4 | ## on purpose, to avoid conflicts with similarly named variables at other 5 | ## parts of the build environment 6 | 7 | ## Imported from the original makefile... 8 | KERNEL_CONFIG := $(KERNEL_OUT)/.config 9 | MSM8610_DTS_NAMES := msm8610 10 | 11 | MSM8610_DTS_FILES = $(wildcard $(TOP)/$(TARGET_KERNEL_SOURCE)/arch/arm/boot/dts/msm8610-condor*.dts) 12 | MSM8610_DTS_FILE = $(lastword $(subst /, ,$(1))) 13 | DTB_FILE = $(addprefix $(KERNEL_OUT)/arch/arm/boot/,$(patsubst %.dts,%.dtb,$(call MSM8610_DTS_FILE,$(1)))) 14 | ZIMG_FILE = $(addprefix $(KERNEL_OUT)/arch/arm/boot/,$(patsubst %.dts,%-zImage,$(call MSM8610_DTS_FILE,$(1)))) 15 | KERNEL_ZIMG = $(KERNEL_OUT)/arch/arm/boot/zImage 16 | DTC = $(KERNEL_OUT)/scripts/dtc/dtc 17 | 18 | define append-msm8610-dtb 19 | mkdir -p $(KERNEL_OUT)/arch/arm/boot;\ 20 | $(foreach MSM8610_DTS_NAME, $(MSM8610_DTS_NAMES), \ 21 | $(foreach d, $(MSM8610_DTS_FILES), \ 22 | $(DTC) -p 1024 -O dtb -o $(call DTB_FILE,$(d)) $(d); \ 23 | cat $(KERNEL_ZIMG) $(call DTB_FILE,$(d)) > $(call ZIMG_FILE,$(d));)) 24 | endef 25 | 26 | 27 | ## Build and run dtbtool 28 | DTBTOOL := $(HOST_OUT_EXECUTABLES)/dtbToolCM$(HOST_EXECUTABLE_SUFFIX) 29 | INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img 30 | 31 | $(INSTALLED_DTIMAGE_TARGET): $(DTBTOOL) $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr $(INSTALLED_KERNEL_TARGET) 32 | @echo -e ${CL_CYN}"Start DT image: $@"${CL_RST} 33 | $(call append-msm8610-dtb) 34 | $(call pretty,"Target dt image: $(INSTALLED_DTIMAGE_TARGET)") 35 | $(hide) $(DTBTOOL) -o $(INSTALLED_DTIMAGE_TARGET) -s $(BOARD_KERNEL_PAGESIZE) -p $(KERNEL_OUT)/scripts/dtc/ $(KERNEL_OUT)/arch/arm/boot/ 36 | @echo -e ${CL_CYN}"Made DT image: $@"${CL_RST} 37 | 38 | 39 | ## Overload bootimg generation: Same as the original, + --dt arg 40 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(INSTALLED_DTIMAGE_TARGET) 41 | $(call pretty,"Target boot image: $@") 42 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output $@ 43 | $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw) 44 | @echo -e ${CL_CYN}"Made boot image: $@"${CL_RST} 45 | 46 | ## Overload recoveryimg generation: Same as the original, + --dt arg 47 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_DTIMAGE_TARGET) \ 48 | $(recovery_ramdisk) \ 49 | $(recovery_kernel) 50 | @echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST} 51 | $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output $@ 52 | $(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw) 53 | @echo -e ${CL_CYN}"Made recovery image: $@"${CL_RST} 54 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/xml/power_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 4 | 73 5 | 238 6 | 30 7 | 3 8 | 2 9 | 50 10 | 100 11 | 70 12 | 250 13 | 10 14 | 15 | 10 16 | 8 17 | 6 18 | 4 19 | 2 20 | 21 | 22 | 300000 23 | 384000 24 | 600000 25 | 787200 26 | 998400 27 | 1190400 28 | 29 | 2 30 | 22 31 | 32 | 40 33 | 45 34 | 66 35 | 78 36 | 143 37 | 160 38 | 39 | 1980 40 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/xml/storage_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 29 | 34 | 35 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | true 22 | 23 | 24 | 87 25 | 26 | 27 | 30000 28 | 29 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | 26 | true 27 | 28 | 30 | true 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /overlay/packages/apps/Bluetooth/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | true 34 | true 35 | true 36 | -------------------------------------------------------------------------------- /overlay/packages/apps/Phone/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | 23 | true 24 | 25 | true 26 | 27 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | 7 | true 8 | 9 | -------------------------------------------------------------------------------- /overlay/packages/services/Telecomm/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | true 21 | 22 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values-mcc310-mnc120/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | true 20 | 21 | 22 | true 23 | 24 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 21 | true 22 | 23 | 24 | true 25 | 26 | 27 | -------------------------------------------------------------------------------- /prebuilt/system/etc/hostapd/hostapd.accept: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are allowed to authenticate (IEEE 802.11) 2 | # with the AP. Optional VLAN ID can be assigned for clients based on the 3 | # MAC address if dynamic VLANs (hostapd.conf dynamic_vlan option) are used. 4 | -------------------------------------------------------------------------------- /prebuilt/system/etc/hostapd/hostapd.deny: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are not allowed to authenticate (IEEE 802.11) 2 | # with the AP. 3 | -------------------------------------------------------------------------------- /prebuilt/system/etc/hsic.control.bt.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Copyright (c) 2012, The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of The Linux Foundation nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | 29 | action=`getprop bluetooth.hsic_ctrl` 30 | last_action=`getprop hsic_ctrl.last` 31 | wifi_status=`getprop wlan.driver.status` 32 | wifi_action=`getprop wlan.hsic_ctrl` 33 | wifi_type=`getprop wlan.driver.ath` 34 | 35 | # check action from bt 36 | if [ $wifi_type == "2" ]; then 37 | if [ $action == "load_wlan" ]; then 38 | if [ $wifi_status == "ok" ] || 39 | [ $wifi_action == "wlan_loading" ] || 40 | [ $last_action == "load_wlan" ]; then 41 | echo "Not doing anything as wlan is on or turning on" 42 | # do nothing 43 | else 44 | setprop wlan.hsic_ctrl "service_loading" 45 | 46 | # bind HSIC HCD 47 | echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/bind 48 | 49 | # load WLAN driver 50 | insmod /system/lib/modules/wlan.ko 51 | 52 | # inform WLAN driver bt is on 53 | echo 1 > /sys/module/wlan/parameters/ath6kl_bt_on 54 | 55 | # unload WLAN driver 56 | rmmod wlan 57 | echo "Now hsic power control will be in auto mode" 58 | fi 59 | elif [ $action == "unbind_hsic" ]; then 60 | if [ "$wifi_action" == "wlan_unloading" ] || 61 | [ "$last_action" == "unbind_hsic" ]; then 62 | echo "Not doing anything as wlan is also unloading" 63 | # do nothing 64 | else 65 | # unbind HSIC HCD 66 | echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind 67 | echo "Unbinding HSIC before BT turns off" 68 | fi 69 | fi 70 | fi # [ $wifi_type == "2" ] 71 | 72 | # set property to done 73 | # setprop bluetooth.hsic_ctrl "done" 74 | 75 | # set property to NULL 76 | setprop wlan.hsic_ctrl "" 77 | 78 | setprop hsic_ctrl.last $action 79 | 80 | -------------------------------------------------------------------------------- /prebuilt/system/etc/init.ath3k.bt.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Copyright (c) 2012, The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of The Linux Foundation nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | 29 | LOG_TAG="qcom-bluetooth" 30 | LOG_NAME="${0}:" 31 | 32 | hciattach_pid="" 33 | 34 | loge () 35 | { 36 | /system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@" 37 | } 38 | 39 | logi () 40 | { 41 | /system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@" 42 | } 43 | 44 | failed () 45 | { 46 | loge "$1: exit code $2" 47 | exit $2 48 | } 49 | 50 | start_hciattach () 51 | { 52 | /system/bin/hciattach -n /dev/ttyHS2 ath3k 3000000 & 53 | hciattach_pid=$! 54 | logi "start_hciattach: pid = $hciattach_pid" 55 | } 56 | 57 | kill_hciattach () 58 | { 59 | logi "kill_hciattach: pid = $hciattach_pid" 60 | ## careful not to kill zero or null! 61 | kill -TERM $hciattach_pid 62 | # this shell doesn't exit now -- wait returns for normal exit 63 | } 64 | 65 | # mimic hciattach options parsing -- maybe a waste of effort 66 | USAGE="hciattach [-n] [-p] [-b] [-t timeout] [-s initial_speed] [speed] [flow|noflow] [bdaddr]" 67 | 68 | while getopts "blnpt:s:" f 69 | do 70 | case $f in 71 | b | l | n | p) opt_flags="$opt_flags -$f" ;; 72 | t) timeout=$OPTARG;; 73 | s) initial_speed=$OPTARG;; 74 | \?) echo $USAGE; exit 1;; 75 | esac 76 | done 77 | shift $(($OPTIND-1)) 78 | 79 | # init does SIGTERM on ctl.stop for service 80 | trap "kill_hciattach" TERM INT 81 | 82 | logi "start hciattach" 83 | start_hciattach 84 | 85 | wait $hciattach_pid 86 | logi "Bluetooth stopped" 87 | 88 | exit 0 89 | -------------------------------------------------------------------------------- /prebuilt/system/etc/init.crda.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Copyright (c) 2012, The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of The Linux Foundation nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | 29 | country=`getprop wlan.crda.country` 30 | # crda takes input in COUNTRY environment variable 31 | if [ $country != "" ] 32 | then 33 | COUNTRY="$country" /system/bin/crda 34 | fi 35 | -------------------------------------------------------------------------------- /prebuilt/system/etc/init.qcom.fm.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Copyright (c) 2009-2011, The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of The Linux Foundation nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | 29 | setprop hw.fm.init 0 30 | 31 | mode=`getprop hw.fm.mode` 32 | version=`getprop hw.fm.version` 33 | isAnalog=`getprop hw.fm.isAnalog` 34 | 35 | #find the transport type 36 | TRANSPORT=`getprop ro.qualcomm.bt.hci_transport` 37 | 38 | LOG_TAG="qcom-fm" 39 | LOG_NAME="${0}:" 40 | 41 | loge () 42 | { 43 | /system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@" 44 | } 45 | 46 | logi () 47 | { 48 | /system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@" 49 | } 50 | 51 | failed () 52 | { 53 | loge "$1: exit code $2" 54 | exit $2 55 | } 56 | 57 | logi "In FM shell Script" 58 | logi "mode: $mode" 59 | logi "isAnalog: $isAnalog" 60 | logi "Transport : $TRANSPORT" 61 | logi "Version : $version" 62 | 63 | #$fm_qsoc_patches 64 | # 65 | case $mode in 66 | "normal") 67 | case $TRANSPORT in 68 | "smd") 69 | logi "inserting the radio transport module" 70 | insmod /system/lib/modules/radio-iris-transport.ko 71 | ;; 72 | *) 73 | logi "default transport case " 74 | ;; 75 | esac 76 | /system/bin/fm_qsoc_patches $version 0 77 | ;; 78 | "wa_enable") 79 | /system/bin/fm_qsoc_patches $version 1 80 | ;; 81 | "wa_disable") 82 | /system/bin/fm_qsoc_patches $version 2 83 | ;; 84 | "config_dac") 85 | /system/bin/fm_qsoc_patches $version 3 $isAnalog 86 | ;; 87 | *) 88 | logi "Shell: Default case" 89 | /system/bin/fm_qsoc_patches $version 0 90 | ;; 91 | esac 92 | 93 | exit_code_fm_qsoc_patches=$? 94 | 95 | case $exit_code_fm_qsoc_patches in 96 | 0) 97 | logi "FM QSoC calibration and firmware download succeeded" 98 | ;; 99 | *) 100 | failed "FM QSoC firmware download and/or calibration failed" $exit_code_fm_qsoc_patches 101 | ;; 102 | esac 103 | 104 | setprop hw.fm.init 1 105 | 106 | exit 0 107 | -------------------------------------------------------------------------------- /prebuilt/system/etc/wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | config_methods=virtual_display virtual_push_button keypad 3 | device_name=Android 4 | manufacturer=Motorola 5 | -------------------------------------------------------------------------------- /prebuilt/system/etc/wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | tdls_external_control=1 3 | p2p_disabled=1 4 | config_methods=virtual_display virtual_push_button keypad 5 | device_name=Android 6 | manufacturer=Motorola 7 | -------------------------------------------------------------------------------- /ramdisk/fstab.qcom: -------------------------------------------------------------------------------- 1 | # Android fstab file. 2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 4 | # 5 | /dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait 6 | /dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,discard,nodev,noatime,nodiratime,noauto_da_alloc,nobarrier wait,check,encryptable=footer 7 | /dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,nodiratime,data=writeback,noauto_da_alloc,barrier=1 wait,check 8 | /dev/block/platform/msm_sdcc.1/by-name/fsg /fsg ext4 ro,nosuid,nodev,barrier=0,context=u:object_r:fsg_file:s0 wait,check 9 | /dev/block/platform/msm_sdcc.1/by-name/modem /firmware ext4 ro,nosuid,nodev,barrier=0,context=u:object_r:firmware_file:s0 wait,check 10 | /dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 defaults wait,check 11 | /dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults recoveryonly 12 | /dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults recoveryonly 13 | 14 | /devices/msm_sdcc.2/mmc_host auto vfat defaults voldmanaged=sdcard1:auto,noemulatedsd 15 | /dev/block/zram0 none swap defaults zramsize=536870912 16 | -------------------------------------------------------------------------------- /ramdisk/init.mmi.boot.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | # We take this from cpuinfo because hex "letters" are lowercase there 4 | set -A cinfo `cat /proc/cpuinfo | /system/bin/grep Revision` 5 | hw=${cinfo[2]#?} 6 | 7 | # Now "cook" the value so it can be matched against devtree names 8 | m2=${hw%?} 9 | minor2=${hw#$m2} 10 | m1=${m2%?} 11 | minor1=${m2#$m1} 12 | if [ "$minor2" == "0" ]; then 13 | minor2="" 14 | if [ "$minor1" == "0" ]; then 15 | minor1="" 16 | fi 17 | fi 18 | setprop ro.hw.revision p${hw%??}$minor1$minor2 19 | unset hw cinfo m1 m2 minor1 minor2 20 | 21 | # reload UTAGS 22 | echo 1 > /proc/config/reload 23 | 24 | # Export these for factory validation purposes 25 | iccid=$(cat /proc/config/iccid/ascii 2>/dev/null) 26 | if [ ! -z "$iccid" ]; then 27 | setprop ro.mot.iccid $iccid 28 | fi 29 | unset iccid 30 | cust_md5=$(cat /proc/config/cust_md5/ascii 2>/dev/null) 31 | if [ ! -z "$cust_md5" ]; then 32 | setprop ro.mot.cust_md5 $cust_md5 33 | fi 34 | unset cust_md5 35 | 36 | # Get FTI data and catch old units with incorrect/missing UTAG_FTI 37 | pds_fti=/pds/factory/fti 38 | set -A fti_pds $(hd $pds_fti 2>/dev/null) 39 | if [ $? -eq 0 ]; then 40 | set -A fti $(hd $pds_fti 2>/dev/null) 41 | fi 42 | 43 | # If UTAG_FTI is readable, compare checksums 44 | # and if they mismatch, assume PDS is valid and overwrite UTAG 45 | utag_fti=/proc/config/fti 46 | set -A fti_utag $(hd ${utag_fti}/ascii 2>/dev/null) 47 | if [ $? -eq 0 ]; then 48 | # Byte 153 is total cksum, if nothing there, PDS data is invalid/missing 49 | if [ ! -z "${fti[153]}" ]; then 50 | # Bytes 75 and 94 have line checksums for year and month/date 51 | if [ "${fti[75]}" != "${fti_utag[75]}" -o "${fti[94]}" != "${fti_utag[94]}" ]; then 52 | echo "Copying FTI data from PDS" 53 | cat $pds_fti > ${utag_fti}/raw 54 | fi 55 | else 56 | # If PDS data is invalid, take UTAG and hope it is correct 57 | set -A fti $(hd ${utag_fti}/ascii 2>/dev/null) 58 | fi 59 | fi 60 | 61 | # Now we have set fti var either from PDS or UTAG 62 | # Get Last Test Station stamp from FTI 63 | # and convert to user-friendly date, US format 64 | # The offsets are for hd-format, corresponding to real offsets 64/65/66 65 | # If the month/date look reasonable, data is probably OK. 66 | mdate="Unknown" 67 | y=0x${fti[73]} 68 | m=0x${fti[77]} 69 | d=0x${fti[78]} 70 | let year=$y month=$m day=$d 71 | # Invalid data will often have bogus month/date values 72 | if [ $month -le 12 -a $day -le 31 -a $year -ge 12 ]; then 73 | mdate=$month/$day/20$year 74 | else 75 | echo "Corrupt FTI data" 76 | fi 77 | 78 | setprop ro.manufacturedate $mdate 79 | unset fti y m d year month day utag_fti pds_fti fti_utag mdate 80 | 81 | t=$(getprop ro.build.tags) 82 | if [[ "$t" != *release* ]]; then 83 | for p in $(cat /proc/cmdline); do 84 | if [ ${p%%:*} = "@" ]; then 85 | v=${p#@:}; a=${v%=*}; b=${v#*=} 86 | ${a%%:*} ${a##*:} $b 87 | fi 88 | done 89 | fi 90 | unset p v a b t 91 | 92 | # Cleanup stale/incorrect programmed model value 93 | # Real values will never contain substrings matching "internal" device name 94 | product=$(getprop ro.hw.device) 95 | model=$(cat /proc/config/model/ascii 2>/dev/null) 96 | if [ $? -eq 0 ]; then 97 | if [ "${model#*_}" == "$product" -o "${model%_*}" == "$product" ]; then 98 | echo "Clearing stale model value" 99 | echo "" > /proc/config/model/raw 100 | fi 101 | fi 102 | unset model product 103 | 104 | # For non-user builds only check if Normal min free offset file is there and use 105 | # those values to override the default setting 106 | if [ "`getprop ro.build.type`" != "user" ] 107 | then 108 | if [ -f /data/minFreeOff.txt ] 109 | then 110 | if [ -e /proc/sys/vm/min_free_normal_offset ] 111 | then 112 | echo -e `cat /data/minFreeOff.txt` > /proc/sys/vm/min_free_normal_offset 113 | fi 114 | fi 115 | fi 116 | 117 | # Let kernel know our image version/variant/crm_version 118 | image_version="10:" 119 | image_version+=`getprop ro.build.id` 120 | image_version+=":" 121 | image_version+=`getprop ro.build.version.incremental` 122 | image_variant=`getprop ro.product.name` 123 | image_variant+="-" 124 | image_variant+=`getprop ro.build.type` 125 | oem_version=`getprop ro.build.version.codename` 126 | echo 10 > /sys/devices/soc0/select_image 127 | echo $image_version > /sys/devices/soc0/image_version 128 | echo $image_variant > /sys/devices/soc0/image_variant 129 | echo $oem_version > /sys/devices/soc0/image_crm_version -------------------------------------------------------------------------------- /sec_config: -------------------------------------------------------------------------------- 1 | /* IPC Security Config */ 2 | /* :: */ 3 | 16:4294967295:1000:3004 4 | /* Allow SS CTL service to be used by system and net_raw processes */ 5 | 43:4294967295:1000:3004 6 | -------------------------------------------------------------------------------- /sepolicy/atvc.te: -------------------------------------------------------------------------------- 1 | type atvc, domain; 2 | type atvc_exec, exec_type, file_type; 3 | init_daemon_domain(atvc) 4 | 5 | allow atvc atvc_prop:property_service set; 6 | allow atvc pds_file:dir search; 7 | unix_socket_connect(atvc, property, init) 8 | -------------------------------------------------------------------------------- /sepolicy/batt_health.te: -------------------------------------------------------------------------------- 1 | type batt_health, domain; 2 | type batt_health_exec, exec_type, file_type; 3 | init_daemon_domain(batt_health); 4 | 5 | allow batt_health batt_health_data_file:dir { search write add_name }; 6 | allow batt_health batt_health_data_file:file { setattr open read write create append }; 7 | allow batt_health pds_file:dir search; 8 | allow batt_health pds_file:file { open read }; 9 | allow batt_health self:capability { dac_override net_admin setuid chown fowner fsetid }; 10 | allow batt_health self:netlink_kobject_uevent_socket { create bind setopt read }; 11 | allow batt_health sysfs_batt_health:dir search; 12 | allow batt_health sysfs_batt_health:file { open read write }; 13 | allow batt_health sysfs_battery_supply:dir { search read }; 14 | allow batt_health sysfs_battery_supply:file { open read }; 15 | allow batt_health sysfs_usb_supply:dir { search read }; 16 | allow batt_health sysfs_usb_supply:file { open read }; 17 | -------------------------------------------------------------------------------- /sepolicy/device.te: -------------------------------------------------------------------------------- 1 | # Partitions 2 | type cid_block_device, dev_type; 3 | type clogo_block_device, dev_type; 4 | type logs_block_device, dev_type; 5 | type hob_block_device, dev_type; 6 | type userdata_block_device, dev_type; 7 | type utags_block_device, dev_type; 8 | -------------------------------------------------------------------------------- /sepolicy/file.te: -------------------------------------------------------------------------------- 1 | # Battery health 2 | type batt_health_data_file, file_type, data_file_type; 3 | type sysfs_batt_health, fs_type, sysfs_type; 4 | 5 | # hw_revs 6 | type hw_revs_data_file, file_type, data_file_type; 7 | 8 | # CMHW 9 | type display_sysfs, fs_type, sysfs_type; 10 | type vibeamp_sysfs, fs_type, sysfs_type; 11 | 12 | # PDS 13 | type pds_file, file_type; 14 | 15 | #fsg 16 | type condor_firmware, file_type; 17 | type fsg_file, fs_type, contextmount_type; 18 | -------------------------------------------------------------------------------- /sepolicy/file_contexts: -------------------------------------------------------------------------------- 1 | # Binaries 2 | /system/bin/batt_health u:object_r:batt_health_exec:s0 3 | /system/bin/dbvc_atvc_property_set u:object_r:atvc_exec:s0 4 | /system/bin/hardware_revisions.sh u:object_r:hw_revs_exec:s0 5 | 6 | # Camera 7 | /data/cam_socket([0-9])+ u:object_r:camera_socket:s0 8 | 9 | # CMHW 10 | /sys/devices/platform/kcal_ctrl\.0(/.*)? u:object_r:display_sysfs:s0 11 | /sys/devices/virtual/timed_output/vibrator/vtg_level u:object_r:vibeamp_sysfs:s0 12 | 13 | # Motorola services 14 | /data/power_supply_logger(/.*)? u:object_r:batt_health_data_file:s0 15 | /sys/module/qpnp_charger/parameters(/.*)? u:object_r:sysfs_batt_health:s0 16 | 17 | # MPDecision 18 | /data/system/default_values u:object_r:mpctl_data_file:s0 19 | /dev/socket/mpctl u:object_r:mpctl_socket:s0 20 | /dev/socket/mpdecision u:object_r:mpctl_socket:s0 21 | 22 | # hw_revs 23 | /data/hardware_revisions u:object_r:hw_revs_data_file:s0 24 | /data/hardware_revisions(/.*)? u:object_r:hw_revs_data_file:s0 25 | 26 | # Partitions 27 | /dev/block/bootdevice/by-name/cid u:object_r:cid_block_device:s0 28 | /dev/block/bootdevice/by-name/clogo u:object_r:clogo_block_device:s0 29 | /dev/block/bootdevice/by-name/dhob u:object_r:hob_block_device:s0 30 | /dev/block/bootdevice/by-name/hob u:object_r:hob_block_device:s0 31 | /dev/block/bootdevice/by-name/logs u:object_r:logs_block_device:s0 32 | /dev/block/bootdevice/by-name/userdata u:object_r:userdata_block_device:s0 33 | /dev/block/bootdevice/by-name/utags u:object_r:utags_block_device:s0 34 | /dev/block/bootdevice/by-name/utagsBackup u:object_r:utags_block_device:s0 35 | 36 | # PDS 37 | /pds(/.*)? u:object_r:pds_file:s0 38 | 39 | # Firmware 40 | /fsg/condor_emea_dsds_5.img.gz u:object_r:condor_firmware:s0 41 | /fsg/0.img.gz u:object_r:condor_firmware:s0 42 | 43 | # Sensors 44 | /dev/akm8963 u:object_r:sensors_device:s0 45 | /dev/akm8963_dev u:object_r:sensors_device:s0 46 | /dev/l3g4200d u:object_r:sensors_device:s0 47 | /dev/lis3dh u:object_r:sensors_device:s0 48 | /data/misc/akmd_set.txt u:object_r:sensors_data_file:s0 49 | 50 | # Thermal 51 | /sys/devices/fd510000.gpio/gpio/gpio13/active_low u:object_r:sysfs_thermal:s0 52 | /sys/devices/fd510000.gpio/gpio/gpio13/edge u:object_r:sysfs_thermal:s0 53 | /sys/devices/f9925000.i2c/i2c-3/3-0048/temp1_input u:object_r:sysfs_thermal:s0 54 | /sys/devices/f9925000.i2c/i2c-3/3-0048/temp1_max u:object_r:sysfs_thermal:s0 55 | /sys/devices/f9925000.i2c/i2c-3/3-0048/temp1_max_hyst u:object_r:sysfs_thermal:s0 56 | -------------------------------------------------------------------------------- /sepolicy/hw_revs.te: -------------------------------------------------------------------------------- 1 | type hw_revs, domain; 2 | type hw_revs_exec, exec_type, file_type; 3 | init_daemon_domain(hw_revs) 4 | 5 | allow hw_revs devpts:chr_file rw_file_perms; 6 | allow hw_revs hw_revs_data_file:dir create_dir_perms; 7 | allow hw_revs hw_revs_data_file:file create_file_perms; 8 | allow hw_revs shell_exec:file r_file_perms; 9 | allow hw_revs system_data_file:dir create_dir_perms; 10 | allow hw_revs system_file:file x_file_perms; 11 | 12 | unix_socket_connect(hw_revs, property, init) 13 | allow hw_revs hw_revs_prop:property_service set; 14 | -------------------------------------------------------------------------------- /sepolicy/init.te: -------------------------------------------------------------------------------- 1 | # Unsure what init is doing here 2 | allow init app_data_file:dir setattr; 3 | allow init cid_block_device:blk_file setattr; 4 | allow init clogo_block_device:blk_file setattr; 5 | allow init hob_block_device:blk_file setattr; 6 | allow init logs_block_device:blk_file setattr; 7 | allow init utags_block_device:blk_file setattr; 8 | -------------------------------------------------------------------------------- /sepolicy/init_shell.te: -------------------------------------------------------------------------------- 1 | # for init_falcon to read filesystem type 2 | allow init_shell userdata_block_device:blk_file { getattr open read ioctl }; 3 | allow init_shell utags_block_device:blk_file { open read }; 4 | -------------------------------------------------------------------------------- /sepolicy/keystore.te: -------------------------------------------------------------------------------- 1 | allow keystore firmware_file:dir r_dir_perms; 2 | allow keystore firmware_file:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/mediaserver.te: -------------------------------------------------------------------------------- 1 | allow mediaserver shell_data_file:dir search; 2 | -------------------------------------------------------------------------------- /sepolicy/mm-qcamerad.te: -------------------------------------------------------------------------------- 1 | allow mm-qcamerad mpctl_socket:sock_file write; 2 | allow mm-qcamerad mpdecision:unix_stream_socket connectto; 3 | allow mm-qcamerad qdsp_device:chr_file { open read ioctl }; 4 | allow mm-qcamerad system_server:unix_stream_socket { read write }; 5 | allow servicemanager mm-qcamerad:dir search; 6 | allow servicemanager mm-qcamerad:file { open read }; 7 | allow servicemanager mm-qcamerad:process { getattr }; 8 | binder_call(mm-qcamerad, servicemanager) 9 | binder_call(mm-qcamerad, system_server) 10 | -------------------------------------------------------------------------------- /sepolicy/mpdecision.te: -------------------------------------------------------------------------------- 1 | allow mpdecision system_data_file:dir w_dir_perms; 2 | allow mpdecision system_data_file:file create_file_perms; 3 | type_transition mpdecision system_data_file:file mpctl_data_file; 4 | type_transition mpdecision socket_device:sock_file mpctl_socket; 5 | allow mpdecision socket_device:sock_file create_file_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/platform_app.te: -------------------------------------------------------------------------------- 1 | allow platform_app time_daemon:unix_stream_socket connectto; 2 | -------------------------------------------------------------------------------- /sepolicy/property.te: -------------------------------------------------------------------------------- 1 | # Motorola service properties 2 | type atvc_prop, property_type; 3 | type hw_revs_prop, property_type; 4 | -------------------------------------------------------------------------------- /sepolicy/property_contexts: -------------------------------------------------------------------------------- 1 | # Motorola service properties 2 | persist.atvc u:object_r:atvc_prop:s0 3 | -------------------------------------------------------------------------------- /sepolicy/rild.te: -------------------------------------------------------------------------------- 1 | allow rild sysfs_battery_supply:dir search; 2 | allow rild sysfs_battery_supply:file { open read }; 3 | allow rild sysfs_usb_supply:dir search; 4 | allow rild sysfs_usb_supply:file { open read }; 5 | allow rild fsg_file:dir search; 6 | allow rild fsg_file:file r_file_perms; 7 | 8 | -------------------------------------------------------------------------------- /sepolicy/rmt_storage.te: -------------------------------------------------------------------------------- 1 | typeattribute rmt_storage rmt_placeholder; 2 | 3 | allow rmt_storage firmware_file:dir r_dir_perms; 4 | allow rmt_storage firmware_file:file r_file_perms; 5 | allow rmt_storage kmem_device:chr_file rw_file_perms; 6 | allow rmt_storage self:capability sys_rawio; 7 | allow rmt_storage self:process execmem; 8 | allow rmt_storage ssd_device:blk_file { read write open }; 9 | allow rmt_storage condor_firmware:file r_file_perms; 10 | allow rmt_storage fsg_file:dir search; 11 | allow rmt_storage fsg_file:file r_file_perms; 12 | -------------------------------------------------------------------------------- /sepolicy/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app shell_data_file:dir search; 2 | -------------------------------------------------------------------------------- /sepolicy/system_init.te: -------------------------------------------------------------------------------- 1 | #============= sysinit ============== 2 | allow sysinit self:capability dac_override; 3 | allow sysinit userinit_exec:file { getattr execute }; 4 | allow sysinit userinit_exec:file { read open execute_no_trans }; 5 | allow sysinit userinit_exec:file { read open }; 6 | -------------------------------------------------------------------------------- /sepolicy/system_server.te: -------------------------------------------------------------------------------- 1 | allow system_server display_sysfs:file { getattr open read write }; 2 | allow system_server vibeamp_sysfs:file { getattr open read write }; 3 | allow system_server time_daemon:unix_stream_socket connectto; -------------------------------------------------------------------------------- /sepolicy/thermal-engine.te: -------------------------------------------------------------------------------- 1 | allow thermal-engine sysfs_battery_supply:dir search; 2 | allow thermal-engine sysfs_battery_supply:file { open read write }; 3 | -------------------------------------------------------------------------------- /sepolicy/ueventd.te: -------------------------------------------------------------------------------- 1 | #============= ueventd ============== 2 | allow ueventd unlabeled:dir search; 3 | allow ueventd unlabeled:file { read getattr open }; 4 | -------------------------------------------------------------------------------- /sepolicy/vold.te: -------------------------------------------------------------------------------- 1 | #============= vold ============== 2 | allow vold userdata_block_device:blk_file { read write ioctl open getattr }; 3 | 4 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | VENDOR=motorola 4 | DEVICE=condor 5 | OUTDIR=vendor/$VENDOR/$DEVICE 6 | MAKEFILE=../../../$OUTDIR/$DEVICE-vendor-blobs.mk 7 | 8 | (cat << EOF) > $MAKEFILE 9 | # Copyright (C) 2014 The CyanogenMod Project 10 | # 11 | # Licensed under the Apache License, Version 2.0 (the "License"); 12 | # you may not use this file except in compliance with the License. 13 | # You may obtain a copy of the License at 14 | # 15 | # http://www.apache.org/licenses/LICENSE-2.0 16 | # 17 | # Unless required by applicable law or agreed to in writing, software 18 | # distributed under the License is distributed on an "AS IS" BASIS, 19 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | # See the License for the specific language governing permissions and 21 | # limitations under the License. 22 | 23 | # This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh 24 | 25 | #Prebuilt libraries that are needed to build open-source libraries 26 | PRODUCT_COPY_FILES := \ 27 | vendor/motorola/condor/proprietary/vendor/lib/libtime_genoff.so:obj/lib/libtime_genoff.so 28 | 29 | PRODUCT_COPY_FILES += \\ 30 | EOF 31 | 32 | LINEEND=" \\" 33 | COUNT=`cat proprietary-blobs.txt | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}` 34 | for FILE in `cat proprietary-blobs.txt | grep -v ^# | grep -v ^$`; do 35 | COUNT=`expr $COUNT - 1` 36 | if [ $COUNT = "0" ]; then 37 | LINEEND="" 38 | fi 39 | echo " $OUTDIR/proprietary/$FILE:system/$FILE$LINEEND" >> $MAKEFILE 40 | done 41 | 42 | (cat << EOF) > ../../../$OUTDIR/$DEVICE-vendor.mk 43 | # Copyright (C) 2014 The CyanogenMod Project 44 | # 45 | # Licensed under the Apache License, Version 2.0 (the "License"); 46 | # you may not use this file except in compliance with the License. 47 | # You may obtain a copy of the License at 48 | # 49 | # http://www.apache.org/licenses/LICENSE-2.0 50 | # 51 | # Unless required by applicable law or agreed to in writing, software 52 | # distributed under the License is distributed on an "AS IS" BASIS, 53 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 54 | # See the License for the specific language governing permissions and 55 | # limitations under the License. 56 | 57 | # This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh 58 | 59 | \$(call inherit-product, vendor/$VENDOR/$DEVICE/$DEVICE-vendor-blobs.mk) 60 | EOF 61 | 62 | (cat << EOF) > ../../../$OUTDIR/BoardConfigVendor.mk 63 | # Copyright (C) 2014 The CyanogenMod Project 64 | # 65 | # Licensed under the Apache License, Version 2.0 (the "License"); 66 | # you may not use this file except in compliance with the License. 67 | # You may obtain a copy of the License at 68 | # 69 | # http://www.apache.org/licenses/LICENSE-2.0 70 | # 71 | # Unless required by applicable law or agreed to in writing, software 72 | # distributed under the License is distributed on an "AS IS" BASIS, 73 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 74 | # See the License for the specific language governing permissions and 75 | # limitations under the License. 76 | 77 | # This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh 78 | 79 | USE_CAMERA_STUB := false 80 | EOF 81 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # system.prop for msm8610 2 | # 3 | 4 | # Use reference RIL for initial bringup 5 | rild.libpath=/vendor/lib/libril-qc-qmi-1.so 6 | rild.libargs=-d /dev/smd0 7 | persist.rild.nitz_plmn= 8 | persist.rild.nitz_long_ons_0= 9 | persist.rild.nitz_long_ons_1= 10 | persist.rild.nitz_long_ons_2= 11 | persist.rild.nitz_long_ons_3= 12 | persist.rild.nitz_short_ons_0= 13 | persist.rild.nitz_short_ons_1= 14 | persist.rild.nitz_short_ons_2= 15 | persist.rild.nitz_short_ons_3= 16 | 17 | # 18 | # system props for the cne module 19 | # 20 | persist.cne.feature=0 21 | 22 | # Skip /sys/power/wait_for_fb_* nodes and 23 | # force FB to be always on 24 | debug.sf.fb_always_on=1 25 | debug.composition.type=gpu 26 | debug.gralloc.map_fb_memory=0 27 | debug.hwc.dynThreshold=1.5 28 | dalvik.vm.heapsize=36m 29 | dev.pm.dyn_samplingrate=1 30 | 31 | ro.hdmi.enable=true 32 | 33 | #system props for the MM modules 34 | 35 | media.stagefright.enable-player=true 36 | media.stagefright.enable-http=true 37 | media.stagefright.enable-aac=true 38 | media.stagefright.enable-qcp=true 39 | media.stagefright.enable-fma2dp=true 40 | media.stagefright.enable-scan=true 41 | mmp.enable.3g2=true 42 | media.aac_51_output_enabled=true 43 | #37491 is decimal sum of supported codecs in AAL 44 | #codecs: AVI AC3 ASF AAC QCP DTS 3G2 MP2TS 45 | mm.enable.qcom_parser=37491 46 | 47 | # VIDC: debug_levels 48 | # 1:ERROR 2:HIGH 4:LOW 0:NOlogs 7:AllLogs 49 | vidc.debug.level=1 50 | 51 | # Camera 52 | camera2.portability.force_api=1 53 | 54 | # 55 | # system props for widevine 56 | # 57 | persist.gralloc.cp.level3=1 58 | 59 | # 60 | # system props for the data modules 61 | # 62 | ro.use_data_netmgrd=true 63 | 64 | #system props for time-services 65 | persist.timed.enable=true 66 | 67 | # 68 | # system prop for opengles version 69 | # 70 | # 196608 is decimal for 0x30000 to report version 3 71 | ro.opengles.version=196608 72 | 73 | # 74 | # System props for telephony 75 | # System prop to turn on CdmaLTEPhone always 76 | telephony.lteOnCdmaDevice=0 77 | 78 | # 79 | #snapdragon value add features 80 | # 81 | ro.qc.sdk.audio.ssr=false 82 | ##fluencetype can be "fluence" or "fluencepro" or "none" 83 | ro.qc.sdk.audio.fluencetype=none 84 | persist.audio.fluence.voicecall=true 85 | persist.audio.fluence.voicerec=false 86 | persist.audio.fluence.speaker=false 87 | ro.config.vc_call_vol_steps=7 88 | ro.audio.fm_max_volume=2624 89 | 90 | # Reduce Background apps limit 91 | ro.sys.fw.bg_apps_limit=20 92 | 93 | # System property for cabl 94 | ro.qualcomm.cabl=0 95 | 96 | # 97 | # system property for Bluetooth hci transport 98 | # 99 | ro.qualcomm.bt.hci_transport=smd 100 | 101 | # 102 | # system property for Bluetooth HFP version 103 | # 104 | ro.bluetooth.hfp.ver=1.6 105 | 106 | # Bluetooth LE power class 107 | qcom.bt.le_dev_pwr_class=1 108 | 109 | # 110 | # system property for Bluetooth SAP support 111 | # Motorola disabled SAP 112 | # 113 | ro.qualcomm.bluetooth.sap=false 114 | 115 | #DASH video streaming 116 | #Specify max allowed resolution/bandwidth for representations 117 | #Set allowed avsync window during playback 118 | # 119 | persist.dash.max.rep.resolution=1280*720 120 | persist.dash.max.rep.bandwidth=4000000 121 | persist.dash.avsync.window.msec=100 122 | 123 | tunnel.audio.encode = false 124 | 125 | #use VERY_HIGH_QUALITY for audio resampler 126 | af.resampler.quality=4 127 | 128 | #disable tunnel mode playback by default 129 | audio.offload.disable=1 130 | av.streaming.offload.enable=false 131 | mm.enable.smoothstreaming=true 132 | 133 | #Buffer size in kbytes for compress offload playback 134 | audio.offload.buffer.size.kb=32 135 | 136 | #8x10 does not support tunnel av playback 137 | #this prop should be set to false all the time 138 | av.offload.enable=false 139 | 140 | #enable voice path for PCM VoIP by default 141 | use.voice.path.for.pcm.voip=true 142 | # 143 | #System property for FM transmitter 144 | # 145 | ro.fm.transmitter=false 146 | 147 | #enable dsp gapless mode by default 148 | audio.offload.gapless.enabled=true 149 | 150 | # Enable SSR 151 | persist.sys.ssr.restart_level=3 152 | persist.sys.qc.sub.rdump.on=0 153 | 154 | # For TCMD debug level 155 | persist.tcmd.log.limit=0 156 | 157 | # Disable QCOM net early sockets feature 158 | net.early.sockets=0 159 | 160 | # Radio RIL properties 161 | persist.radio.no_wait_for_card=1 162 | persist.radio.call_type=1 163 | persist.radio.apm_sim_not_pwdn=1 164 | persist.radio.dfr_mode_set=1 165 | persist.radio.relay_oprt_change=1 166 | 167 | # Property to disable hw keys which will enable on-screen virtual keys 168 | qemu.hw.mainkeys=0 169 | -------------------------------------------------------------------------------- /thermal-engine-8610.conf: -------------------------------------------------------------------------------- 1 | sampling 5000 2 | 3 | [SS-POPMEM] 4 | disable 5 | sensor pop_mem 6 | 7 | [tmp108] 8 | algo_type monitor 9 | sensor tmp108 10 | sampling 1000 11 | thresholds 37000 48000 52000 57000 62000 12 | thresholds_clr 35000 46000 49000 54000 59000 13 | actions cpu cpu cpu cpu cpu 14 | action_info 1190400 998400 787200 600000 384000 15 | 16 | [CPU0-1-2-3_MONITOR] 17 | algo_type monitor 18 | sensor cpu0-1-2-3 19 | sampling 1000 20 | thresholds 120000 21 | thresholds_clr 115000 22 | actions shutdown 23 | action_info 5000 24 | 25 | -------------------------------------------------------------------------------- /touch_dev.idc: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014 The CyanogenMod Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # 16 | # Input Device Calibration File for the Mako touch screen. 17 | # 18 | 19 | device.internal = 1 20 | 21 | touch.deviceType = touchScreen 22 | touch.orientationAware = 1 23 | 24 | touch.size.calibration = diameter 25 | touch.size.scale = 22.5 26 | touch.size.bias = 0 27 | touch.size.isSummed = 0 28 | 29 | touch.pressure.calibration = amplitude 30 | touch.pressure.scale = 0.0125 31 | 32 | touch.orientation.calibration = none 33 | -------------------------------------------------------------------------------- /vendorsetup.sh: -------------------------------------------------------------------------------- 1 | add_lunch_combo aosp_condor-eng 2 | add_lunch_combo aosp_condor-userdebug 3 | --------------------------------------------------------------------------------