Merge "Revert "Default to building with OpenJDK 9 -target 1.8.""
diff --git a/core/Makefile b/core/Makefile
index 2ff5acc..3c2a4ec 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1132,9 +1132,10 @@
 recovery_sepolicy := \
     $(TARGET_RECOVERY_ROOT_OUT)/sepolicy \
     $(TARGET_RECOVERY_ROOT_OUT)/plat_file_contexts \
-    $(TARGET_RECOVERY_ROOT_OUT)/nonplat_file_contexts \
+    $(TARGET_RECOVERY_ROOT_OUT)/vendor_file_contexts \
     $(TARGET_RECOVERY_ROOT_OUT)/plat_property_contexts \
-    $(TARGET_RECOVERY_ROOT_OUT)/nonplat_property_contexts
+    $(TARGET_RECOVERY_ROOT_OUT)/vendor_property_contexts
+
 # Passed into rsync from non-recovery root to recovery root, to avoid overwriting recovery-specific
 # SELinux files
 IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(recovery_sepolicy))
diff --git a/core/install_jni_libs.mk b/core/install_jni_libs.mk
index 6b550c1..625a8a2 100644
--- a/core/install_jni_libs.mk
+++ b/core/install_jni_libs.mk
@@ -18,19 +18,9 @@
 ifneq ($(filter tests samples, $(LOCAL_MODULE_TAGS)),)
 my_embed_jni := true
 endif
-ifeq ($(PRODUCT_FULL_TREBLE),true)
-  ifeq ($(filter $(TARGET_OUT)/%, $(my_module_path)),)
-    # If this app isn't to be installed to the system partition, and the device
-    # is fully treble-ized then jni libs are embedded, Otherwise, access to the
-    # directory where the lib is installed to (usually /vendor/lib) needs to be
-    # allowed for system processes, which is a Treble violation.
-    my_embed_jni := true
-  endif
-else
-  ifeq ($(filter $(TARGET_OUT)/% $(TARGET_OUT_VENDOR)/% $(TARGET_OUT_OEM)/%, $(my_module_path)),)
-    # If this app isn't to be installed to system, vendor, or oem partitions.
-    my_embed_jni := true
-  endif
+ifeq ($(filter $(TARGET_OUT)/% $(TARGET_OUT_VENDOR)/% $(TARGET_OUT_OEM)/%, $(my_module_path)),)
+# If this app isn't to be installed to system partitions.
+my_embed_jni := true
 endif
 
 jni_shared_libraries :=
diff --git a/core/tasks/vndk.mk b/core/tasks/vndk.mk
index a3ec16a..962fae1 100644
--- a/core/tasks/vndk.mk
+++ b/core/tasks/vndk.mk
@@ -162,7 +162,7 @@
 	$(call private-copy-vndk-intermediates, \
 		$(PRIVATE_VNDK_CORE_OUT),$(PRIVATE_VNDK_CORE_INTERMEDIATES))
 	$(call private-copy-vndk-intermediates, \
-	 	$(PRIVATE_VNDK_SP_OUT),$(PRIVATE_VNDK_SP_INTERMEDIATES))
+		$(PRIVATE_VNDK_SP_OUT),$(PRIVATE_VNDK_SP_INTERMEDIATES))
 	$(call private-copy-vndk-intermediates, \
 		$(PRIVATE_CONFIGS_OUT),$(PRIVATE_CONFIGS_INTERMEDIATES))
 # TODO(b/69834489): Package additional arch variants
@@ -172,8 +172,7 @@
 # 	$(call private-copy-vndk-intermediates, \
 # 		$(PRIVATE_VNDK_SP_OUT_2ND),$(PRIVATE_VNDK_SP_INTERMEDIATES_2ND))
 # endif
-	$(hide) $(SOONG_ZIP) -o $@ -P android-vndk-snapshot -C $(PRIVATE_VNDK_SNAPSHOT_OUT) \
-	-D $(PRIVATE_VNDK_SNAPSHOT_OUT)
+	$(hide) $(SOONG_ZIP) -o $@ -C $(PRIVATE_VNDK_SNAPSHOT_OUT) -D $(PRIVATE_VNDK_SNAPSHOT_OUT)
 
 .PHONY: vndk
 vndk: $(vndk_snapshot_zip)
diff --git a/target/board/generic/sepolicy/goldfish_setup.te b/target/board/generic/sepolicy/goldfish_setup.te
index bcd49bd..eb913e9 100644
--- a/target/board/generic/sepolicy/goldfish_setup.te
+++ b/target/board/generic/sepolicy/goldfish_setup.te
@@ -4,6 +4,7 @@
 
 init_daemon_domain(goldfish_setup)
 
+set_prop(goldfish_setup, debug_prop);
 allow goldfish_setup self:capability { net_admin net_raw };
 allow goldfish_setup self:udp_socket { create ioctl };
 allow goldfish_setup vendor_toolbox_exec:file execute_no_trans;
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index a882685..e295760 100755
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -45,18 +45,13 @@
 
 from __future__ import print_function
 
-import sys
-
-if sys.hexversion < 0x02070000:
-  print("Python 2.7 or newer is required.", file=sys.stderr)
-  sys.exit(1)
-
 import datetime
 import hashlib
 import os
 import shlex
 import shutil
 import subprocess
+import sys
 import tempfile
 import uuid
 import zipfile
@@ -66,6 +61,10 @@
 import rangelib
 import sparse_img
 
+if sys.hexversion < 0x02070000:
+  print("Python 2.7 or newer is required.", file=sys.stderr)
+  sys.exit(1)
+
 OPTIONS = common.OPTIONS
 
 OPTIONS.add_missing = False
@@ -388,9 +387,9 @@
         if os.path.exists(image_path):
           continue
         found = False
-        for dir in ['IMAGES', 'RADIO', 'VENDOR_IMAGES', 'PREBUILT_IMAGES']:
+        for dir_name in ['IMAGES', 'RADIO', 'VENDOR_IMAGES', 'PREBUILT_IMAGES']:
           alt_path = os.path.join(
-              OPTIONS.input_tmp, dir, os.path.basename(image_path))
+              OPTIONS.input_tmp, dir_name, os.path.basename(image_path))
           if os.path.exists(alt_path):
             split_args[index + 1] = alt_path
             found = True
@@ -657,8 +656,6 @@
         continue
 
       img_radio_path = os.path.join(OPTIONS.input_tmp, "RADIO", img_name)
-      img_vendor_dir = os.path.join(
-        OPTIONS.input_tmp, "VENDOR_IMAGES")
       if os.path.exists(img_radio_path):
         if output_zip:
           common.ZipWrite(output_zip, img_radio_path,
@@ -666,11 +663,12 @@
         else:
           shutil.copy(img_radio_path, prebuilt_path)
       else:
+        img_vendor_dir = os.path.join(OPTIONS.input_tmp, "VENDOR_IMAGES")
         for root, _, files in os.walk(img_vendor_dir):
           if img_name in files:
             if output_zip:
               common.ZipWrite(output_zip, os.path.join(root, img_name),
-                os.path.join("IMAGES", img_name))
+                              os.path.join("IMAGES", img_name))
             else:
               shutil.copy(os.path.join(root, img_name), prebuilt_path)
             break
diff --git a/tools/releasetools/pylintrc b/tools/releasetools/pylintrc
index 90de1af..7b3405c 100644
--- a/tools/releasetools/pylintrc
+++ b/tools/releasetools/pylintrc
@@ -144,9 +144,6 @@
 
 [BASIC]
 
-# Required attributes for module, separated by a comma
-required-attributes=
-
 # List of builtins function names that should not be used, separated by a comma
 bad-functions=map,filter,input
 
@@ -357,10 +354,6 @@
 
 [CLASSES]
 
-# List of interface methods to ignore, separated by a comma. This is used for
-# instance to not check methods defines in Zope's Interface base class.
-ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
-
 # List of method names used to declare (i.e. assign) instance attributes.
 defining-attr-methods=__init__,__new__,setUp