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

Commit 623df245 authored by Maciej Żenczykowski's avatar Maciej Żenczykowski Committed by Automerger Merge Worker
Browse files

Merge "treat eng builds as debuggable, not just userdebug ones" am: 86b572d5

parents 410bd9ea 86b572d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
bool resolv_init(const ResolverNetdCallbacks* callbacks) {
    android::base::InitLogging(/*argv=*/nullptr);
    LOG(INFO) << __func__ << ": Initializing resolver";
    const bool isDebug = isUserDebugBuild();
    const bool isDebug = isDebuggable();
    resolv_set_log_severity(isDebug ? android::base::INFO : android::base::WARNING);
    doh_init_logger(isDebug ? DOH_LOG_LEVEL_INFO : DOH_LOG_LEVEL_WARN);
    using android::net::gApiLevel;
+2 −2
Original line number Diff line number Diff line
@@ -621,9 +621,9 @@ TEST_F(DnsResolverBinderTest, setLogSeverity) {
    EXPECT_TRUE(mDnsResolver->setLogSeverity(IDnsResolver::DNS_RESOLVER_LOG_ERROR).isOk());
    mExpectedLogData.push_back({"setLogSeverity(4)", "setLogSeverity.*4"});

    // Set back to default based off resolv_init(), the default is INFO for userdebug builds
    // Set back to default based off resolv_init(), the default is INFO for userdebug/eng builds
    // and is WARNING for the other builds.
    if (isUserDebugBuild()) {
    if (isDebuggable()) {
        EXPECT_TRUE(mDnsResolver->setLogSeverity(IDnsResolver::DNS_RESOLVER_LOG_INFO).isOk());
        mExpectedLogData.push_back({"setLogSeverity(2)", "setLogSeverity.*2"});
    } else {
+4 −2
Original line number Diff line number Diff line
@@ -56,8 +56,10 @@ inline uint64_t getApiLevel() {
}

// It's the identical strategy as frameworks/base/core/java/android/os/Build.java did.
inline bool isUserDebugBuild() {
    return (android::base::GetProperty("ro.build.type", "user") == "userdebug");
// There's also equivalent C++ code in system/core/init/property_service.cpp
// (and it is CTS tested in BuildTest.java)
inline bool isDebuggable() {
    return android::base::GetBoolProperty("ro.debuggable", false);
}

inline bool isDoHEnabled() {