Merge change 6183 into donut

* changes:
  Fix null data handling in ServiceCommand.writeCommand()
This commit is contained in:
Android (Google) Code Review
2009-07-03 02:52:55 -07:00

View File

@@ -140,7 +140,7 @@ public class ServiceCommand {
private boolean writeCommand(int cmd, String _data) { private boolean writeCommand(int cmd, String _data) {
byte buf[] = new byte[8]; byte buf[] = new byte[8];
byte[] data = _data.getBytes(); byte[] data = (_data == null) ? new byte[0] : _data.getBytes();
int len = data.length; int len = data.length;
// the length of data // the length of data
buf[0] = (byte) (len & 0xff); buf[0] = (byte) (len & 0xff);