summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2022-08-09 16:27:46 +0000
committerCherrypicker Worker <android-build-cherrypicker-worker@system.gserviceaccount.com>2023-03-16 16:11:38 +0000
commit0b488bc20e65925380b80b69dadd8694cf1e3552 (patch)
tree5d23e0e21a3f000dd0072d4ff6417d83c06df5c5
parentf9e7c8b8189fcdb8441a0174688ee5cbb9dd5cb2 (diff)
downloadlibhidl-android13-gsi.tar.gz
libhidl: check ro.debuggable lessandroid13-gsi
We were always checking this when retrieving services, but we don't need to (we can check it only when treble testing override is on). There are a few things we could consider in this codebase: - checking debuggability when the testing override is initially set (and warning then) VS now when it is read - avoiding duplicated calls to isDebuggable in isTrebleTestingOverride and getRawServiceInternal. - removing 'kEnforceVintfManifest' since it is always true now. However, given that we're deprecating HIDL and in the interest of keeping changes simple, focusing on other things instead of these improvements. Ignore-AOSP-First: cherry-pick for tm-qpr-dev Bug: 193912100 Test: boot (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3b6a233eba04571ea6178d0c49e126b099de1b30) Merged-In: I6df328dead00c05dcbd8eedf63fc24a8d6141871 Change-Id: I6df328dead00c05dcbd8eedf63fc24a8d6141871
-rw-r--r--transport/ServiceManagement.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index c638279..0640eef 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -174,12 +174,15 @@ static bool isDebuggable() {
}
static inline bool isTrebleTestingOverride() {
+ // return false early so we don't need to check the debuggable property
+ if (!*getTrebleTestingOverridePtr()) return false;
+
if (kEnforceVintfManifest && !isDebuggable()) {
// don't allow testing override in production
return false;
}
- return *getTrebleTestingOverridePtr();
+ return true;
}
static void onRegistrationImpl(const std::string& descriptor, const std::string& instanceName) {