Loading Android.mk +2 −2 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ LOCAL_SRC_FILES += \ ../../system/bt/binder/android/bluetooth/IBluetoothHeadsetPhone.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHealth.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHealthCallback.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothInputDevice.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHidHost.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothPan.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothManager.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothManagerCallback.aidl \ Loading @@ -139,7 +139,7 @@ LOCAL_SRC_FILES += \ ../../system/bt/binder/android/bluetooth/IBluetoothSap.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothStateChangeCallback.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHeadsetClient.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothInputHost.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHidDevice.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHidDeviceCallback.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothGatt.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothGattCallback.aidl \ Loading config/compiled-classes-phone +6 −6 Original line number Diff line number Diff line Loading @@ -721,9 +721,9 @@ android.bluetooth.BluetoothHeadset$1 android.bluetooth.BluetoothHeadset$2 android.bluetooth.BluetoothHeadset$3 android.bluetooth.BluetoothHealthAppConfiguration android.bluetooth.BluetoothInputDevice android.bluetooth.BluetoothInputDevice$1 android.bluetooth.BluetoothInputDevice$2 android.bluetooth.BluetoothHidHost android.bluetooth.BluetoothHidHost$1 android.bluetooth.BluetoothHidHost$2 android.bluetooth.BluetoothInputStream android.bluetooth.BluetoothManager android.bluetooth.BluetoothMap Loading Loading @@ -766,9 +766,9 @@ android.bluetooth.IBluetoothHeadsetPhone$Stub$Proxy android.bluetooth.IBluetoothHealth android.bluetooth.IBluetoothHealth$Stub android.bluetooth.IBluetoothHealthCallback android.bluetooth.IBluetoothInputDevice android.bluetooth.IBluetoothInputDevice$Stub android.bluetooth.IBluetoothInputDevice$Stub$Proxy android.bluetooth.IBluetoothHidHost android.bluetooth.IBluetoothHidHost$Stub android.bluetooth.IBluetoothHidHost$Stub$Proxy android.bluetooth.IBluetoothManager android.bluetooth.IBluetoothManager$Stub android.bluetooth.IBluetoothManager$Stub$Proxy Loading core/java/android/bluetooth/BluetoothAdapter.java +9 −9 Original line number Diff line number Diff line Loading @@ -2104,8 +2104,8 @@ public final class BluetoothAdapter { } else if (profile == BluetoothProfile.AVRCP_CONTROLLER) { BluetoothAvrcpController avrcp = new BluetoothAvrcpController(context, listener); return true; } else if (profile == BluetoothProfile.INPUT_DEVICE) { BluetoothInputDevice iDev = new BluetoothInputDevice(context, listener); } else if (profile == BluetoothProfile.HID_HOST) { BluetoothHidHost iDev = new BluetoothHidHost(context, listener); return true; } else if (profile == BluetoothProfile.PAN) { BluetoothPan pan = new BluetoothPan(context, listener); Loading @@ -2128,8 +2128,8 @@ public final class BluetoothAdapter { } else if (profile == BluetoothProfile.MAP_CLIENT) { BluetoothMapClient mapClient = new BluetoothMapClient(context, listener); return true; } else if (profile == BluetoothProfile.INPUT_HOST) { BluetoothInputHost iHost = new BluetoothInputHost(context, listener); } else if (profile == BluetoothProfile.HID_DEVICE) { BluetoothHidDevice hidDevice = new BluetoothHidDevice(context, listener); return true; } else { return false; Loading Loading @@ -2167,8 +2167,8 @@ public final class BluetoothAdapter { BluetoothAvrcpController avrcp = (BluetoothAvrcpController) proxy; avrcp.close(); break; case BluetoothProfile.INPUT_DEVICE: BluetoothInputDevice iDev = (BluetoothInputDevice) proxy; case BluetoothProfile.HID_HOST: BluetoothHidHost iDev = (BluetoothHidHost) proxy; iDev.close(); break; case BluetoothProfile.PAN: Loading Loading @@ -2207,9 +2207,9 @@ public final class BluetoothAdapter { BluetoothMapClient mapClient = (BluetoothMapClient) proxy; mapClient.close(); break; case BluetoothProfile.INPUT_HOST: BluetoothInputHost iHost = (BluetoothInputHost) proxy; iHost.close(); case BluetoothProfile.HID_DEVICE: BluetoothHidDevice hidDevice = (BluetoothHidDevice) proxy; hidDevice.close(); break; } } Loading core/java/android/bluetooth/BluetoothInputHost.java→core/java/android/bluetooth/BluetoothHidDevice.java +22 −22 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ import java.util.List; /** * @hide */ public final class BluetoothInputHost implements BluetoothProfile { public final class BluetoothHidDevice implements BluetoothProfile { private static final String TAG = BluetoothInputHost.class.getSimpleName(); private static final String TAG = BluetoothHidDevice.class.getSimpleName(); /** * Intent used to broadcast the change in connection state of the Input Loading @@ -57,7 +57,7 @@ public final class BluetoothInputHost implements BluetoothProfile { */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.inputhost.profile.action.CONNECTION_STATE_CHANGED"; "android.bluetooth.hiddevice.profile.action.CONNECTION_STATE_CHANGED"; /** * Constants representing device subclass. Loading Loading @@ -113,7 +113,7 @@ public final class BluetoothInputHost implements BluetoothProfile { private ServiceListener mServiceListener; private volatile IBluetoothInputHost mService; private volatile IBluetoothHidDevice mService; private BluetoothAdapter mAdapter; Loading Loading @@ -205,23 +205,23 @@ public final class BluetoothInputHost implements BluetoothProfile { private final ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { Log.d(TAG, "onServiceConnected()"); mService = IBluetoothInputHost.Stub.asInterface(service); mService = IBluetoothHidDevice.Stub.asInterface(service); if (mServiceListener != null) { mServiceListener.onServiceConnected(BluetoothProfile.INPUT_HOST, BluetoothInputHost.this); mServiceListener.onServiceConnected(BluetoothProfile.HID_DEVICE, BluetoothHidDevice.this); } } public void onServiceDisconnected(ComponentName className) { Log.d(TAG, "onServiceDisconnected()"); mService = null; if (mServiceListener != null) { mServiceListener.onServiceDisconnected(BluetoothProfile.INPUT_HOST); mServiceListener.onServiceDisconnected(BluetoothProfile.HID_DEVICE); } } }; BluetoothInputHost(Context context, ServiceListener listener) { Log.v(TAG, "BluetoothInputHost"); BluetoothHidDevice(Context context, ServiceListener listener) { Log.v(TAG, "BluetoothHidDevice"); mContext = context; mServiceListener = listener; Loading @@ -240,7 +240,7 @@ public final class BluetoothInputHost implements BluetoothProfile { } boolean doBind() { Intent intent = new Intent(IBluetoothInputHost.class.getName()); Intent intent = new Intent(IBluetoothHidDevice.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, Loading Loading @@ -285,7 +285,7 @@ public final class BluetoothInputHost implements BluetoothProfile { public List<BluetoothDevice> getConnectedDevices() { Log.v(TAG, "getConnectedDevices()"); final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { return service.getConnectedDevices(); Loading @@ -306,7 +306,7 @@ public final class BluetoothInputHost implements BluetoothProfile { public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { Log.v(TAG, "getDevicesMatchingConnectionStates(): states=" + Arrays.toString(states)); final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { return service.getDevicesMatchingConnectionStates(states); Loading @@ -327,7 +327,7 @@ public final class BluetoothInputHost implements BluetoothProfile { public int getConnectionState(BluetoothDevice device) { Log.v(TAG, "getConnectionState(): device=" + device); final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { return service.getConnectionState(device); Loading Loading @@ -367,7 +367,7 @@ public final class BluetoothInputHost implements BluetoothProfile { return false; } final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { BluetoothHidDeviceAppConfiguration config = Loading Loading @@ -401,7 +401,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.unregisterApp(config); Loading @@ -426,7 +426,7 @@ public final class BluetoothInputHost implements BluetoothProfile { public boolean sendReport(BluetoothDevice device, int id, byte[] data) { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.sendReport(device, id, data); Loading Loading @@ -454,7 +454,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.replyReport(device, type, id, data); Loading @@ -480,7 +480,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.reportError(device, error); Loading @@ -504,7 +504,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.unplug(device); Loading @@ -529,7 +529,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.connect(device); Loading @@ -553,7 +553,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.disconnect(device); Loading core/java/android/bluetooth/BluetoothInputDevice.java→core/java/android/bluetooth/BluetoothHidHost.java +35 −35 Original line number Diff line number Diff line Loading @@ -35,16 +35,16 @@ import java.util.List; * This class provides the public APIs to control the Bluetooth Input * Device Profile. * * <p>BluetoothInputDevice is a proxy object for controlling the Bluetooth * <p>BluetoothHidHost is a proxy object for controlling the Bluetooth * Service via IPC. Use {@link BluetoothAdapter#getProfileProxy} to get * the BluetoothInputDevice proxy object. * the BluetoothHidHost proxy object. * * <p>Each method is protected with its appropriate permission. * * @hide */ public final class BluetoothInputDevice implements BluetoothProfile { private static final String TAG = "BluetoothInputDevice"; public final class BluetoothHidHost implements BluetoothProfile { private static final String TAG = "BluetoothHidHost"; private static final boolean DBG = true; private static final boolean VDBG = false; Loading Loading @@ -177,52 +177,52 @@ public final class BluetoothInputDevice implements BluetoothProfile { * @hide */ public static final String EXTRA_PROTOCOL_MODE = "android.bluetooth.BluetoothInputDevice.extra.PROTOCOL_MODE"; "android.bluetooth.BluetoothHidHost.extra.PROTOCOL_MODE"; /** * @hide */ public static final String EXTRA_REPORT_TYPE = "android.bluetooth.BluetoothInputDevice.extra.REPORT_TYPE"; "android.bluetooth.BluetoothHidHost.extra.REPORT_TYPE"; /** * @hide */ public static final String EXTRA_REPORT_ID = "android.bluetooth.BluetoothInputDevice.extra.REPORT_ID"; "android.bluetooth.BluetoothHidHost.extra.REPORT_ID"; /** * @hide */ public static final String EXTRA_REPORT_BUFFER_SIZE = "android.bluetooth.BluetoothInputDevice.extra.REPORT_BUFFER_SIZE"; "android.bluetooth.BluetoothHidHost.extra.REPORT_BUFFER_SIZE"; /** * @hide */ public static final String EXTRA_REPORT = "android.bluetooth.BluetoothInputDevice.extra.REPORT"; public static final String EXTRA_REPORT = "android.bluetooth.BluetoothHidHost.extra.REPORT"; /** * @hide */ public static final String EXTRA_STATUS = "android.bluetooth.BluetoothInputDevice.extra.STATUS"; public static final String EXTRA_STATUS = "android.bluetooth.BluetoothHidHost.extra.STATUS"; /** * @hide */ public static final String EXTRA_VIRTUAL_UNPLUG_STATUS = "android.bluetooth.BluetoothInputDevice.extra.VIRTUAL_UNPLUG_STATUS"; "android.bluetooth.BluetoothHidHost.extra.VIRTUAL_UNPLUG_STATUS"; /** * @hide */ public static final String EXTRA_IDLE_TIME = "android.bluetooth.BluetoothInputDevice.extra.IDLE_TIME"; "android.bluetooth.BluetoothHidHost.extra.IDLE_TIME"; private Context mContext; private ServiceListener mServiceListener; private BluetoothAdapter mAdapter; private volatile IBluetoothInputDevice mService; private volatile IBluetoothHidHost mService; private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { Loading Loading @@ -254,10 +254,10 @@ public final class BluetoothInputDevice implements BluetoothProfile { }; /** * Create a BluetoothInputDevice proxy object for interacting with the local * Create a BluetoothHidHost proxy object for interacting with the local * Bluetooth Service which handles the InputDevice profile */ /*package*/ BluetoothInputDevice(Context context, ServiceListener l) { /*package*/ BluetoothHidHost(Context context, ServiceListener l) { mContext = context; mServiceListener = l; mAdapter = BluetoothAdapter.getDefaultAdapter(); Loading @@ -275,7 +275,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { } boolean doBind() { Intent intent = new Intent(IBluetoothInputDevice.class.getName()); Intent intent = new Intent(IBluetoothHidHost.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, Loading Loading @@ -331,7 +331,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.connect(device); Loading Loading @@ -371,7 +371,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.disconnect(device); Loading @@ -390,7 +390,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { @Override public List<BluetoothDevice> getConnectedDevices() { if (VDBG) log("getConnectedDevices()"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled()) { try { return service.getConnectedDevices(); Loading @@ -409,7 +409,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { @Override public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (VDBG) log("getDevicesMatchingStates()"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled()) { try { return service.getDevicesMatchingConnectionStates(states); Loading @@ -428,7 +428,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { @Override public int getConnectionState(BluetoothDevice device) { if (VDBG) log("getState(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getConnectionState(device); Loading Loading @@ -458,7 +458,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean setPriority(BluetoothDevice device, int priority) { if (DBG) log("setPriority(" + device + ", " + priority + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON) { Loading Loading @@ -490,7 +490,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public int getPriority(BluetoothDevice device) { if (VDBG) log("getPriority(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getPriority(device); Loading @@ -506,11 +506,11 @@ public final class BluetoothInputDevice implements BluetoothProfile { private final ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { if (DBG) Log.d(TAG, "Proxy object connected"); mService = IBluetoothInputDevice.Stub.asInterface(Binder.allowBlocking(service)); mService = IBluetoothHidHost.Stub.asInterface(Binder.allowBlocking(service)); if (mServiceListener != null) { mServiceListener.onServiceConnected(BluetoothProfile.INPUT_DEVICE, BluetoothInputDevice.this); mServiceListener.onServiceConnected(BluetoothProfile.HID_HOST, BluetoothHidHost.this); } } Loading @@ -518,7 +518,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { if (DBG) Log.d(TAG, "Proxy object disconnected"); mService = null; if (mServiceListener != null) { mServiceListener.onServiceDisconnected(BluetoothProfile.INPUT_DEVICE); mServiceListener.onServiceDisconnected(BluetoothProfile.HID_HOST); } } }; Loading @@ -542,7 +542,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean virtualUnplug(BluetoothDevice device) { if (DBG) log("virtualUnplug(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.virtualUnplug(device); Loading @@ -568,7 +568,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean getProtocolMode(BluetoothDevice device) { if (VDBG) log("getProtocolMode(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getProtocolMode(device); Loading @@ -592,7 +592,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean setProtocolMode(BluetoothDevice device, int protocolMode) { if (DBG) log("setProtocolMode(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.setProtocolMode(device, protocolMode); Loading Loading @@ -623,7 +623,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { log("getReport(" + device + "), reportType=" + reportType + " reportId=" + reportId + "bufferSize=" + bufferSize); } final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getReport(device, reportType, reportId, bufferSize); Loading @@ -649,7 +649,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean setReport(BluetoothDevice device, byte reportType, String report) { if (VDBG) log("setReport(" + device + "), reportType=" + reportType + " report=" + report); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.setReport(device, reportType, report); Loading @@ -674,7 +674,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean sendData(BluetoothDevice device, String report) { if (DBG) log("sendData(" + device + "), report=" + report); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.sendData(device, report); Loading @@ -698,7 +698,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean getIdleTime(BluetoothDevice device) { if (DBG) log("getIdletime(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getIdleTime(device); Loading @@ -723,7 +723,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean setIdleTime(BluetoothDevice device, byte idleTime) { if (DBG) log("setIdletime(" + device + "), idleTime=" + idleTime); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.setIdleTime(device, idleTime); Loading Loading
Android.mk +2 −2 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ LOCAL_SRC_FILES += \ ../../system/bt/binder/android/bluetooth/IBluetoothHeadsetPhone.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHealth.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHealthCallback.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothInputDevice.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHidHost.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothPan.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothManager.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothManagerCallback.aidl \ Loading @@ -139,7 +139,7 @@ LOCAL_SRC_FILES += \ ../../system/bt/binder/android/bluetooth/IBluetoothSap.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothStateChangeCallback.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHeadsetClient.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothInputHost.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHidDevice.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothHidDeviceCallback.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothGatt.aidl \ ../../system/bt/binder/android/bluetooth/IBluetoothGattCallback.aidl \ Loading
config/compiled-classes-phone +6 −6 Original line number Diff line number Diff line Loading @@ -721,9 +721,9 @@ android.bluetooth.BluetoothHeadset$1 android.bluetooth.BluetoothHeadset$2 android.bluetooth.BluetoothHeadset$3 android.bluetooth.BluetoothHealthAppConfiguration android.bluetooth.BluetoothInputDevice android.bluetooth.BluetoothInputDevice$1 android.bluetooth.BluetoothInputDevice$2 android.bluetooth.BluetoothHidHost android.bluetooth.BluetoothHidHost$1 android.bluetooth.BluetoothHidHost$2 android.bluetooth.BluetoothInputStream android.bluetooth.BluetoothManager android.bluetooth.BluetoothMap Loading Loading @@ -766,9 +766,9 @@ android.bluetooth.IBluetoothHeadsetPhone$Stub$Proxy android.bluetooth.IBluetoothHealth android.bluetooth.IBluetoothHealth$Stub android.bluetooth.IBluetoothHealthCallback android.bluetooth.IBluetoothInputDevice android.bluetooth.IBluetoothInputDevice$Stub android.bluetooth.IBluetoothInputDevice$Stub$Proxy android.bluetooth.IBluetoothHidHost android.bluetooth.IBluetoothHidHost$Stub android.bluetooth.IBluetoothHidHost$Stub$Proxy android.bluetooth.IBluetoothManager android.bluetooth.IBluetoothManager$Stub android.bluetooth.IBluetoothManager$Stub$Proxy Loading
core/java/android/bluetooth/BluetoothAdapter.java +9 −9 Original line number Diff line number Diff line Loading @@ -2104,8 +2104,8 @@ public final class BluetoothAdapter { } else if (profile == BluetoothProfile.AVRCP_CONTROLLER) { BluetoothAvrcpController avrcp = new BluetoothAvrcpController(context, listener); return true; } else if (profile == BluetoothProfile.INPUT_DEVICE) { BluetoothInputDevice iDev = new BluetoothInputDevice(context, listener); } else if (profile == BluetoothProfile.HID_HOST) { BluetoothHidHost iDev = new BluetoothHidHost(context, listener); return true; } else if (profile == BluetoothProfile.PAN) { BluetoothPan pan = new BluetoothPan(context, listener); Loading @@ -2128,8 +2128,8 @@ public final class BluetoothAdapter { } else if (profile == BluetoothProfile.MAP_CLIENT) { BluetoothMapClient mapClient = new BluetoothMapClient(context, listener); return true; } else if (profile == BluetoothProfile.INPUT_HOST) { BluetoothInputHost iHost = new BluetoothInputHost(context, listener); } else if (profile == BluetoothProfile.HID_DEVICE) { BluetoothHidDevice hidDevice = new BluetoothHidDevice(context, listener); return true; } else { return false; Loading Loading @@ -2167,8 +2167,8 @@ public final class BluetoothAdapter { BluetoothAvrcpController avrcp = (BluetoothAvrcpController) proxy; avrcp.close(); break; case BluetoothProfile.INPUT_DEVICE: BluetoothInputDevice iDev = (BluetoothInputDevice) proxy; case BluetoothProfile.HID_HOST: BluetoothHidHost iDev = (BluetoothHidHost) proxy; iDev.close(); break; case BluetoothProfile.PAN: Loading Loading @@ -2207,9 +2207,9 @@ public final class BluetoothAdapter { BluetoothMapClient mapClient = (BluetoothMapClient) proxy; mapClient.close(); break; case BluetoothProfile.INPUT_HOST: BluetoothInputHost iHost = (BluetoothInputHost) proxy; iHost.close(); case BluetoothProfile.HID_DEVICE: BluetoothHidDevice hidDevice = (BluetoothHidDevice) proxy; hidDevice.close(); break; } } Loading
core/java/android/bluetooth/BluetoothInputHost.java→core/java/android/bluetooth/BluetoothHidDevice.java +22 −22 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ import java.util.List; /** * @hide */ public final class BluetoothInputHost implements BluetoothProfile { public final class BluetoothHidDevice implements BluetoothProfile { private static final String TAG = BluetoothInputHost.class.getSimpleName(); private static final String TAG = BluetoothHidDevice.class.getSimpleName(); /** * Intent used to broadcast the change in connection state of the Input Loading @@ -57,7 +57,7 @@ public final class BluetoothInputHost implements BluetoothProfile { */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.inputhost.profile.action.CONNECTION_STATE_CHANGED"; "android.bluetooth.hiddevice.profile.action.CONNECTION_STATE_CHANGED"; /** * Constants representing device subclass. Loading Loading @@ -113,7 +113,7 @@ public final class BluetoothInputHost implements BluetoothProfile { private ServiceListener mServiceListener; private volatile IBluetoothInputHost mService; private volatile IBluetoothHidDevice mService; private BluetoothAdapter mAdapter; Loading Loading @@ -205,23 +205,23 @@ public final class BluetoothInputHost implements BluetoothProfile { private final ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { Log.d(TAG, "onServiceConnected()"); mService = IBluetoothInputHost.Stub.asInterface(service); mService = IBluetoothHidDevice.Stub.asInterface(service); if (mServiceListener != null) { mServiceListener.onServiceConnected(BluetoothProfile.INPUT_HOST, BluetoothInputHost.this); mServiceListener.onServiceConnected(BluetoothProfile.HID_DEVICE, BluetoothHidDevice.this); } } public void onServiceDisconnected(ComponentName className) { Log.d(TAG, "onServiceDisconnected()"); mService = null; if (mServiceListener != null) { mServiceListener.onServiceDisconnected(BluetoothProfile.INPUT_HOST); mServiceListener.onServiceDisconnected(BluetoothProfile.HID_DEVICE); } } }; BluetoothInputHost(Context context, ServiceListener listener) { Log.v(TAG, "BluetoothInputHost"); BluetoothHidDevice(Context context, ServiceListener listener) { Log.v(TAG, "BluetoothHidDevice"); mContext = context; mServiceListener = listener; Loading @@ -240,7 +240,7 @@ public final class BluetoothInputHost implements BluetoothProfile { } boolean doBind() { Intent intent = new Intent(IBluetoothInputHost.class.getName()); Intent intent = new Intent(IBluetoothHidDevice.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, Loading Loading @@ -285,7 +285,7 @@ public final class BluetoothInputHost implements BluetoothProfile { public List<BluetoothDevice> getConnectedDevices() { Log.v(TAG, "getConnectedDevices()"); final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { return service.getConnectedDevices(); Loading @@ -306,7 +306,7 @@ public final class BluetoothInputHost implements BluetoothProfile { public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { Log.v(TAG, "getDevicesMatchingConnectionStates(): states=" + Arrays.toString(states)); final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { return service.getDevicesMatchingConnectionStates(states); Loading @@ -327,7 +327,7 @@ public final class BluetoothInputHost implements BluetoothProfile { public int getConnectionState(BluetoothDevice device) { Log.v(TAG, "getConnectionState(): device=" + device); final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { return service.getConnectionState(device); Loading Loading @@ -367,7 +367,7 @@ public final class BluetoothInputHost implements BluetoothProfile { return false; } final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { BluetoothHidDeviceAppConfiguration config = Loading Loading @@ -401,7 +401,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.unregisterApp(config); Loading @@ -426,7 +426,7 @@ public final class BluetoothInputHost implements BluetoothProfile { public boolean sendReport(BluetoothDevice device, int id, byte[] data) { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.sendReport(device, id, data); Loading Loading @@ -454,7 +454,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.replyReport(device, type, id, data); Loading @@ -480,7 +480,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.reportError(device, error); Loading @@ -504,7 +504,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.unplug(device); Loading @@ -529,7 +529,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.connect(device); Loading @@ -553,7 +553,7 @@ public final class BluetoothInputHost implements BluetoothProfile { boolean result = false; final IBluetoothInputHost service = mService; final IBluetoothHidDevice service = mService; if (service != null) { try { result = service.disconnect(device); Loading
core/java/android/bluetooth/BluetoothInputDevice.java→core/java/android/bluetooth/BluetoothHidHost.java +35 −35 Original line number Diff line number Diff line Loading @@ -35,16 +35,16 @@ import java.util.List; * This class provides the public APIs to control the Bluetooth Input * Device Profile. * * <p>BluetoothInputDevice is a proxy object for controlling the Bluetooth * <p>BluetoothHidHost is a proxy object for controlling the Bluetooth * Service via IPC. Use {@link BluetoothAdapter#getProfileProxy} to get * the BluetoothInputDevice proxy object. * the BluetoothHidHost proxy object. * * <p>Each method is protected with its appropriate permission. * * @hide */ public final class BluetoothInputDevice implements BluetoothProfile { private static final String TAG = "BluetoothInputDevice"; public final class BluetoothHidHost implements BluetoothProfile { private static final String TAG = "BluetoothHidHost"; private static final boolean DBG = true; private static final boolean VDBG = false; Loading Loading @@ -177,52 +177,52 @@ public final class BluetoothInputDevice implements BluetoothProfile { * @hide */ public static final String EXTRA_PROTOCOL_MODE = "android.bluetooth.BluetoothInputDevice.extra.PROTOCOL_MODE"; "android.bluetooth.BluetoothHidHost.extra.PROTOCOL_MODE"; /** * @hide */ public static final String EXTRA_REPORT_TYPE = "android.bluetooth.BluetoothInputDevice.extra.REPORT_TYPE"; "android.bluetooth.BluetoothHidHost.extra.REPORT_TYPE"; /** * @hide */ public static final String EXTRA_REPORT_ID = "android.bluetooth.BluetoothInputDevice.extra.REPORT_ID"; "android.bluetooth.BluetoothHidHost.extra.REPORT_ID"; /** * @hide */ public static final String EXTRA_REPORT_BUFFER_SIZE = "android.bluetooth.BluetoothInputDevice.extra.REPORT_BUFFER_SIZE"; "android.bluetooth.BluetoothHidHost.extra.REPORT_BUFFER_SIZE"; /** * @hide */ public static final String EXTRA_REPORT = "android.bluetooth.BluetoothInputDevice.extra.REPORT"; public static final String EXTRA_REPORT = "android.bluetooth.BluetoothHidHost.extra.REPORT"; /** * @hide */ public static final String EXTRA_STATUS = "android.bluetooth.BluetoothInputDevice.extra.STATUS"; public static final String EXTRA_STATUS = "android.bluetooth.BluetoothHidHost.extra.STATUS"; /** * @hide */ public static final String EXTRA_VIRTUAL_UNPLUG_STATUS = "android.bluetooth.BluetoothInputDevice.extra.VIRTUAL_UNPLUG_STATUS"; "android.bluetooth.BluetoothHidHost.extra.VIRTUAL_UNPLUG_STATUS"; /** * @hide */ public static final String EXTRA_IDLE_TIME = "android.bluetooth.BluetoothInputDevice.extra.IDLE_TIME"; "android.bluetooth.BluetoothHidHost.extra.IDLE_TIME"; private Context mContext; private ServiceListener mServiceListener; private BluetoothAdapter mAdapter; private volatile IBluetoothInputDevice mService; private volatile IBluetoothHidHost mService; private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { Loading Loading @@ -254,10 +254,10 @@ public final class BluetoothInputDevice implements BluetoothProfile { }; /** * Create a BluetoothInputDevice proxy object for interacting with the local * Create a BluetoothHidHost proxy object for interacting with the local * Bluetooth Service which handles the InputDevice profile */ /*package*/ BluetoothInputDevice(Context context, ServiceListener l) { /*package*/ BluetoothHidHost(Context context, ServiceListener l) { mContext = context; mServiceListener = l; mAdapter = BluetoothAdapter.getDefaultAdapter(); Loading @@ -275,7 +275,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { } boolean doBind() { Intent intent = new Intent(IBluetoothInputDevice.class.getName()); Intent intent = new Intent(IBluetoothHidHost.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, Loading Loading @@ -331,7 +331,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.connect(device); Loading Loading @@ -371,7 +371,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.disconnect(device); Loading @@ -390,7 +390,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { @Override public List<BluetoothDevice> getConnectedDevices() { if (VDBG) log("getConnectedDevices()"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled()) { try { return service.getConnectedDevices(); Loading @@ -409,7 +409,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { @Override public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (VDBG) log("getDevicesMatchingStates()"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled()) { try { return service.getDevicesMatchingConnectionStates(states); Loading @@ -428,7 +428,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { @Override public int getConnectionState(BluetoothDevice device) { if (VDBG) log("getState(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getConnectionState(device); Loading Loading @@ -458,7 +458,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean setPriority(BluetoothDevice device, int priority) { if (DBG) log("setPriority(" + device + ", " + priority + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON) { Loading Loading @@ -490,7 +490,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public int getPriority(BluetoothDevice device) { if (VDBG) log("getPriority(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getPriority(device); Loading @@ -506,11 +506,11 @@ public final class BluetoothInputDevice implements BluetoothProfile { private final ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { if (DBG) Log.d(TAG, "Proxy object connected"); mService = IBluetoothInputDevice.Stub.asInterface(Binder.allowBlocking(service)); mService = IBluetoothHidHost.Stub.asInterface(Binder.allowBlocking(service)); if (mServiceListener != null) { mServiceListener.onServiceConnected(BluetoothProfile.INPUT_DEVICE, BluetoothInputDevice.this); mServiceListener.onServiceConnected(BluetoothProfile.HID_HOST, BluetoothHidHost.this); } } Loading @@ -518,7 +518,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { if (DBG) Log.d(TAG, "Proxy object disconnected"); mService = null; if (mServiceListener != null) { mServiceListener.onServiceDisconnected(BluetoothProfile.INPUT_DEVICE); mServiceListener.onServiceDisconnected(BluetoothProfile.HID_HOST); } } }; Loading @@ -542,7 +542,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean virtualUnplug(BluetoothDevice device) { if (DBG) log("virtualUnplug(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.virtualUnplug(device); Loading @@ -568,7 +568,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean getProtocolMode(BluetoothDevice device) { if (VDBG) log("getProtocolMode(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getProtocolMode(device); Loading @@ -592,7 +592,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean setProtocolMode(BluetoothDevice device, int protocolMode) { if (DBG) log("setProtocolMode(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.setProtocolMode(device, protocolMode); Loading Loading @@ -623,7 +623,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { log("getReport(" + device + "), reportType=" + reportType + " reportId=" + reportId + "bufferSize=" + bufferSize); } final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getReport(device, reportType, reportId, bufferSize); Loading @@ -649,7 +649,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean setReport(BluetoothDevice device, byte reportType, String report) { if (VDBG) log("setReport(" + device + "), reportType=" + reportType + " report=" + report); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.setReport(device, reportType, report); Loading @@ -674,7 +674,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean sendData(BluetoothDevice device, String report) { if (DBG) log("sendData(" + device + "), report=" + report); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.sendData(device, report); Loading @@ -698,7 +698,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean getIdleTime(BluetoothDevice device) { if (DBG) log("getIdletime(" + device + ")"); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.getIdleTime(device); Loading @@ -723,7 +723,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public boolean setIdleTime(BluetoothDevice device, byte idleTime) { if (DBG) log("setIdletime(" + device + "), idleTime=" + idleTime); final IBluetoothInputDevice service = mService; final IBluetoothHidHost service = mService; if (service != null && isEnabled() && isValidDevice(device)) { try { return service.setIdleTime(device, idleTime); Loading