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

Commit 38fc1013 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Fix google-explicit-constructor warnings in sensorservice.

* Add explicit keyword to conversion constructors,
  or use NOLINT for implicit converters.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Ie7c4dfcdbd069809e103f0dd008ae2fb4b0502f4
parent 0322a717
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ namespace SensorServiceUtil {
// behavior.
class RecentEventLogger : public Dumpable {
public:
    RecentEventLogger(int sensorType);
    explicit RecentEventLogger(int sensorType);
    void addEvent(const sensors_event_t& event);
    bool populateLastEvent(sensors_event_t *event) const;
    bool isEmpty() const;
@@ -46,7 +46,7 @@ public:

protected:
    struct SensorEventLog {
        SensorEventLog(const sensors_event_t& e);
        explicit SensorEventLog(const sensors_event_t& e);
        timespec mWallTime;
        sensors_event_t mEvent;
    };
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public:
    /**
     * Construct a RingBuffer that can grow up to the given length.
     */
    RingBuffer(size_t length);
    explicit RingBuffer(size_t length);

    /**
     * Forward iterator to this class.  Implements an std:forward_iterator.
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ namespace android {

class RotationVectorSensor : public VirtualSensor {
public:
    RotationVectorSensor(int mode = FUSION_9AXIS);
    explicit RotationVectorSensor(int mode = FUSION_9AXIS);
    virtual bool process(sensors_event_t* outEvent, const sensors_event_t& event) override;
    virtual status_t activate(void* ident, bool enabled) override;
    virtual status_t setDelay(void* ident, int handle, int64_t ns) override;
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ class SensorService::SensorEventAckReceiver : public Thread {
    sp<SensorService> const mService;
public:
    virtual bool threadLoop();
    SensorEventAckReceiver(const sp<SensorService>& service)
    explicit SensorEventAckReceiver(const sp<SensorService>& service)
            : mService(service) {
    }
};
+2 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public:

class BaseSensor : public SensorInterface {
public:
    BaseSensor(const sensor_t& sensor);
    explicit BaseSensor(const sensor_t& sensor);
    BaseSensor(const sensor_t& sensor, const uint8_t (&uuid)[16]);

    // Not all sensors need to support batching.
@@ -74,7 +74,7 @@ protected:

class HardwareSensor : public BaseSensor {
public:
    HardwareSensor(const sensor_t& sensor);
    explicit HardwareSensor(const sensor_t& sensor);
    HardwareSensor(const sensor_t& sensor, const uint8_t (&uuid)[16]);

    virtual ~HardwareSensor();
Loading