From b3fbf9dbe8d41d91efbac2118b676af74592257b Mon Sep 17 00:00:00 2001 From: Jinsuk Kim Date: Fri, 12 Sep 2014 10:41:40 +0900 Subject: Replace the MHL register name 'scratchpad' with 'vendor' Bug: 17479050 Change-Id: If6fe2949d17ad2d407df5b797c1915eb0e9bf421 --- core/java/android/hardware/hdmi/HdmiTvClient.java | 44 +++++++++++----------- .../android/hardware/hdmi/IHdmiControlService.aidl | 6 +-- .../hdmi/IHdmiMhlScratchpadCommandListener.aidl | 27 ------------- .../hdmi/IHdmiMhlVendorCommandListener.aidl | 26 +++++++++++++ 4 files changed, 51 insertions(+), 52 deletions(-) delete mode 100644 core/java/android/hardware/hdmi/IHdmiMhlScratchpadCommandListener.aidl create mode 100644 core/java/android/hardware/hdmi/IHdmiMhlVendorCommandListener.aidl (limited to 'core') diff --git a/core/java/android/hardware/hdmi/HdmiTvClient.java b/core/java/android/hardware/hdmi/HdmiTvClient.java index c37fb5b..9d92fd9 100644 --- a/core/java/android/hardware/hdmi/HdmiTvClient.java +++ b/core/java/android/hardware/hdmi/HdmiTvClient.java @@ -36,9 +36,9 @@ public final class HdmiTvClient extends HdmiClient { private static final String TAG = "HdmiTvClient"; /** - * Size of MHL scratchpad register. + * Size of MHL register for vendor command */ - public static final int SCRATCHPAD_DATA_SIZE = 16; + public static final int VENDOR_DATA_SIZE = 16; HdmiTvClient(IHdmiControlService service) { super(service); @@ -332,31 +332,31 @@ public final class HdmiTvClient extends HdmiClient { } /** - * Interface used to get incoming MHL scratchpad command. + * Interface used to get incoming MHL vendor command. */ - public interface HdmiMhlScratchpadCommandListener { + public interface HdmiMhlVendorCommandListener { void onReceived(int portId, int offset, int length, byte[] data); } /** - * Set {@link HdmiMhlScratchpadCommandListener} to get incoming MHL sSratchpad command. + * Set {@link HdmiMhlVendorCommandListener} to get incoming MHL vendor command. * - * @param listener to receive incoming MHL Scratchpad command + * @param listener to receive incoming MHL vendor command */ - public void setHdmiMhlScratchpadCommandListener(HdmiMhlScratchpadCommandListener listener) { + public void setHdmiMhlVendorCommandListener(HdmiMhlVendorCommandListener listener) { if (listener == null) { throw new IllegalArgumentException("listener must not be null."); } try { - mService.addHdmiMhlScratchpadCommandListener(getListenerWrapper(listener)); + mService.addHdmiMhlVendorCommandListener(getListenerWrapper(listener)); } catch (RemoteException e) { - Log.e(TAG, "failed to set hdmi mhl scratchpad command listener: ", e); + Log.e(TAG, "failed to set hdmi mhl vendor command listener: ", e); } } - private IHdmiMhlScratchpadCommandListener getListenerWrapper( - final HdmiMhlScratchpadCommandListener listener) { - return new IHdmiMhlScratchpadCommandListener.Stub() { + private IHdmiMhlVendorCommandListener getListenerWrapper( + final HdmiMhlVendorCommandListener listener) { + return new IHdmiMhlVendorCommandListener.Stub() { @Override public void onReceived(int portId, int offset, int length, byte[] data) { listener.onReceived(portId, offset, length, data); @@ -365,29 +365,29 @@ public final class HdmiTvClient extends HdmiClient { } /** - * Send MHL Scratchpad command to the device connected to a port of the given portId. + * Send MHL vendor command to the device connected to a port of the given portId. * - * @param portId id of port to send MHL Scratchpad command + * @param portId id of port to send MHL vendor command * @param offset offset in the in given data * @param length length of data. offset + length should be bound to length of data. - * @param data container for Scratchpad data. It should be 16 bytes. + * @param data container for vendor command data. It should be 16 bytes. * @throws IllegalArgumentException if the given parameters are invalid */ - public void sendScratchpadCommand(int portId, int offset, int length, byte[] data) { - if (data == null || data.length != SCRATCHPAD_DATA_SIZE) { - throw new IllegalArgumentException("Invalid scratchpad data."); + public void sendMhlVendorCommand(int portId, int offset, int length, byte[] data) { + if (data == null || data.length != VENDOR_DATA_SIZE) { + throw new IllegalArgumentException("Invalid vendor command data."); } - if (offset < 0 || offset >= SCRATCHPAD_DATA_SIZE) { + if (offset < 0 || offset >= VENDOR_DATA_SIZE) { throw new IllegalArgumentException("Invalid offset:" + offset); } - if (length < 0 || offset + length > SCRATCHPAD_DATA_SIZE) { + if (length < 0 || offset + length > VENDOR_DATA_SIZE) { throw new IllegalArgumentException("Invalid length:" + length); } try { - mService.sendScratchpadCommand(portId, offset, length, data); + mService.sendMhlVendorCommand(portId, offset, length, data); } catch (RemoteException e) { - Log.e(TAG, "failed to send scratchpad command: ", e); + Log.e(TAG, "failed to send vendor command: ", e); } } } diff --git a/core/java/android/hardware/hdmi/IHdmiControlService.aidl b/core/java/android/hardware/hdmi/IHdmiControlService.aidl index 3bd45ed..602f866 100644 --- a/core/java/android/hardware/hdmi/IHdmiControlService.aidl +++ b/core/java/android/hardware/hdmi/IHdmiControlService.aidl @@ -22,7 +22,7 @@ import android.hardware.hdmi.IHdmiControlCallback; import android.hardware.hdmi.IHdmiDeviceEventListener; import android.hardware.hdmi.IHdmiHotplugEventListener; import android.hardware.hdmi.IHdmiInputChangeListener; -import android.hardware.hdmi.IHdmiMhlScratchpadCommandListener; +import android.hardware.hdmi.IHdmiMhlVendorCommandListener; import android.hardware.hdmi.IHdmiRecordListener; import android.hardware.hdmi.IHdmiSystemAudioModeChangeListener; import android.hardware.hdmi.IHdmiVendorCommandListener; @@ -67,6 +67,6 @@ interface IHdmiControlService { void stopOneTouchRecord(int recorderAddress); void startTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource); void clearTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource); - void sendScratchpadCommand(int portId, int offset, int length, in byte[] data); - void addHdmiMhlScratchpadCommandListener(IHdmiMhlScratchpadCommandListener listener); + void sendMhlVendorCommand(int portId, int offset, int length, in byte[] data); + void addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener); } diff --git a/core/java/android/hardware/hdmi/IHdmiMhlScratchpadCommandListener.aidl b/core/java/android/hardware/hdmi/IHdmiMhlScratchpadCommandListener.aidl deleted file mode 100644 index 4176597..0000000 --- a/core/java/android/hardware/hdmi/IHdmiMhlScratchpadCommandListener.aidl +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.hdmi; - - /** - * Callback interface definition for MHL client to get the scratchpad - * command. - * - * @hide - */ - oneway interface IHdmiMhlScratchpadCommandListener { - void onReceived(int portId, int offset, int length, in byte[] data); - } diff --git a/core/java/android/hardware/hdmi/IHdmiMhlVendorCommandListener.aidl b/core/java/android/hardware/hdmi/IHdmiMhlVendorCommandListener.aidl new file mode 100644 index 0000000..4696677 --- /dev/null +++ b/core/java/android/hardware/hdmi/IHdmiMhlVendorCommandListener.aidl @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.hdmi; + + /** + * Callback interface definition for MHL client to get the vendor command. + * + * @hide + */ + oneway interface IHdmiMhlVendorCommandListener { + void onReceived(int portId, int offset, int length, in byte[] data); + } -- cgit v1.1