Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe3a08df authored by Kornel Dulęba's avatar Kornel Dulęba
Browse files

Support ADB product keys purging with a dedicated flag

Instead of checking the build variant look for the value of a dedicated
flag to decide if we need to do the purging. The value of
RELEASE_BUILD_PURGE_PRODUCT_ADB_KEYS is set to true on user and false on
userdebug/eng across all releases. Because of that this patch does not
bring any functional changes.

BUG: b/373580227
Test: Add $(warning foo) to the conditional block. Verify that the output
      of lunch husky-${aosp_current,trunk_staging}-{user,userdebug,eng}
      is as expected.

Change-Id: Ice6042025e9d2767e3eee158960eaab46f9b7fd4
parent 72d493ce
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -468,10 +468,17 @@ $(foreach c,$(PRODUCT_SANITIZER_MODULE_CONFIGS),\
    $(eval SANITIZER.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
_psmc_modules :=

# Reset ADB keys for non-debuggable builds
ifeq (,$(filter eng userdebug,$(TARGET_BUILD_VARIANT)))
# Reset ADB keys. If RELEASE_BUILD_USE_VARIANT_FLAGS is set look for
# the value of a dedicated flag. Otherwise check if build variant is
# non-debuggable.
ifneq (,$(RELEASE_BUILD_USE_VARIANT_FLAGS))
ifneq (,$(RELEASE_BUILD_PURGE_PRODUCT_ADB_KEYS))
  PRODUCT_ADB_KEYS :=
endif
else ifeq (,$(filter eng userdebug,$(TARGET_BUILD_VARIANT)))
  PRODUCT_ADB_KEYS :=
endif

ifneq ($(filter-out 0 1,$(words $(PRODUCT_ADB_KEYS))),)
  $(error Only one file may be in PRODUCT_ADB_KEYS: $(PRODUCT_ADB_KEYS))
endif