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

Commit 30fe8f03 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add tests for HDMI-CEC statsd atom logging"

parents 895fc96b f6b854e2
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -18,9 +18,14 @@ package com.android.server.hdmi;

import android.stats.hdmi.HdmiStatsEnums;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.FrameworkStatsLog;

class HdmiCecAtomWriter {
/**
 * Provides methods for writing HDMI-CEC statsd atoms.
 */
@VisibleForTesting
public class HdmiCecAtomWriter {

    private static final int FEATURE_ABORT_OPCODE_UNKNOWN = 0x100;
    private static final int ERROR_CODE_UNKNOWN = -1;
+1 −1
Original line number Diff line number Diff line
@@ -635,7 +635,7 @@ final class HdmiCecController {
     */
    private int incomingMessageDirection(int srcAddress, int dstAddress) {
        boolean sourceIsLocal = false;
        boolean destinationIsLocal = false;
        boolean destinationIsLocal = dstAddress == Constants.ADDR_BROADCAST;
        for (HdmiCecLocalDevice localDevice : mService.getHdmiCecNetwork().getLocalDeviceList()) {
            int logicalAddress = localDevice.getDeviceInfo().getLogicalAddress();
            if (logicalAddress == srcAddress) {
+2 −1
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ import java.util.concurrent.ArrayBlockingQueue;
 * Note that the information cached in this class is not guaranteed to be up-to-date, especially OSD
 * names, power states can be outdated.
 */
class HdmiCecNetwork {
@VisibleForTesting
public class HdmiCecNetwork {
    private static final String TAG = "HdmiCecNetwork";

    protected final Object mLock;
+7 −4
Original line number Diff line number Diff line
@@ -564,7 +564,8 @@ public class HdmiControlService extends SystemService {
        mTvInputManager.unregisterCallback(callback);
    }

    PowerManager getPowerManager() {
    @VisibleForTesting
    protected PowerManager getPowerManager() {
        return mPowerManager;
    }

@@ -729,7 +730,8 @@ public class HdmiControlService extends SystemService {
        Global.putInt(cr, key, toInt(value));
    }

    void writeStringSystemProperty(String key, String value) {
    @VisibleForTesting
    protected void writeStringSystemProperty(String key, String value) {
        SystemProperties.set(key, value);
    }

@@ -3366,7 +3368,7 @@ public class HdmiControlService extends SystemService {
    }

    @VisibleForTesting
    HdmiCecAtomWriter getAtomWriter() {
    protected HdmiCecAtomWriter getAtomWriter() {
        return mAtomWriter;
    }

@@ -3395,7 +3397,8 @@ public class HdmiControlService extends SystemService {
                HdmiControlService.PERMISSION);
    }

    HdmiCecConfig getHdmiCecConfig() {
    @VisibleForTesting
    protected HdmiCecConfig getHdmiCecConfig() {
        return mHdmiCecConfig;
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -98,17 +98,17 @@ public class ActiveSourceActionTest {
            }

            @Override
            PowerManager getPowerManager() {
            protected PowerManager getPowerManager() {
                return powerManager;
            }

            @Override
            void writeStringSystemProperty(String key, String value) {
            protected void writeStringSystemProperty(String key, String value) {
                // do nothing
            }

            @Override
            HdmiCecConfig getHdmiCecConfig() {
            protected HdmiCecConfig getHdmiCecConfig() {
                return hdmiCecConfig;
            }
        };
Loading