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

Commit e82dcdcd authored by Tom Cherry's avatar Tom Cherry Committed by Gerrit Code Review
Browse files

Merge "logd: don't use libcutils properties"

parents 00d490e0 a8c7f306
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@
#include <unordered_map>
#include <utility>

#include <cutils/properties.h>
#include <private/android_logger.h>

#include "LogUtils.h"
+9 −15
Original line number Diff line number Diff line
@@ -16,13 +16,11 @@

#include <ctype.h>

#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <cutils/properties.h>

#include "LogWhiteBlackList.h"

// White and Black list

Prune::Prune(uid_t uid, pid_t pid) : mUid(uid), mPid(pid) {
}

@@ -75,14 +73,12 @@ int PruneList::init(const char* str) {
        it = mNaughty.erase(it);
    }

    static const char _default[] = "default";
    // default here means take ro.logd.filter, persist.logd.filter then
    // internal default in that order.
    if (str && !strcmp(str, _default)) {
    if (str && !strcmp(str, "default")) {
        str = nullptr;
    }
    static const char _disable[] = "disable";
    if (str && !strcmp(str, _disable)) {
    if (str && !strcmp(str, "disable")) {
        str = "";
    }

@@ -91,22 +87,20 @@ int PruneList::init(const char* str) {
    if (str) {
        filter = str;
    } else {
        char property[PROPERTY_VALUE_MAX];
        property_get("ro.logd.filter", property, _default);
        filter = property;
        property_get("persist.logd.filter", property, filter.c_str());
        filter = android::base::GetProperty("ro.logd.filter", "default");
        auto persist_filter = android::base::GetProperty("persist.logd.filter", "default");
        // default here means take ro.logd.filter
        if (strcmp(property, _default)) {
            filter = property;
        if (persist_filter != "default") {
            filter = persist_filter;
        }
    }

    // default here means take internal default.
    if (filter == _default) {
    if (filter == "default") {
        // See README.property for description of filter format
        filter = "~! ~1000/!";
    }
    if (filter == _disable) {
    if (filter == "disable") {
        filter = "";
    }

+1 −6
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
 * limitations under the License.
 */

#ifndef _LOGD_LOG_WHITE_BLACK_LIST_H__
#define _LOGD_LOG_WHITE_BLACK_LIST_H__
#pragma once

#include <sys/types.h>

@@ -24,8 +23,6 @@

#include "LogBufferElement.h"

// White and Blacklist

class Prune {
    friend class PruneList;

@@ -84,5 +81,3 @@ class PruneList {

    std::string format();
};

#endif  // _LOGD_LOG_WHITE_BLACK_LIST_H__
+0 −1
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@

#include <android-base/macros.h>
#include <cutils/android_get_control_file.h>
#include <cutils/properties.h>
#include <cutils/sockets.h>
#include <log/event_tag_map.h>
#include <packagelistparser/packagelistparser.h>