Initial Commit
diff --git a/AndroidBoard.mk b/AndroidBoard.mk
new file mode 100644
index 0000000..547a77b
--- /dev/null
+++ b/AndroidBoard.mk
@@ -0,0 +1,8 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)
+
+# include the non-open-source counterpart to this file
+-include vendor/htc/m7/AndroidBoardVendor.mk
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
new file mode 100644
index 0000000..733f968
--- /dev/null
+++ b/AndroidProducts.mk
@@ -0,0 +1,2 @@
+PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/device_m7.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
new file mode 100644
index 0000000..bf9364e
--- /dev/null
+++ b/BoardConfig.mk
@@ -0,0 +1,27 @@
+USE_CAMERA_STUB := true
+
+# inherit from the proprietary version
+-include vendor/htc/m7/BoardConfigVendor.mk
+
+TARGET_NO_BOOTLOADER := true
+TARGET_BOARD_PLATFORM := unknown
+TARGET_CPU_ABI := armeabi
+TARGET_BOOTLOADER_BOARD_NAME := m7
+
+BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.hardware=m7 user_debug=31
+BOARD_KERNEL_BASE := 0x80600000
+BOARD_KERNEL_PAGESIZE := 2048
+
+# fix this up by examining /proc/mtd on a running device
+BOARD_BOOTIMAGE_PARTITION_SIZE := 16777216
+BOARD_RECOVERYIMAGE_PARTITION_SIZE := 16777216
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1946156032
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 12482248704
+BOARD_FLASH_BLOCK_SIZE := 131072
+
+TARGET_PREBUILT_KERNEL := device/htc/m7/kernel
+
+BOARD_USE_CUSTOM_RECOVERY_FONT := \"roboto_23x41.h\"
+TARGET_RECOVERY_INITRC := device/htc/m7/recovery/init.rc
+BOARD_HAS_NO_SELECT_BUTTON := true
+BOARD_HAS_LARGE_FILESYSTEM := true
diff --git a/cm.mk b/cm.mk
new file mode 100644
index 0000000..056bcfc
--- /dev/null
+++ b/cm.mk
@@ -0,0 +1,18 @@
+## Specify phone tech before including full_phone
+$(call inherit-product, vendor/cm/config/gsm.mk)
+
+# Release name
+PRODUCT_RELEASE_NAME := m7
+
+# Inherit some common CM stuff.
+$(call inherit-product, vendor/cm/config/common_full_phone.mk)
+
+# Inherit device configuration
+$(call inherit-product, device/htc/m7/device_m7.mk)
+
+## Device identifier. This must come after all inclusions
+PRODUCT_DEVICE := m7
+PRODUCT_NAME := cm_m7
+PRODUCT_BRAND := htc
+PRODUCT_MODEL := m7
+PRODUCT_MANUFACTURER := htc
diff --git a/device_m7.mk b/device_m7.mk
new file mode 100644
index 0000000..83ca72e
--- /dev/null
+++ b/device_m7.mk
@@ -0,0 +1,28 @@
+$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
+
+# The gps config appropriate for this device
+$(call inherit-product, device/common/gps/gps_us_supl.mk)
+
+$(call inherit-product-if-exists, vendor/htc/m7/m7-vendor.mk)
+
+DEVICE_PACKAGE_OVERLAYS += device/htc/m7/overlay
+
+LOCAL_PATH := device/htc/m7
+ifeq ($(TARGET_PREBUILT_KERNEL),)
+	LOCAL_KERNEL := $(LOCAL_PATH)/kernel
+else
+	LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
+endif
+
+PRODUCT_COPY_FILES += \
+    $(LOCAL_KERNEL):kernel \
+    $(LOCAL_PATH)/recovery/sbin/choice_fn:recovery/root/sbin/choice_fn \
+    $(LOCAL_PATH)/recovery/sbin/offmode_charging:recovery/root/sbin/offmode_charging \
+    $(LOCAL_PATH)/recovery/sbin/detect_key:recovery/root/sbin/detect_key \
+    $(LOCAL_PATH)/recovery/sbin/power_test:recovery/root/sbin/power_test
+
+$(call inherit-product, build/target/product/full.mk)
+
+PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
+PRODUCT_NAME := full_m7
+PRODUCT_DEVICE := m7
diff --git a/kernel b/kernel
new file mode 100644
index 0000000..d5fa7a4
--- /dev/null
+++ b/kernel
Binary files differ
diff --git a/recovery.fstab b/recovery.fstab
new file mode 100644
index 0000000..c4e0da5
--- /dev/null
+++ b/recovery.fstab
@@ -0,0 +1,38 @@
+# Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of Code Aurora Forum, Inc. nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# mount point	fstype		device			[device2]
+
+/boot		emmc		boot
+/cache		ext4		cache
+/data		ext4		userdata
+/misc		emmc		misc
+/recovery	emmc		recovery
+/sdcard		datamedia	/dev/null
+/system		ext4		system
+/devlog		ext4		devlog
+/reserve	vfat		reserve
diff --git a/recovery/init.rc b/recovery/init.rc
new file mode 100644
index 0000000..7e3dcc8
--- /dev/null
+++ b/recovery/init.rc
@@ -0,0 +1,72 @@
+on early-init
+    start ueventd
+
+on init
+    export PATH /sbin
+    export ANDROID_ROOT /system
+    export ANDROID_DATA /data
+    export EXTERNAL_STORAGE /sdcard
+
+    symlink /system/etc /etc
+    chmod 0755 /sbin/busybox
+
+    mkdir /sdcard
+    mkdir /system
+    mkdir /data
+    mkdir /cache
+    mount /tmp /tmp tmpfs
+
+    chown root shell /tmp
+    chmod 0775 /tmp
+
+    write /sys/class/android_usb/android0/enable 0
+    write /sys/class/android_usb/android0/idVendor 18D1
+    write /sys/class/android_usb/android0/idProduct D001
+    write /sys/class/android_usb/android0/functions adb
+    write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
+    write /sys/class/android_usb/android0/iProduct ${ro.product.model}
+    write /sys/class/android_usb/android0/iSerial ${ro.serialno}
+
+
+on boot
+
+    ifup lo
+    hostname localhost
+    domainname localdomain
+
+    class_start default
+
+service choice_fn /sbin/choice_fn
+    oneshot
+
+service ueventd /sbin/ueventd
+    critical
+
+service recovery /sbin/recovery
+    disabled
+
+service adbd /sbin/adbd recovery
+    disabled
+
+service detect_key /sbin/detect_key
+    disabled
+    oneshot
+
+service offmode_charging /sbin/offmode_charging
+    disabled
+
+service power_test /sbin/power_test
+    disabled
+    oneshot
+
+# Always start adbd on userdebug and eng builds
+on property:ro.debuggable=1
+    #write /sys/class/android_usb/android0/enable 1
+    #start adbd
+    setprop service.adb.root 1
+
+# Restart adbd so it can run as root
+on property:service.adb.root=1
+    write /sys/class/android_usb/android0/enable 0
+    restart adbd
+    write /sys/class/android_usb/android0/enable 1
diff --git a/recovery/sbin/choice_fn b/recovery/sbin/choice_fn
new file mode 100644
index 0000000..1b54d8f
--- /dev/null
+++ b/recovery/sbin/choice_fn
Binary files differ
diff --git a/recovery/sbin/detect_key b/recovery/sbin/detect_key
new file mode 100644
index 0000000..c1edeee
--- /dev/null
+++ b/recovery/sbin/detect_key
Binary files differ
diff --git a/recovery/sbin/offmode_charging b/recovery/sbin/offmode_charging
new file mode 100644
index 0000000..4fb7d41
--- /dev/null
+++ b/recovery/sbin/offmode_charging
Binary files differ
diff --git a/recovery/sbin/power_test b/recovery/sbin/power_test
new file mode 100644
index 0000000..e0bbf38
--- /dev/null
+++ b/recovery/sbin/power_test
Binary files differ
diff --git a/system.prop b/system.prop
new file mode 100644
index 0000000..cf262f3
--- /dev/null
+++ b/system.prop
@@ -0,0 +1,187 @@
+#
+# system.prop for m7
+#
+
+rild.libpath=/system/lib/libril-qc-qmi-1.so
+rild.libargs=-d /dev/smd0
+persist.rild.nitz_plmn=
+persist.rild.nitz_long_ons_0=
+persist.rild.nitz_long_ons_1=
+persist.rild.nitz_long_ons_2=
+persist.rild.nitz_long_ons_3=
+persist.rild.nitz_short_ons_0=
+persist.rild.nitz_short_ons_1=
+persist.rild.nitz_short_ons_2=
+persist.rild.nitz_short_ons_3=
+ril.subscription.types=NV,RUIM
+DEVICE_PROVISIONED=1
+
+#
+#system props for display
+#
+debug.sf.hw=1
+debug.egl.hw=1
+debug.composition.type=gpu
+debug.enabletr=true
+ro.hwui.renderer.disable_opaque=true
+ro.sf.lcd_density=480
+debug.mdpcomp.maxlayer=3
+debug.egl.buffcount=4
+
+dalvik.vm.heapsize=384m
+dalvik.vm.heapgrowthlimit=192m
+dev.pm.dyn_samplingrate=1
+
+#
+# system props for the cne module
+#
+persist.cne.UseCne=vendor
+persist.cne.UseSwim=false
+persist.cne.bat.range.low.med=30
+persist.cne.bat.range.med.high=60
+persist.cne.loc.policy.op=/system/etc/OperatorPolicy.xml
+persist.cne.loc.policy.user=/system/etc/UserPolicy.xml
+persist.cne.bwbased.rat.sel=false
+persist.cne.snsr.based.rat.mgt=false
+persist.cne.bat.based.rat.mgt=false
+persist.cne.rat.acq.time.out=30000
+persist.cne.rat.acq.retry.tout=0
+persist.cne.sync.swim.mode=false
+
+ro.hdmi.enable=true
+lpa.decode=true
+tunnel.decode=true
+lpa.use-stagefright=true
+lpa.releaselock=true
+
+#system props for the MM modules
+
+media.stagefright.enable-player=true
+media.stagefright.enable-http=true
+media.stagefright.enable-aac=true
+media.stagefright.enable-qcp=true
+media.stagefright.enable-fma2dp=true
+media.stagefright.enable-scan=true
+mmp.enable.3g2=true
+
+#
+# system props for the data modules
+#
+ro.use_data_netmgrd=true
+
+#system props for time-services
+persist.timed.enable=true
+
+# System props for audio
+persist.audio.fluence.mode=endfire
+persist.audio.vr.enable=false
+persist.audio.handset.mic=digital
+# System props for soundhound
+persist.htc.audio.pcm.samplerate=48000
+persist.htc.audio.pcm.channels=2
+
+# System prop to select audio resampler quality
+af.resampler.quality=255
+
+# System props for global effect
+htc.audio.global.state=0
+htc.audio.global.profile=0
+htc.audio.q6.topology=0
+htc.audio.global.speaker=1
+
+#
+# system prop for opengles version
+#
+# 131072 is decimal for 0x20000 to report version 2
+ro.opengles.version=131072
+
+#system prop for switching gps driver to qmi
+persist.gps.qmienabled=true
+
+# System property for cabl
+ro.qualcomm.cabl=0
+
+#
+# System prop for sending transmit power request to RIL during WiFi hotspot on/off
+#
+ro.ril.transmitpower=true
+
+# For workaround for ro.baseband property. QCT use the property same as radio version to determine the architecture.
+# But we hard code to mdm for M7.
+ro.baseband.arch = mdm
+
+#Add default network type for phone reference
+ro.telephony.default_network=9
+
+#
+#Simulate sdcard on /data/media
+#
+persist.fuse_sdcard=true
+
+# M7 Hardware Info
+ro.product.bluetooth=4.0
+ro.product.display_resolution = 4.7 inch 1080p resolution
+ro.product.main_camera = 4M
+ro.product.front_camera = 2.1M
+ro.product.processor = Quadcore
+ro.product.ram = 2GB
+ro.product.wifi = 802.11 a/b/g/n
+
+
+#wifi
+wifi.interface=wlan0
+wifi.supplicant_scan_interval=15
+wifi.softap.interface=wlan0
+wifi.softapconcurrent.interface=wl0.1
+persist.wifi.v6=true
+persist.wifi.v6.rs.count=5
+persist.wifi.v6.rs.timeout=5
+
+# Properties of BTLA stack
+service.brcm.bt.activation = 0
+service.brcm.bt.srv_active = 0
+service.brcm.bt.hcid_active = 0
+service.brcm.bt.btld = 0
+service.brcm.bt.btld_pid = 0
+service.brcm.bt.avrcp_pass_thru = 0
+service.brcm.bt.avrcp_toggle = 1
+service.brcm.bt.local_name =
+service.brcm.bt.4335hwerrwar = 1
+service.brcm.bt.TRC_HTCSDBG = 1
+
+# Support HW reset
+ro.product.hwreset = 1
+ro.product.hwreset.timer1 = 8
+ro.product.hwreset.timer2 = 11
+
+#For usb storage
+ro.usb_host = 1
+
+# Preloading common control assets
+persist.preload.common=1
+
+# Force Enable HWacce for GB PlayStoreAP
+persist.sys.htc.ui.hw = 1
+
+# Perflock for inter-process activity launch and first launch
+persist.htc.multicore.timeout = 1500
+
+# Perflock for Home process lock duration
+persist.htc.multicore.home = 800
+
+#
+# ADDITIONAL_BUILD_PROPERTIES
+#
+ro.carrier=unknown
+ro.config.notification_sound=OnTheHunt.ogg
+ro.config.alarm_alert=Alarm_Classic.ogg
+drm.service.enabled=true
+ro.setupwizard.mode=OPTIONAL
+ro.com.google.gmsversion=4.1_r4
+lpa.decode=false
+tunnel.decode=false
+ro.service.dpsvr.enabled=true
+ro.vendor.extension_library=/system/lib/libqc-opt.so
+dalvik.vm.lockprof.threshold=500
+net.bt.name=Android
+dalvik.vm.stack-trace-file=/data/anr/traces.txt