Merge "bliss: Cleanup vendor" into q10
diff --git a/build/soong/android/variable.go b/build/soong/android/variable.go
index a8b0ee7..32fc6b5 100644
--- a/build/soong/android/variable.go
+++ b/build/soong/android/variable.go
@@ -14,7 +14,7 @@
 		Overrides []string
 		Shared_libs []string
 	}
-	Should_skip_waiting_for_qsee struct {
+	Should_wait_for_qsee struct {
 		Cflags []string
 	}
 	Supports_hw_fde struct {
@@ -25,9 +25,6 @@
 	Supports_hw_fde_perf struct {
 		Cflags []string
 	}
-	Supports_legacy_hw_fde struct {
-		Cflags []string
-	}
 	Target_init_vendor_lib struct {
 		Whole_static_libs []string
 	}
@@ -50,26 +47,6 @@
 		Cppflags []string
 		Shared_libs []string
 	}
-	Uses_qcom_um_family struct {
-		Cflags []string
-		Srcs []string
-	}
-	Uses_qcom_um_3_18_family struct {
-		Header_libs []string
-		Shared_libs []string
-	}
-	Uses_qcom_um_4_4_family struct {
-		Header_libs []string
-		Shared_libs []string
-	}
-	Uses_qcom_um_4_9_family struct {
-		Header_libs []string
-		Shared_libs []string
-	}
-	Uses_qcom_um_4_14_family struct {
-		Header_libs []string
-		Shared_libs []string
-	}
 }
 
 type ProductVariables struct {
@@ -77,11 +54,10 @@
 	Apply_msm8974_1440p_egl_workaround  *bool `json:",omitempty"`
 	Bootloader_message_offset  *int `json:",omitempty"`
 	Has_legacy_camera_hal1  *bool `json:",omitempty"`
-	Should_skip_waiting_for_qsee  *bool `json:",omitempty"`
+	Should_wait_for_qsee  *bool `json:",omitempty"`
 	Specific_camera_parameter_library  *string `json:",omitempty"`
 	Supports_hw_fde  *bool `json:",omitempty"`
 	Supports_hw_fde_perf  *bool `json:",omitempty"`
-	Supports_legacy_hw_fde  *bool `json:",omitempty"`
 	Target_init_vendor_lib  *string `json:",omitempty"`
 	Target_process_sdk_version_override  *string `json:",omitempty"`
 	Target_shim_libs  *string `json:",omitempty"`
@@ -89,9 +65,4 @@
 	Uses_nvidia_enhancements  *bool `json:",omitempty"`
 	Uses_qcom_bsp_legacy  *bool `json:",omitempty"`
 	Uses_qti_camera_device  *bool `json:",omitempty"`
-	Uses_qcom_um_family  *bool `json:",omitempty"`
-	Uses_qcom_um_3_18_family  *bool `json:",omitempty"`
-	Uses_qcom_um_4_4_family  *bool `json:",omitempty"`
-	Uses_qcom_um_4_9_family  *bool `json:",omitempty"`
-	Uses_qcom_um_4_14_family  *bool `json:",omitempty"`
 }
diff --git a/build/soong/soong_config.mk b/build/soong/soong_config.mk
index 1e01a9a..1f022ec 100644
--- a/build/soong/soong_config.mk
+++ b/build/soong/soong_config.mk
@@ -8,11 +8,10 @@
 $(call add_json_bool, Apply_msm8974_1440p_egl_workaround, $(filter true,$(TARGET_MSM8974_1440P_EGL_WORKAROUND)))
 $(call add_json_val_default, Bootloader_message_offset, $(BOOTLOADER_MESSAGE_OFFSET), 0)
 $(call add_json_bool, Has_legacy_camera_hal1, $(filter true,$(TARGET_HAS_LEGACY_CAMERA_HAL1)))
-$(call add_json_bool, Should_skip_waiting_for_qsee, $(filter true,$(TARGET_KEYMASTER_SKIP_WAITING_FOR_QSEE)))
+$(call add_json_bool, Should_wait_for_qsee, $(filter true,$(TARGET_KEYMASTER_WAIT_FOR_QSEE)))
 $(call add_json_str, Specific_camera_parameter_library, $(TARGET_SPECIFIC_CAMERA_PARAMETER_LIBRARY))
 $(call add_json_bool, Supports_hw_fde, $(filter true,$(TARGET_HW_DISK_ENCRYPTION)))
 $(call add_json_bool, Supports_hw_fde_perf, $(filter true,$(TARGET_HW_DISK_ENCRYPTION_PERF)))
-$(call add_json_bool, Supports_legacy_hw_fde, $(filter true,$(TARGET_LEGACY_HW_DISK_ENCRYPTION)))
 $(call add_json_str_omitempty, Target_init_vendor_lib, $(TARGET_INIT_VENDOR_LIB))
 $(call add_json_str_omitempty, Target_process_sdk_version_override, $(TARGET_PROCESS_SDK_VERSION_OVERRIDE))
 $(call add_json_str_omitempty, Target_shim_libs, $(subst $(space),:,$(TARGET_LD_SHIM_LIBS)))
@@ -20,11 +19,6 @@
 $(call add_json_bool, Uses_nvidia_enhancements, $(filter TRUE,$(NV_ANDROID_FRAMEWORK_ENHANCEMENTS)))
 $(call add_json_bool, Uses_qcom_bsp_legacy, $(filter true,$(TARGET_USES_QCOM_BSP_LEGACY)))
 $(call add_json_bool, Uses_qti_camera_device, $(filter true,$(TARGET_USES_QTI_CAMERA_DEVICE)))
-$(call add_json_bool, Uses_qcom_um_family, $(filter true,$(TARGET_USES_QCOM_UM_FAMILY)))
-$(call add_json_bool, Uses_qcom_um_3_18_family, $(filter true,$(TARGET_USES_QCOM_UM_3_18_FAMILY)))
-$(call add_json_bool, Uses_qcom_um_4_4_family, $(filter true,$(TARGET_USES_QCOM_UM_4_4_FAMILY)))
-$(call add_json_bool, Uses_qcom_um_4_9_family, $(filter true,$(TARGET_USES_QCOM_UM_4_9_FAMILY)))
-$(call add_json_bool, Uses_qcom_um_4_14_family, $(filter true,$(TARGET_USES_QCOM_UM_4_14_FAMILY)))
 
 # This causes the build system to strip out the last comma in our nested struct, to keep the JSON valid.
 _json_contents := $(_json_contents)__SV_END
diff --git a/build/tools/repopick.py b/build/tools/repopick.py
index dd6bb2c..bf27d1d 100755
--- a/build/tools/repopick.py
+++ b/build/tools/repopick.py
@@ -366,6 +366,10 @@
             project_path = project_name_to_data[item['project']][item['branch']]
         elif args.path:
             project_path = args.path
+        elif item['project'] in project_name_to_data and len(project_name_to_data[item['project']]) == 1:
+            local_branch = list(project_name_to_data[item['project']])[0]
+            project_path = project_name_to_data[item['project']][local_branch]
+            print('WARNING: Project {0} has a different branch ("{1}" != "{2}")'.format(project_path, local_branch, item['branch']))
         elif args.ignore_missing:
             print('WARNING: Skipping {0} since there is no project directory for: {1}\n'.format(item['id'], item['project']))
             continue
diff --git a/config/BoardConfigQcom.mk b/config/BoardConfigQcom.mk
index 85fe011..e531046 100644
--- a/config/BoardConfigQcom.mk
+++ b/config/BoardConfigQcom.mk
@@ -48,6 +48,8 @@
 
 # Mark GRALLOC_USAGE_PRIVATE_WFD as valid gralloc bits
 TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS ?= 0
+TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS += | (1 << 10)
+TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS += | (1 << 13)
 TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS += | (1 << 21)
 
 # Mark GRALLOC_USAGE_PRIVATE_10BIT_TP as valid gralloc bits on UM platforms that support it
@@ -70,23 +72,15 @@
 else ifneq ($(filter $(UM_3_18_FAMILY),$(TARGET_BOARD_PLATFORM)),)
     MSM_VIDC_TARGET_LIST := $(UM_3_18_FAMILY)
     QCOM_HARDWARE_VARIANT := msm8996
-    TARGET_USES_QCOM_UM_FAMILY := true
-    TARGET_USES_QCOM_UM_3_18_FAMILY := true
 else ifneq ($(filter $(UM_4_4_FAMILY),$(TARGET_BOARD_PLATFORM)),)
     MSM_VIDC_TARGET_LIST := $(UM_4_4_FAMILY)
     QCOM_HARDWARE_VARIANT := msm8998
-    TARGET_USES_QCOM_UM_FAMILY := true
-    TARGET_USES_QCOM_UM_4_4_FAMILY := true
 else ifneq ($(filter $(UM_4_9_FAMILY),$(TARGET_BOARD_PLATFORM)),)
     MSM_VIDC_TARGET_LIST := $(UM_4_9_FAMILY)
     QCOM_HARDWARE_VARIANT := sdm845
-    TARGET_USES_QCOM_UM_FAMILY := true
-    TARGET_USES_QCOM_UM_4_9_FAMILY := true
 else ifneq ($(filter $(UM_4_14_FAMILY),$(TARGET_BOARD_PLATFORM)),)
     MSM_VIDC_TARGET_LIST := $(UM_4_14_FAMILY)
     QCOM_HARDWARE_VARIANT := sm8150
-    TARGET_USES_QCOM_UM_FAMILY := true
-    TARGET_USES_QCOM_UM_4_14_FAMILY := true
 else
     MSM_VIDC_TARGET_LIST := $(TARGET_BOARD_PLATFORM)
     QCOM_HARDWARE_VARIANT := $(TARGET_BOARD_PLATFORM)
diff --git a/config/common.mk b/config/common.mk
index 8b23bfc..148b96b 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -72,6 +72,10 @@
 PRODUCT_COPY_FILES += \
     vendor/bliss/prebuilt/common/lib/content-types.properties:$(TARGET_COPY_OUT_SYSTEM)/lib/content-types.properties
 
+# Enable Android Beam on all targets
+PRODUCT_COPY_FILES += \
+    vendor/bliss/config/permissions/android.software.nfc.beam.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.software.nfc.beam.xml
+
 # Enable SIP+VoIP on all targets
 PRODUCT_COPY_FILES += \
     frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.software.sip.voip.xml
@@ -164,5 +168,8 @@
 # Misc Packages
 -include vendor/bliss/config/misc_packages.mk
 
+# Themes and Overlays
+-include vendor/themes/bliss_themes.mk
+
 -include $(WORKSPACE)/build_env/image-auto-bits.mk
 -include vendor/bliss/config/partner_gms.mk
diff --git a/overlay/common/packages/apps/Trebuchet/res/values/config.xml b/config/permissions/android.software.nfc.beam.xml
similarity index 71%
rename from overlay/common/packages/apps/Trebuchet/res/values/config.xml
rename to config/permissions/android.software.nfc.beam.xml
index ba160ae..c88f8b5 100644
--- a/overlay/common/packages/apps/Trebuchet/res/values/config.xml
+++ b/config/permissions/android.software.nfc.beam.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2013 The Android Open Source Project
+<!-- Copyright (C) 2019 The LineageOS Project
 
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
@@ -13,10 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<resources>
 
-    <!-- Enable backups -->
-    <bool name="enable_backup">true</bool>
-    <string name="backup_api_key">AEdPqrEAAAAIDoOx_2qXwj5RZmKa0fpkv1aqEldrwBp-pnv6Sg</string>
-
-</resources>
+<permissions>
+    <feature name="android.sofware.nfc.beam" />
+</permissions>
diff --git a/config/permissions/lineage-power-whitelist.xml b/config/permissions/lineage-power-whitelist.xml
index 7569a5b..b6545ba 100644
--- a/config/permissions/lineage-power-whitelist.xml
+++ b/config/permissions/lineage-power-whitelist.xml
@@ -16,4 +16,5 @@
 
 <config>
     <allow-in-power-save package="com.android.deskclock" />
+    <allow-in-power-save package="com.android.messaging" />
 </config>
diff --git a/config/versions.mk b/config/versions.mk
index bc49e42..4a04c4c 100644
--- a/config/versions.mk
+++ b/config/versions.mk
@@ -1,8 +1,8 @@
 # Versioning System For Bliss
 # Bliss RELEASE VERSION
 BLISS_VERSION_MAJOR = 12
-BLISS_VERSION_MINOR = 0
-BLISS_VERSION_MAINTENANCE = Alpha
+BLISS_VERSION_MINOR = 1
+BLISS_VERSION_MAINTENANCE = Stable
 
 #ifdef BLISS_VERSION_MAINTENANCE
 #    VERSION := $(BLISS_VERSION_MAJOR).$(BLISS_VERSION_MINOR)-$(BLISS_VERSION_MAINTENANCE)
diff --git a/overlay/common/frameworks/base/packages/Keyguard/res/values/config.xml b/overlay/common/frameworks/base/packages/Keyguard/res/values/config.xml
deleted file mode 100644
index 1e69bda..0000000
--- a/overlay/common/frameworks/base/packages/Keyguard/res/values/config.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2013 The CyanogenMod Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- default to disabling the menu key. The Lineage setting to
-         do this is a no-op unless the below item is true -->
-    <bool name="config_disableMenuKeyInLockScreen">true</bool>
-
-    <!-- config for showing AM/PM on lock screen in 12hour format -->
-    <bool name="config_showAmpm">false</bool>
-</resources>
diff --git a/overlay/common/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/common/frameworks/base/packages/SystemUI/res/values/config.xml
index 6b8f590..95e8df8 100644
--- a/overlay/common/frameworks/base/packages/SystemUI/res/values/config.xml
+++ b/overlay/common/frameworks/base/packages/SystemUI/res/values/config.xml
@@ -22,9 +22,6 @@
          from UMTS data icon on devices -->
     <bool name="config_hspa_data_distinguishable">true</bool>
 
-    <!-- Should "4G" be shown instead of "LTE" when the network is NETWORK_TYPE_LTE? -->
-    <bool name="config_show4GForLTE">false</bool>
-
     <bool name="quick_settings_show_full_alarm">true</bool>
 
     <!-- If true, enable the advance anti-falsing classifier on the lockscreen. On some devices it
diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh
index 73f1f6e..1b6c2f9 100755
--- a/prebuilt/common/bin/backuptool.sh
+++ b/prebuilt/common/bin/backuptool.sh
@@ -48,7 +48,7 @@
 if [ ! -r $S/build.prop ]; then
     return 0
 fi
-if ! grep -q "^ro.lineage.version=$V.*" $S/build.prop; then
+if ! grep -q "^ro.bliss.version=$V.*" $S/build.prop; then
   echo "Not backing up files from incompatible version: $V"
   return 0
 fi
diff --git a/prebuilt/common/bin/backuptool_ab.sh b/prebuilt/common/bin/backuptool_ab.sh
index 157110f..dde4bbd 100755
--- a/prebuilt/common/bin/backuptool_ab.sh
+++ b/prebuilt/common/bin/backuptool_ab.sh
@@ -50,7 +50,7 @@
     return 0
 fi
 
-grep -q "^ro.lineage.version=$V.*" /system/build.prop && return 1
+grep -q "^ro.bliss.version=$V.*" /system/build.prop && return 1
 
 echo "Not backing up files from incompatible version: $V"
 return 0