From 7777a4be12660aaf830ca133fd8afe61ba8cfbba Mon Sep 17 00:00:00 2001 From: Garfield Tan Date: Mon, 17 Jul 2023 14:57:01 -0700 Subject: [PATCH 1/2] Unmark executable bits from CAS AIDL HAL impl None of these files are executable. The .rc and .xml files shouldn't be installed to the device image as executables either. Bug: None Test: Files installed on the device aren't executables anymore. Change-Id: Id15ecc7febb56ea108155fcbd338efeb8885709a --- cas/aidl/default/Android.bp | 0 cas/aidl/default/CasImpl.cpp | 0 cas/aidl/default/CasImpl.h | 0 cas/aidl/default/DescramblerImpl.cpp | 0 cas/aidl/default/DescramblerImpl.h | 0 cas/aidl/default/FactoryLoader.h | 0 cas/aidl/default/MediaCasService.cpp | 0 cas/aidl/default/MediaCasService.h | 0 cas/aidl/default/SharedLibrary.cpp | 0 cas/aidl/default/SharedLibrary.h | 0 cas/aidl/default/TypeConvert.cpp | 0 cas/aidl/default/TypeConvert.h | 0 cas/aidl/default/android.hardware.cas-service.xml | 0 cas/aidl/default/cas-default-lazy.rc | 0 cas/aidl/default/cas-default.rc | 0 cas/aidl/default/fuzzer.cpp | 0 cas/aidl/default/service.cpp | 0 17 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 cas/aidl/default/Android.bp mode change 100755 => 100644 cas/aidl/default/CasImpl.cpp mode change 100755 => 100644 cas/aidl/default/CasImpl.h mode change 100755 => 100644 cas/aidl/default/DescramblerImpl.cpp mode change 100755 => 100644 cas/aidl/default/DescramblerImpl.h mode change 100755 => 100644 cas/aidl/default/FactoryLoader.h mode change 100755 => 100644 cas/aidl/default/MediaCasService.cpp mode change 100755 => 100644 cas/aidl/default/MediaCasService.h mode change 100755 => 100644 cas/aidl/default/SharedLibrary.cpp mode change 100755 => 100644 cas/aidl/default/SharedLibrary.h mode change 100755 => 100644 cas/aidl/default/TypeConvert.cpp mode change 100755 => 100644 cas/aidl/default/TypeConvert.h mode change 100755 => 100644 cas/aidl/default/android.hardware.cas-service.xml mode change 100755 => 100644 cas/aidl/default/cas-default-lazy.rc mode change 100755 => 100644 cas/aidl/default/cas-default.rc mode change 100755 => 100644 cas/aidl/default/fuzzer.cpp mode change 100755 => 100644 cas/aidl/default/service.cpp diff --git a/cas/aidl/default/Android.bp b/cas/aidl/default/Android.bp old mode 100755 new mode 100644 diff --git a/cas/aidl/default/CasImpl.cpp b/cas/aidl/default/CasImpl.cpp old mode 100755 new mode 100644 diff --git a/cas/aidl/default/CasImpl.h b/cas/aidl/default/CasImpl.h old mode 100755 new mode 100644 diff --git a/cas/aidl/default/DescramblerImpl.cpp b/cas/aidl/default/DescramblerImpl.cpp old mode 100755 new mode 100644 diff --git a/cas/aidl/default/DescramblerImpl.h b/cas/aidl/default/DescramblerImpl.h old mode 100755 new mode 100644 diff --git a/cas/aidl/default/FactoryLoader.h b/cas/aidl/default/FactoryLoader.h old mode 100755 new mode 100644 diff --git a/cas/aidl/default/MediaCasService.cpp b/cas/aidl/default/MediaCasService.cpp old mode 100755 new mode 100644 diff --git a/cas/aidl/default/MediaCasService.h b/cas/aidl/default/MediaCasService.h old mode 100755 new mode 100644 diff --git a/cas/aidl/default/SharedLibrary.cpp b/cas/aidl/default/SharedLibrary.cpp old mode 100755 new mode 100644 diff --git a/cas/aidl/default/SharedLibrary.h b/cas/aidl/default/SharedLibrary.h old mode 100755 new mode 100644 diff --git a/cas/aidl/default/TypeConvert.cpp b/cas/aidl/default/TypeConvert.cpp old mode 100755 new mode 100644 diff --git a/cas/aidl/default/TypeConvert.h b/cas/aidl/default/TypeConvert.h old mode 100755 new mode 100644 diff --git a/cas/aidl/default/android.hardware.cas-service.xml b/cas/aidl/default/android.hardware.cas-service.xml old mode 100755 new mode 100644 diff --git a/cas/aidl/default/cas-default-lazy.rc b/cas/aidl/default/cas-default-lazy.rc old mode 100755 new mode 100644 diff --git a/cas/aidl/default/cas-default.rc b/cas/aidl/default/cas-default.rc old mode 100755 new mode 100644 diff --git a/cas/aidl/default/fuzzer.cpp b/cas/aidl/default/fuzzer.cpp old mode 100755 new mode 100644 diff --git a/cas/aidl/default/service.cpp b/cas/aidl/default/service.cpp old mode 100755 new mode 100644 From a68b2696e8dbc78553e18a89b663a745190202cb Mon Sep 17 00:00:00 2001 From: Garfield Tan Date: Mon, 17 Jul 2023 13:12:10 -0700 Subject: [PATCH 2/2] Let the lazy CAS HAL to override the regular one Some devices may choose to use the lazy version of CAS HAL than the regular one, but the default one is added to pretty much all devices in the commit 4f5534b0d381a0968e81ee20e81b791aebe5493d in the platform/build project. Adding the lazy version will duplicate the implementation of CAS HAL. This is what is done in the 1.2 HIDL implementation. Bug: 291344726 Test: Only the lazy implementation is installed to devices that require the lazy version. Change-Id: I88ee8d2fa4c27720817e65e5c41ffc74d6b2d61f --- cas/aidl/default/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/cas/aidl/default/Android.bp b/cas/aidl/default/Android.bp index 3c16d577fb..6ce568192a 100644 --- a/cas/aidl/default/Android.bp +++ b/cas/aidl/default/Android.bp @@ -68,6 +68,7 @@ cc_binary { defaults: ["cas_service_example_defaults"], init_rc: ["cas-default-lazy.rc"], cflags: ["-DLAZY_SERVICE"], + overrides: ["android.hardware.cas-service.example"], } cc_fuzz {