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

Commit 0216a727 authored by Charles Chen's avatar Charles Chen Committed by Automerger Merge Worker
Browse files

Merge "API Feedback: rename AddServiceWithFlag with plurals" into udc-dev am: caf51ec9

parents e4bb15bb caf51ec9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -56,12 +56,12 @@ __attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServic
 *
 * \param binder object to register globally with the service manager.
 * \param instance identifier of the service. This will be used to lookup the service.
 * \param flag an AServiceManager_AddServiceFlag enum to denote how the service should be added.
 * \param flags an AServiceManager_AddServiceFlag enum to denote how the service should be added.
 *
 * \return EX_NONE on success.
 */
__attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServiceWithFlag(
        AIBinder* binder, const char* instance, const AServiceManager_AddServiceFlag flag)
__attribute__((warn_unused_result)) binder_exception_t AServiceManager_addServiceWithFlags(
        AIBinder* binder, const char* instance, const AServiceManager_AddServiceFlag flags)
        __INTRODUCED_IN(34);

/**
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ LIBBINDER_NDK34 { # introduced=UpsideDownCake
    AServiceManager_getUpdatableApexName; # systemapi
    AServiceManager_registerForServiceNotifications; # systemapi llndk
    AServiceManager_NotificationRegistration_delete; # systemapi llndk
    AServiceManager_addServiceWithFlag; # systemapi llndk
    AServiceManager_addServiceWithFlags; # systemapi llndk
};

LIBBINDER_NDK_PLATFORM {
+3 −3
Original line number Diff line number Diff line
@@ -42,15 +42,15 @@ binder_exception_t AServiceManager_addService(AIBinder* binder, const char* inst
    return PruneException(exception);
}

binder_exception_t AServiceManager_addServiceWithFlag(AIBinder* binder, const char* instance,
                                                      const AServiceManager_AddServiceFlag flag) {
binder_exception_t AServiceManager_addServiceWithFlags(AIBinder* binder, const char* instance,
                                                       const AServiceManager_AddServiceFlag flags) {
    if (binder == nullptr || instance == nullptr) {
        return EX_ILLEGAL_ARGUMENT;
    }

    sp<IServiceManager> sm = defaultServiceManager();

    bool allowIsolated = flag & AServiceManager_AddServiceFlag::ADD_SERVICE_ALLOW_ISOLATED;
    bool allowIsolated = flags & AServiceManager_AddServiceFlag::ADD_SERVICE_ALLOW_ISOLATED;
    status_t exception = sm->addService(String16(instance), binder->getBinder(), allowIsolated);
    return PruneException(exception);
}