[Nexus 6  General] Scott:
Congrats on building but you need to make some edits to make the ROM more "useable"

Note: Attached is a complete diff from pure AOSP to the changes made / noted in this post.

With AOSP defaults you to

Reload the stock recovery on boot

Doesn't utilize all Google Location services (all the way?)

Browser settings crash

Cant Play Youtube or Netflix, etc.

The following is a list of code changes to negate all that. Ignore the Flo and Deb specific files mentioned in there as I also build for those devices too! This is sorta hard to read but once you get it the first time it will make sense. Feel free to ask questions on how to read! I have attached a copy of the "ota_from_target_files" as it is modified in this guide.

My Changes

project build/
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index 755e5c2..620f5c6 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -522,8 +522,8 @@ def WriteFullOTAPackage(input_zip, output_zip):
# set up system to update recovery partition on first boot
# complete script normally (allow recovery to mark itself finished and reboot)

- recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
- OPTIONS.input_tmp, "RECOVERY")
+# recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
+# OPTIONS.input_tmp, "RECOVERY")
if OPTIONS.two_step:
if not OPTIONS.info_dict.get("multistage_support", None):
assert False, "two-step packages not supported by this build"
@@ -582,11 +582,11 @@ else if get_stage("%(bcb_dev)s") == "3/3" then

if not block_based:
def output_sink(fn, data):
- common.ZipWriteStr(output_zip, "recovery/" + fn, data)
+# common.ZipWriteStr(output_zip, "recovery/" + fn, data)
system_items.Get("system/" + fn, dir=False)

- common.MakeRecoveryPatch(OPTIONS.input_tmp, output_sink,
- recovery_img, boot_img)
+# common.MakeRecoveryPatch(OPTIONS.input_tmp, output_sink,
+# recovery_img, boot_img)

system_items.GetMetadata(input_zip)
system_items.Get("system").SetPermissions(script)
@@ -730,12 +730,12 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
updating_boot = (not OPTIONS.two_step and
(source_boot.data != target_boot.data))

- source_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY",
- OPTIONS.source_info_dict)
- target_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
- updating_recovery = (source_recovery.data != target_recovery.data)
+# source_recovery = common.GetBootableImage(
+# "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY",
+# OPTIONS.source_info_dict)
+# target_recovery = common.GetBootableImage(
+# "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
+# updating_recovery = (source_recovery.data != target_recovery.data)

system_src = GetImage("system", OPTIONS.source_tmp, OPTIONS.source_info_dict)
system_tgt = GetImage("system", OPTIONS.target_tmp, OPTIONS.target_info_dict)
@@ -1104,12 +1104,12 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
updating_boot = (not OPTIONS.two_step and
(source_boot.data != target_boot.data))

- source_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY",
- OPTIONS.source_info_dict)
- target_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
- updating_recovery = (source_recovery.data != target_recovery.data)
+# source_recovery = common.GetBootableImage(
+# "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY",
+# OPTIONS.source_info_dict)
+# target_recovery = common.GetBootableImage(
+# "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
+# updating_recovery = (source_recovery.data != target_recovery.data)

# Here's how we divide up the progress bar:
# 0.1 for verifying the start state (PatchCheck calls)
@@ -1313,9 +1313,9 @@ else
script.Print("Unpacking new vendor files...")
script.UnpackPackageDir("vendor", "/vendor")

- if updating_recovery and not target_has_recovery_patch:
- script.Print("Unpacking new recovery...")
- script.UnpackPackageDir("recovery", "/system")
+# if updating_recovery and not target_has_recovery_patch:
+# script.Print("Unpacking new recovery...")
+# script.UnpackPackageDir("recovery", "/system")

system_diff.EmitRenames(script)
if vendor_diff:

project device/asus/flo/
diff --git a/aosp_flo.mk b/aosp_flo.mk
index 6f1ad0c..c1c99fb 100644
--- a/aosp_flo.mk
+++ b/aosp_flo.mk
@@ -24,7 +24,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
PRODUCT_NAME := aosp_flo
PRODUCT_DEVICE := flo
PRODUCT_BRAND := Android
-PRODUCT_MODEL := AOSP on Flo
+PRODUCT_MODEL := Nexus 7
PRODUCT_MANUFACTURER := ASUS
PRODUCT_RESTRICT_VENDOR_FILES := true

diff --git a/system.prop b/system.prop
index 937fbb7..dc3a07f 100644
--- a/system.prop
+++ b/system.prop
@@ -3,3 +3,4 @@
#LTE, GSM, WCDMA(9)
#
ro.telephony.default_network=9
+persist.sys.usb.config=mtp,adb

project device/moto/shamu/
diff --git a/aosp_shamu.mk b/aosp_shamu.mk
index e5fa301..ef53d06 100644
--- a/aosp_shamu.mk
+++ b/aosp_shamu.mk
@@ -26,7 +26,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
PRODUCT_NAME := aosp_shamu
PRODUCT_DEVICE := shamu
PRODUCT_BRAND := Android
-PRODUCT_MODEL := AOSP on Shamu
+PRODUCT_MODEL := Nexus 6
PRODUCT_MANUFACTURER := motorola
PRODUCT_RESTRICT_VENDOR_FILES := true

project frameworks/base/
diff --git a/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg b/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg
index 03a14c0..9ab8944 100644
Binary files a/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg and b/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg differ
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 8006659..cfd55b1 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -946,6 +946,7 @@
-->
<string-array name="config_locationProviderPackageNames" translatable="false">
<!-- The standard AOSP fused location provider -->
+ <item>com.google.android.gms</item>
<item>com.android.location.fused</item>
</string-array>

project packages/apps/Browser/
diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/browser/BrowserPreferencesPage.java
index 6e6da17..cd91f11 100644
--- a/src/com/android/browser/BrowserPreferencesPage.java
+++ b/src/com/android/browser/BrowserPreferencesPage.java
@@ -43,6 +43,12 @@ public class BrowserPreferencesPage extends PreferenceActivity {
}
}

+ @Override
+ protected boolean isValidFragment(String fragmentName) {
+ return true;
+ }
+
+
/**
* Populate the activity with the top-level headers.
*/
@@ -82,8 +88,7 @@ public class BrowserPreferencesPage extends PreferenceActivity {
} else {
finish();
}
- return true;
- }
+ return true; }

return false;
}
@@ -98,4 +103,5 @@ public class BrowserPreferencesPage extends PreferenceActivity {
return intent;
}

+
}

project system/core/
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 8ba7c10..e5120f1 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -594,9 +594,8 @@ service installd /system/bin/installd
class main
socket installd stream 600 system system

-service flash_recovery /system/bin/install-recovery.sh
+service flash_recovery /system/etc/install-recovery.sh
class main
- seclabel u:r:install_recovery:s0
oneshot

service racoon /system/bin/racoon

Now to fix Youtube and Netflix, etc...

You will need to add the following changes from Ayysir's git hub Here: Add QCOM targert-specific cong & helper macros