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

Commit be71015d authored by Arthur Ishiguro's avatar Arthur Ishiguro
Browse files

Fix local variable shadowing compile errors

Bug: 410035138
Flag: EXEMPT minor bug fix
Test: Compile
Change-Id: I3938d6e996589158a22ac4d1526119267f308e56
parent 4e9ba57b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -282,6 +282,7 @@ cc_defaults {
        "-Wunused-const-variable",
        "-Wunused-result",
        "-Wexit-time-destructors",
        "-Wshadow",
        "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION",
        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
        // Hide symbols by default and set the BUILDING_LIBBINDER macro so that
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ Status BackendUnifiedServiceManager::updateCache(const std::string& serviceName,
    if (atrace_is_tag_enabled(ATRACE_TAG_AIDL)) {
        traceStr = "BinderCacheWithInvalidation::updateCache : " + serviceName;
    }
    binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL, traceStr.c_str());
    binder::ScopedTrace outerAidlTrace(ATRACE_TAG_AIDL, traceStr.c_str());
    if (!binder) {
        binder::ScopedTrace
                aidlTrace(ATRACE_TAG_AIDL,
+2 −2
Original line number Diff line number Diff line
@@ -160,8 +160,8 @@ status_t BnPermissionController::onTransact(
        case GET_PACKAGE_UID_TRANSACTION: {
            CHECK_INTERFACE(IPermissionController, data, reply);
            String16 package = data.readString16();
            int flags = data.readInt32();
            const int uid = getPackageUid(package, flags);
            int intFlags = data.readInt32();
            const int uid = getPackageUid(package, intFlags);
            reply->writeNoException();
            reply->writeInt32(uid);
            return NO_ERROR;
+1 −2
Original line number Diff line number Diff line
@@ -587,8 +587,7 @@ CppBackendShim::CppBackendShim(const sp<BackendUnifiedServiceManager>& impl)
sp<IBinder> CppBackendShim::getService(const String16& name) const {
    static bool gSystemBootCompleted = false;

    sp<IBinder> svc = checkService(name);
    if (svc != nullptr) return svc;
    if (sp<IBinder> svc = checkService(name); svc != nullptr) return svc;

    sp<ProcessState> self = ProcessState::selfOrNull();
    const bool isVendorService =
+14 −10
Original line number Diff line number Diff line
@@ -78,6 +78,8 @@ private:
     */
    void maybeTryShutdownLocked();

    void updateCacheClientCount();

    // for below
    std::mutex mMutex;

@@ -243,24 +245,26 @@ void ClientCounterCallbackImpl::maybeTryShutdownLocked() {
    }
}

void ClientCounterCallbackImpl::updateCacheClientCount() {
    size_t numWithClients = 0;
    for (const auto& [name, registered] : mRegisteredServices) {
        (void)name;
        if (registered.clients) numWithClients++;
    }
    mNumConnectedServices = numWithClients;
}

Status ClientCounterCallbackImpl::onClients(const sp<IBinder>& service, bool clients) {
    std::lock_guard<std::mutex> lock(mMutex);
    auto & [name, registered] = *assertRegisteredService(service);
    if (registered.clients == clients) {
        LOG_ALWAYS_FATAL("Process already thought %s had clients: %d but servicemanager has "
                         "notified has clients: %d", name.c_str(), registered.clients, clients);
                         "notified has clients: %d",
                         name.c_str(), registered.clients, clients);
    }
    registered.clients = clients;

    // update cache count of clients
    {
         size_t numWithClients = 0;
         for (const auto& [name, registered] : mRegisteredServices) {
             (void) name;
             if (registered.clients) numWithClients++;
         }
         mNumConnectedServices = numWithClients;
    }
    updateCacheClientCount();

    ALOGI("Process has %zu (of %zu available) client(s) in use after notification %s has clients: %d",
          mNumConnectedServices, mRegisteredServices.size(), name.c_str(), clients);
Loading