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

Commit 36110510 authored by Jungshik Jang's avatar Jungshik Jang Committed by Android (Google) Code Review
Browse files

Merge "Refine recode apis." into lmp-dev

parents faa49bc8 2afd9769
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public final class HdmiRecordSources {
            return includeType ? mExtraDataSize + 1 : mExtraDataSize;
        }

        public final int toByteArray(boolean includeType, byte[] data, int index) {
        final int toByteArray(boolean includeType, byte[] data, int index) {
            if (includeType) {
                // 1 to 8 bytes (depends on source).
                // {[Record Source Type]} |
@@ -161,7 +161,7 @@ public final class HdmiRecordSources {
     * Interface for digital source identification.
     */
    private interface DigitalServiceIdentification {
        void toByteArray(byte[] data, int index);
        int toByteArray(byte[] data, int index);
    }

    /**
@@ -193,8 +193,9 @@ public final class HdmiRecordSources {
        }

        @Override
        public void toByteArray(byte[] data, int index) {
            threeFieldsToSixBytes(mTransportStreamId, mServiceId, mOriginalNetworkId, data, index);
        public int toByteArray(byte[] data, int index) {
            return threeFieldsToSixBytes(mTransportStreamId, mServiceId, mOriginalNetworkId, data,
                    index);
        }
    }

@@ -221,8 +222,8 @@ public final class HdmiRecordSources {
        }

        @Override
        public void toByteArray(byte[] data, int index) {
            threeFieldsToSixBytes(mTransportStreamId, mProgramNumber, 0, data, index);
        public int toByteArray(byte[] data, int index) {
            return threeFieldsToSixBytes(mTransportStreamId, mProgramNumber, 0, data, index);
        }
    }

@@ -255,8 +256,9 @@ public final class HdmiRecordSources {
        }

        @Override
        public void toByteArray(byte[] data, int index) {
            threeFieldsToSixBytes(mTransportStreamId, mServiceId, mOriginalNetworkId, data, index);
        public int toByteArray(byte[] data, int index) {
            return threeFieldsToSixBytes(mTransportStreamId, mServiceId, mOriginalNetworkId, data,
                    index);
        }
    }

@@ -283,12 +285,13 @@ public final class HdmiRecordSources {
            mMinorChannelNumber = minorNumer;
        }

        private void toByteArray(byte[] data, int index) {
        private int toByteArray(byte[] data, int index) {
            // The first 6 bits for format, the 10 bits for major number.
            data[index] = (byte) (((mChannelNumberFormat << 2) | (mMajorChannelNumber >>> 8) & 0x3));
            data[index + 1] = (byte) (mMajorChannelNumber & 0xFF);
            // Minor number uses the next 16 bits.
            shortToByteArray((short) mMinorChannelNumber, data, index + 2);
            return 4;
        }
    }

@@ -323,11 +326,12 @@ public final class HdmiRecordSources {
        }

        @Override
        public void toByteArray(byte[] data, int index) {
        public int toByteArray(byte[] data, int index) {
            mChannelIdentifier.toByteArray(data, index);
            // The last 2 bytes is reserved for future use.
            data[index + 4] = 0;
            data[index + 5] = 0;
            return 6;
        }
    }

+4 −4
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ public class HdmiTimerRecordSources {
     * @hide
     */
    @SystemApi
    public static class Time extends TimeUnit {
    public static final class Time extends TimeUnit {
        private Time(int hour, int minute) {
            super(hour, minute);
        }
@@ -221,7 +221,7 @@ public class HdmiTimerRecordSources {
     * @hide
     */
    @SystemApi
    public static class Duration extends TimeUnit {
    public static final class Duration extends TimeUnit {
        private Duration(int hour, int minute) {
            super(hour, minute);
        }
@@ -298,7 +298,7 @@ public class HdmiTimerRecordSources {
     * @hide
     */
    @SystemApi
    public static class TimerInfo {
    public static final class TimerInfo {
        private static final int DAY_OF_MONTH_SIZE = 1;
        private static final int MONTH_OF_YEAR_SIZE = 1;
        private static final int START_TIME_SIZE = 2; // 1byte for hour and 1byte for minute.
@@ -373,7 +373,7 @@ public class HdmiTimerRecordSources {
     * @hide
     */
    @SystemApi
    public static class TimerRecordSource {
    public static final class TimerRecordSource {
        private final RecordSource mRecordSource;
        private final TimerInfo mTimerInfo;