Merge "Typo fixes in comments and minor code cleanups." into gingerbread

This commit is contained in:
Jake Hamby
2010-09-30 15:47:34 -07:00
committed by Android (Google) Code Review
17 changed files with 65 additions and 69 deletions

View File

@ -16,8 +16,6 @@
package android.bluetooth; package android.bluetooth;
import java.util.*;
/** /**
* The result of execution of an single AT command.<p> * The result of execution of an single AT command.<p>
* *

View File

@ -16,16 +16,13 @@
package android.bluetooth; package android.bluetooth;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import java.util.*; import java.util.*;
/** /**
* An AT (Hayes command) Parser based on (a subset of) the ITU-T V.250 standard. * An AT (Hayes command) Parser based on (a subset of) the ITU-T V.250 standard.
* <p> * <p>
* *
* Conforment with the subset of V.250 required for implementation of the * Conformant with the subset of V.250 required for implementation of the
* Bluetooth Headset and Handsfree Profiles, as per Bluetooth SIP * Bluetooth Headset and Handsfree Profiles, as per Bluetooth SIP
* specifications. Also implements some V.250 features not required by * specifications. Also implements some V.250 features not required by
* Bluetooth - such as chained commands.<p> * Bluetooth - such as chained commands.<p>
@ -48,7 +45,7 @@ import java.util.*;
* are no arguments for get commands. * are no arguments for get commands.
* <li>Set Command. For example "AT+VGM=14". The command name is "VGM", and * <li>Set Command. For example "AT+VGM=14". The command name is "VGM", and
* there is a single integer argument in this case. In the general case then * there is a single integer argument in this case. In the general case then
* can be zero or more arguments (comma deliminated) each of integer or string * can be zero or more arguments (comma delimited) each of integer or string
* form. * form.
* <li>Test Command. For example "AT+VGM=?. No arguments. * <li>Test Command. For example "AT+VGM=?. No arguments.
* </ul> * </ul>
@ -60,7 +57,7 @@ import java.util.*;
* headset/handsfree use this is acceptable, because they only use the basic * headset/handsfree use this is acceptable, because they only use the basic
* commands ATA and ATD, which are not allowed to be chained. For general V.250 * commands ATA and ATD, which are not allowed to be chained. For general V.250
* use we would need to improve this class to allow Basic command chaining - * use we would need to improve this class to allow Basic command chaining -
* however its tricky to get right becuase there is no deliminator for Basic * however it's tricky to get right because there is no delimiter for Basic
* command chaining.<p> * command chaining.<p>
* *
* Extended commands can be chained. For example:<p> * Extended commands can be chained. For example:<p>
@ -71,7 +68,7 @@ import java.util.*;
* AT+CIMI * AT+CIMI
* Except that only one final result code is return (although several * Except that only one final result code is return (although several
* intermediate responses may be returned), and as soon as one command in the * intermediate responses may be returned), and as soon as one command in the
* chain fails the rest are abandonded.<p> * chain fails the rest are abandoned.<p>
* *
* Handlers are registered by there command name via register(Char c, ...) or * Handlers are registered by there command name via register(Char c, ...) or
* register(String s, ...). Handlers for Basic command should be registered by * register(String s, ...). Handlers for Basic command should be registered by
@ -80,7 +77,7 @@ import java.util.*;
* *
* Refer to:<ul> * Refer to:<ul>
* <li>ITU-T Recommendation V.250 * <li>ITU-T Recommendation V.250
* <li>ETSI TS 127.007 (AT Comannd set for User Equipment, 3GPP TS 27.007) * <li>ETSI TS 127.007 (AT Command set for User Equipment, 3GPP TS 27.007)
* <li>Bluetooth Headset Profile Spec (K6) * <li>Bluetooth Headset Profile Spec (K6)
* <li>Bluetooth Handsfree Profile Spec (HFP 1.5) * <li>Bluetooth Handsfree Profile Spec (HFP 1.5)
* </ul> * </ul>
@ -188,7 +185,7 @@ public class AtParser {
} }
/** /**
* Break an argument string into individual arguments (comma deliminated). * Break an argument string into individual arguments (comma delimited).
* Integer arguments are turned into Integer objects. Otherwise a String * Integer arguments are turned into Integer objects. Otherwise a String
* object is used. * object is used.
*/ */
@ -212,7 +209,7 @@ public class AtParser {
} }
/** /**
* Return the index of the end of character after the last characeter in * Return the index of the end of character after the last character in
* the extended command name. Uses the V.250 spec for allowed command * the extended command name. Uses the V.250 spec for allowed command
* names. * names.
*/ */
@ -244,7 +241,7 @@ public class AtParser {
* Processes an incoming AT command line.<p> * Processes an incoming AT command line.<p>
* This method will invoke zero or one command handler methods for each * This method will invoke zero or one command handler methods for each
* command in the command line.<p> * command in the command line.<p>
* @param raw_input The AT input, without EOL deliminator (e.g. <CR>). * @param raw_input The AT input, without EOL delimiter (e.g. <CR>).
* @return Result object for this command line. This can be * @return Result object for this command line. This can be
* converted to a String[] response with toStrings(). * converted to a String[] response with toStrings().
*/ */
@ -297,8 +294,8 @@ public class AtParser {
if (c == '+') { if (c == '+') {
// Option 2: Extended Command // Option 2: Extended Command
// Search for first non-name character. Shortcircuit if we dont // Search for first non-name character. Short-circuit if
// handle this command name. // we don't handle this command name.
int i = findEndExtendedName(input, index + 1); int i = findEndExtendedName(input, index + 1);
String commandName = input.substring(index, i); String commandName = input.substring(index, i);
if (!mExtHandlers.containsKey(commandName)) { if (!mExtHandlers.containsKey(commandName)) {

View File

@ -285,7 +285,7 @@ public final class BluetoothAdapter {
private static final int ADDRESS_LENGTH = 17; private static final int ADDRESS_LENGTH = 17;
/** /**
* Lazyily initialized singleton. Guaranteed final after first object * Lazily initialized singleton. Guaranteed final after first object
* constructed. * constructed.
*/ */
private static BluetoothAdapter sAdapter; private static BluetoothAdapter sAdapter;
@ -410,7 +410,7 @@ public final class BluetoothAdapter {
* user action to turn off Bluetooth. * user action to turn off Bluetooth.
* <p>This gracefully shuts down all Bluetooth connections, stops Bluetooth * <p>This gracefully shuts down all Bluetooth connections, stops Bluetooth
* system services, and powers down the underlying Bluetooth hardware. * system services, and powers down the underlying Bluetooth hardware.
* <p class="caution"><strong>Bluetooth should never be disbled without * <p class="caution"><strong>Bluetooth should never be disabled without
* direct user consent</strong>. The {@link #disable()} method is * direct user consent</strong>. The {@link #disable()} method is
* provided only for applications that include a user interface for changing * provided only for applications that include a user interface for changing
* system settings, such as a "power manager" app.</p> * system settings, such as a "power manager" app.</p>
@ -876,8 +876,8 @@ public final class BluetoothAdapter {
public Pair<byte[], byte[]> readOutOfBandData() { public Pair<byte[], byte[]> readOutOfBandData() {
if (getState() != STATE_ON) return null; if (getState() != STATE_ON) return null;
try { try {
byte[] hash = new byte[16]; byte[] hash;
byte[] randomizer = new byte[16]; byte[] randomizer;
byte[] ret = mService.readOutOfBandData(); byte[] ret = mService.readOutOfBandData();

View File

@ -23,7 +23,7 @@ import android.os.Handler;
import android.util.Log; import android.util.Log;
/** /**
* Listen's for incoming RFCOMM connection for the headset / handsfree service. * Listens for incoming RFCOMM connection for the headset / handsfree service.
* *
* TODO: Use the new generic BluetoothSocket class instead of this legacy code * TODO: Use the new generic BluetoothSocket class instead of this legacy code
* *

View File

@ -34,8 +34,8 @@ import android.os.Parcelable;
* Bluetooth profiles or services are actually supported by a device. Accurate * Bluetooth profiles or services are actually supported by a device. Accurate
* service discovery is done through SDP requests, which are automatically * service discovery is done through SDP requests, which are automatically
* performed when creating an RFCOMM socket with {@link * performed when creating an RFCOMM socket with {@link
* BluetoothDevice#createRfcommSocketToServiceRecord(UUID)} and {@link * BluetoothDevice#createRfcommSocketToServiceRecord} and {@link
* BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,UUID)}</p> * BluetoothAdapter#listenUsingRfcommWithServiceRecord}</p>
* *
* <p>Use {@link BluetoothDevice#getBluetoothClass} to retrieve the class for * <p>Use {@link BluetoothDevice#getBluetoothClass} to retrieve the class for
* a remote device. * a remote device.

View File

@ -32,7 +32,7 @@ import java.util.UUID;
/** /**
* Represents a remote Bluetooth device. A {@link BluetoothDevice} lets you * Represents a remote Bluetooth device. A {@link BluetoothDevice} lets you
* create a connection with the repective device or query information about * create a connection with the respective device or query information about
* it, such as the name, address, class, and bonding state. * it, such as the name, address, class, and bonding state.
* *
* <p>This class is really just a thin wrapper for a Bluetooth hardware * <p>This class is really just a thin wrapper for a Bluetooth hardware
@ -48,7 +48,7 @@ import java.util.UUID;
* {@link BluetoothAdapter}) or get one from the set of bonded devices * {@link BluetoothAdapter}) or get one from the set of bonded devices
* returned by {@link BluetoothAdapter#getBondedDevices() * returned by {@link BluetoothAdapter#getBondedDevices()
* BluetoothAdapter.getBondedDevices()}. You can then open a * BluetoothAdapter.getBondedDevices()}. You can then open a
* {@link BluetoothSocket} for communciation with the remote device, using * {@link BluetoothSocket} for communication with the remote device, using
* {@link #createRfcommSocketToServiceRecord(UUID)}. * {@link #createRfcommSocketToServiceRecord(UUID)}.
* *
* <p class="note"><strong>Note:</strong> * <p class="note"><strong>Note:</strong>
@ -226,8 +226,8 @@ public final class BluetoothDevice implements Parcelable {
* <p>A shared link keys exists locally for the remote device, so * <p>A shared link keys exists locally for the remote device, so
* communication can be authenticated and encrypted. * communication can be authenticated and encrypted.
* <p><i>Being bonded (paired) with a remote device does not necessarily * <p><i>Being bonded (paired) with a remote device does not necessarily
* mean the device is currently connected. It just means that the ponding * mean the device is currently connected. It just means that the pending
* procedure was compeleted at some earlier time, and the link key is still * procedure was completed at some earlier time, and the link key is still
* stored locally, ready to use on the next connection. * stored locally, ready to use on the next connection.
* </i> * </i>
*/ */
@ -283,7 +283,7 @@ public final class BluetoothDevice implements Parcelable {
* not respond to pin request in time * not respond to pin request in time
* @hide */ * @hide */
public static final int UNBOND_REASON_AUTH_FAILED = 1; public static final int UNBOND_REASON_AUTH_FAILED = 1;
/** A bond attempt failed because the other side explicilty rejected /** A bond attempt failed because the other side explicitly rejected
* bonding * bonding
* @hide */ * @hide */
public static final int UNBOND_REASON_AUTH_REJECTED = 2; public static final int UNBOND_REASON_AUTH_REJECTED = 2;
@ -515,7 +515,7 @@ public final class BluetoothDevice implements Parcelable {
* Cancel an in-progress bonding request started with {@link #createBond}. * Cancel an in-progress bonding request started with {@link #createBond}.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
* *
* @return true on sucess, false on error * @return true on success, false on error
* @hide * @hide
*/ */
public boolean cancelBondProcess() { public boolean cancelBondProcess() {
@ -532,7 +532,7 @@ public final class BluetoothDevice implements Parcelable {
* authentication and encryption. * authentication and encryption.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}. * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
* *
* @return true on sucess, false on error * @return true on success, false on error
* @hide * @hide
*/ */
public boolean removeBond() { public boolean removeBond() {
@ -617,7 +617,7 @@ public final class BluetoothDevice implements Parcelable {
* with the UUIDs supported by the remote end. If there is an error * with the UUIDs supported by the remote end. If there is an error
* in getting the SDP records or if the process takes a long time, * in getting the SDP records or if the process takes a long time,
* an Intent is sent with the UUIDs that is currently present in the * an Intent is sent with the UUIDs that is currently present in the
* cache. Clients should use the {@link getUuids} to get UUIDs * cache. Clients should use the {@link #getUuids} to get UUIDs
* is SDP is not to be performed. * is SDP is not to be performed.
* *
* @return False if the sanity check fails, True if the process * @return False if the sanity check fails, True if the process
@ -693,7 +693,7 @@ public final class BluetoothDevice implements Parcelable {
* outgoing connection to this remote device on given channel. * outgoing connection to this remote device on given channel.
* <p>The remote device will be authenticated and communication on this * <p>The remote device will be authenticated and communication on this
* socket will be encrypted. * socket will be encrypted.
* <p>Use {@link BluetoothSocket#connect} to intiate the outgoing * <p>Use {@link BluetoothSocket#connect} to initiate the outgoing
* connection. * connection.
* <p>Valid RFCOMM channels are in range 1 to 30. * <p>Valid RFCOMM channels are in range 1 to 30.
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} * <p>Requires {@link android.Manifest.permission#BLUETOOTH}
@ -715,7 +715,7 @@ public final class BluetoothDevice implements Parcelable {
* <p>This is designed to be used with {@link * <p>This is designed to be used with {@link
* BluetoothAdapter#listenUsingRfcommWithServiceRecord} for peer-peer * BluetoothAdapter#listenUsingRfcommWithServiceRecord} for peer-peer
* Bluetooth applications. * Bluetooth applications.
* <p>Use {@link BluetoothSocket#connect} to intiate the outgoing * <p>Use {@link BluetoothSocket#connect} to initiate the outgoing
* connection. This will also perform an SDP lookup of the given uuid to * connection. This will also perform an SDP lookup of the given uuid to
* determine which channel to connect to. * determine which channel to connect to.
* <p>The remote device will be authenticated and communication on this * <p>The remote device will be authenticated and communication on this
@ -772,9 +772,9 @@ public final class BluetoothDevice implements Parcelable {
/** /**
* Check that a pin is valid and convert to byte array. * Check that a pin is valid and convert to byte array.
* *
* Bluetooth pin's are 1 to 16 bytes of UTF8 characters. * Bluetooth pin's are 1 to 16 bytes of UTF-8 characters.
* @param pin pin as java String * @param pin pin as java String
* @return the pin code as a UTF8 byte array, or null if it is an invalid * @return the pin code as a UTF-8 byte array, or null if it is an invalid
* Bluetooth pin. * Bluetooth pin.
* @hide * @hide
*/ */
@ -784,9 +784,9 @@ public final class BluetoothDevice implements Parcelable {
} }
byte[] pinBytes; byte[] pinBytes;
try { try {
pinBytes = pin.getBytes("UTF8"); pinBytes = pin.getBytes("UTF-8");
} catch (UnsupportedEncodingException uee) { } catch (UnsupportedEncodingException uee) {
Log.e(TAG, "UTF8 not supported?!?"); // this should not happen Log.e(TAG, "UTF-8 not supported?!?"); // this should not happen
return null; return null;
} }
if (pinBytes.length <= 0 || pinBytes.length > 16) { if (pinBytes.length <= 0 || pinBytes.length > 16) {

View File

@ -36,7 +36,8 @@ public interface BluetoothDevicePicker {
/** /**
* Broadcast when one BT device is selected from BT device picker screen. * Broadcast when one BT device is selected from BT device picker screen.
* Selected BT device address is contained in extra string {@link BluetoothIntent} * Selected {@link BluetoothDevice} is returned in extra data named
* {@link BluetoothDevice#EXTRA_DEVICE}.
*/ */
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_DEVICE_SELECTED = public static final String ACTION_DEVICE_SELECTED =

View File

@ -45,7 +45,7 @@ import android.util.Log;
* This BluetoothHeadset object is not immediately bound to the * This BluetoothHeadset object is not immediately bound to the
* BluetoothHeadset service. Use the ServiceListener interface to obtain a * BluetoothHeadset service. Use the ServiceListener interface to obtain a
* notification when it is bound, this is especially important if you wish to * notification when it is bound, this is especially important if you wish to
* immediately call methods on BluetootHeadset after construction. * immediately call methods on BluetoothHeadset after construction.
* *
* Android only supports one connected Bluetooth Headset at a time. * Android only supports one connected Bluetooth Headset at a time.
* *
@ -108,7 +108,7 @@ public final class BluetoothHeadset {
public static final int RESULT_FAILURE = 0; public static final int RESULT_FAILURE = 0;
public static final int RESULT_SUCCESS = 1; public static final int RESULT_SUCCESS = 1;
/** Connection canceled before completetion. */ /** Connection canceled before completion. */
public static final int RESULT_CANCELED = 2; public static final int RESULT_CANCELED = 2;
/** Values for {@link #EXTRA_DISCONNECT_INITIATOR} */ /** Values for {@link #EXTRA_DISCONNECT_INITIATOR} */
@ -116,11 +116,11 @@ public final class BluetoothHeadset {
public static final int LOCAL_DISCONNECT = 1; public static final int LOCAL_DISCONNECT = 1;
/** Default priority for headsets that for which we will accept /** Default priority for headsets for which we will accept
* inconing connections and auto-connect */ * incoming connections and auto-connect. */
public static final int PRIORITY_AUTO_CONNECT = 1000; public static final int PRIORITY_AUTO_CONNECT = 1000;
/** Default priority for headsets that for which we will accept /** Default priority for headsets for which we will accept
* inconing connections but not auto-connect */ * incoming connections but not auto-connect. */
public static final int PRIORITY_ON = 100; public static final int PRIORITY_ON = 100;
/** Default priority for headsets that should not be auto-connected /** Default priority for headsets that should not be auto-connected
* and not allow incoming connections. */ * and not allow incoming connections. */
@ -268,7 +268,7 @@ public final class BluetoothHeadset {
/** /**
* Disconnects the current headset. Currently this call blocks, it may soon * Disconnects the current headset. Currently this call blocks, it may soon
* be made asynchornous. Returns false if this proxy object is * be made asynchronous. Returns false if this proxy object is
* not currently connected to the Headset service. * not currently connected to the Headset service.
*/ */
public boolean disconnectHeadset(BluetoothDevice device) { public boolean disconnectHeadset(BluetoothDevice device) {

View File

@ -197,7 +197,7 @@ public class BluetoothPbap {
/** /**
* Disconnects the current Pbap client (PCE). Currently this call blocks, * Disconnects the current Pbap client (PCE). Currently this call blocks,
* it may soon be made asynchornous. Returns false if this proxy object is * it may soon be made asynchronous. Returns false if this proxy object is
* not currently connected to the Pbap service. * not currently connected to the Pbap service.
*/ */
public boolean disconnect() { public boolean disconnect() {

View File

@ -29,14 +29,14 @@ import java.io.IOException;
* side, use a {@link BluetoothServerSocket} to create a listening server * side, use a {@link BluetoothServerSocket} to create a listening server
* socket. When a connection is accepted by the {@link BluetoothServerSocket}, * socket. When a connection is accepted by the {@link BluetoothServerSocket},
* it will return a new {@link BluetoothSocket} to manage the connection. * it will return a new {@link BluetoothSocket} to manage the connection.
* On the client side, use a single {@link BluetoothSocket} to both intiate * On the client side, use a single {@link BluetoothSocket} to both initiate
* an outgoing connection and to manage the connection. * an outgoing connection and to manage the connection.
* *
* <p>The most common type of Bluetooth socket is RFCOMM, which is the type * <p>The most common type of Bluetooth socket is RFCOMM, which is the type
* supported by the Android APIs. RFCOMM is a connection-oriented, streaming * supported by the Android APIs. RFCOMM is a connection-oriented, streaming
* transport over Bluetooth. It is also known as the Serial Port Profile (SPP). * transport over Bluetooth. It is also known as the Serial Port Profile (SPP).
* *
* <p>To create a listenting {@link BluetoothServerSocket} that's ready for * <p>To create a listening {@link BluetoothServerSocket} that's ready for
* incoming connections, use * incoming connections, use
* {@link BluetoothAdapter#listenUsingRfcommWithServiceRecord * {@link BluetoothAdapter#listenUsingRfcommWithServiceRecord
* BluetoothAdapter.listenUsingRfcommWithServiceRecord()}. Then call * BluetoothAdapter.listenUsingRfcommWithServiceRecord()}. Then call
@ -70,7 +70,7 @@ public final class BluetoothServerSocket implements Closeable {
* @param encrypt require the connection to be encrypted * @param encrypt require the connection to be encrypted
* @param port remote port * @param port remote port
* @throws IOException On error, for example Bluetooth not available, or * @throws IOException On error, for example Bluetooth not available, or
* insufficient priveleges * insufficient privileges
*/ */
/*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port) /*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port)
throws IOException { throws IOException {

View File

@ -35,7 +35,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
* side, use a {@link BluetoothServerSocket} to create a listening server * side, use a {@link BluetoothServerSocket} to create a listening server
* socket. When a connection is accepted by the {@link BluetoothServerSocket}, * socket. When a connection is accepted by the {@link BluetoothServerSocket},
* it will return a new {@link BluetoothSocket} to manage the connection. * it will return a new {@link BluetoothSocket} to manage the connection.
* On the client side, use a single {@link BluetoothSocket} to both intiate * On the client side, use a single {@link BluetoothSocket} to both initiate
* an outgoing connection and to manage the connection. * an outgoing connection and to manage the connection.
* *
* <p>The most common type of Bluetooth socket is RFCOMM, which is the type * <p>The most common type of Bluetooth socket is RFCOMM, which is the type
@ -113,7 +113,7 @@ public final class BluetoothSocket implements Closeable {
* @param port remote port * @param port remote port
* @param uuid SDP uuid * @param uuid SDP uuid
* @throws IOException On error, for example Bluetooth not available, or * @throws IOException On error, for example Bluetooth not available, or
* insufficient priveleges * insufficient privileges
*/ */
/*package*/ BluetoothSocket(int type, int fd, boolean auth, boolean encrypt, /*package*/ BluetoothSocket(int type, int fd, boolean auth, boolean encrypt,
BluetoothDevice device, int port, ParcelUuid uuid) throws IOException { BluetoothDevice device, int port, ParcelUuid uuid) throws IOException {
@ -158,7 +158,7 @@ public final class BluetoothSocket implements Closeable {
* @param address remote device that this socket can connect to * @param address remote device that this socket can connect to
* @param port remote port * @param port remote port
* @throws IOException On error, for example Bluetooth not available, or * @throws IOException On error, for example Bluetooth not available, or
* insufficient priveleges * insufficient privileges
*/ */
private BluetoothSocket(int type, int fd, boolean auth, boolean encrypt, String address, private BluetoothSocket(int type, int fd, boolean auth, boolean encrypt, String address,
int port) throws IOException { int port) throws IOException {
@ -226,7 +226,7 @@ public final class BluetoothSocket implements Closeable {
} }
// all native calls are guaranteed to immediately return after // all native calls are guaranteed to immediately return after
// abortNative(), so this lock should immediatley acquire // abortNative(), so this lock should immediately acquire
mLock.writeLock().lock(); mLock.writeLock().lock();
try { try {
mClosed = true; mClosed = true;

View File

@ -89,7 +89,7 @@ public final class HeadsetBase {
initializeNativeDataNative(-1); initializeNativeDataNative(-1);
} }
/* Create from an already exisiting rfcomm connection */ /* Create from an already existing rfcomm connection */
public HeadsetBase(PowerManager pm, BluetoothAdapter adapter, BluetoothDevice device, public HeadsetBase(PowerManager pm, BluetoothAdapter adapter, BluetoothDevice device,
int socketFd, int rfcommChannel, Handler handler) { int socketFd, int rfcommChannel, Handler handler) {
mDirection = DIRECTION_INCOMING; mDirection = DIRECTION_INCOMING;
@ -128,7 +128,7 @@ public final class HeadsetBase {
(System.currentTimeMillis() - timestamp) + " ms"); (System.currentTimeMillis() - timestamp) + " ms");
if (result.getResultCode() == AtCommandResult.ERROR) { if (result.getResultCode() == AtCommandResult.ERROR) {
Log.i(TAG, "Error pocessing <" + input + ">"); Log.i(TAG, "Error processing <" + input + ">");
} }
sendURC(result.toString()); sendURC(result.toString());

View File

@ -34,7 +34,7 @@ import java.util.Set;
/** /**
* TODO: Move this to * TODO: Move this to
* java/services/com/android/server/BluetoothEventLoop.java * java/services/com/android/server/BluetoothEventLoop.java
* and make the contructor package private again. * and make the constructor package private again.
* *
* @hide * @hide
*/ */
@ -590,7 +590,7 @@ class BluetoothEventLoop {
private void onRestartRequired() { private void onRestartRequired() {
if (mBluetoothService.isEnabled()) { if (mBluetoothService.isEnabled()) {
Log.e(TAG, "*** A serious error occured (did bluetoothd crash?) - " + Log.e(TAG, "*** A serious error occurred (did bluetoothd crash?) - " +
"restarting Bluetooth ***"); "restarting Bluetooth ***");
mHandler.sendEmptyMessage(EVENT_RESTART_BLUETOOTH); mHandler.sendEmptyMessage(EVENT_RESTART_BLUETOOTH);
} }

View File

@ -464,7 +464,7 @@ public class BluetoothService extends IBluetooth.Stub {
// forked multiple times in a row, probably because there is // forked multiple times in a row, probably because there is
// some race in sdptool or bluez when operated in parallel. // some race in sdptool or bluez when operated in parallel.
// As a workaround, delay 500ms between each fork of sdptool. // As a workaround, delay 500ms between each fork of sdptool.
// TODO: Don't fork sdptool in order to regsiter service // TODO: Don't fork sdptool in order to register service
// records, use a DBUS call instead. // records, use a DBUS call instead.
switch (msg.arg1) { switch (msg.arg1) {
case 1: case 1:
@ -673,7 +673,7 @@ public class BluetoothService extends IBluetooth.Stub {
/** local cache of bonding state. /** local cache of bonding state.
/* we keep our own state to track the intermediate state BONDING, which /* we keep our own state to track the intermediate state BONDING, which
/* bluez does not track. /* bluez does not track.
* All addreses must be passed in upper case. * All addresses must be passed in upper case.
*/ */
public class BondState { public class BondState {
private final HashMap<String, Integer> mState = new HashMap<String, Integer>(); private final HashMap<String, Integer> mState = new HashMap<String, Integer>();
@ -932,7 +932,7 @@ public class BluetoothService extends IBluetooth.Stub {
} }
} }
// This function adds a bluetooth address to the auto pairing blacklis // This function adds a bluetooth address to the auto pairing blacklist
// file. These addresses are added to DynamicAddressBlacklistSection // file. These addresses are added to DynamicAddressBlacklistSection
private void updateAutoPairingData(String address) { private void updateAutoPairingData(String address) {
BufferedWriter out = null; BufferedWriter out = null;
@ -1062,7 +1062,7 @@ public class BluetoothService extends IBluetooth.Stub {
* a device discoverable; you need to call setMode() to make the device * a device discoverable; you need to call setMode() to make the device
* explicitly discoverable. * explicitly discoverable.
* *
* @param timeout_s The discoverable timeout in seconds. * @param timeout The discoverable timeout in seconds.
*/ */
public synchronized boolean setDiscoverableTimeout(int timeout) { public synchronized boolean setDiscoverableTimeout(int timeout) {
mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
@ -2083,12 +2083,12 @@ public class BluetoothService extends IBluetooth.Stub {
/*package*/ String getAddressFromObjectPath(String objectPath) { /*package*/ String getAddressFromObjectPath(String objectPath) {
String adapterObjectPath = getPropertyInternal("ObjectPath"); String adapterObjectPath = getPropertyInternal("ObjectPath");
if (adapterObjectPath == null || objectPath == null) { if (adapterObjectPath == null || objectPath == null) {
Log.e(TAG, "getAddressFromObjectPath: AdpaterObjectPath:" + adapterObjectPath + Log.e(TAG, "getAddressFromObjectPath: AdapterObjectPath:" + adapterObjectPath +
" or deviceObjectPath:" + objectPath + " is null"); " or deviceObjectPath:" + objectPath + " is null");
return null; return null;
} }
if (!objectPath.startsWith(adapterObjectPath)) { if (!objectPath.startsWith(adapterObjectPath)) {
Log.e(TAG, "getAddressFromObjectPath: AdpaterObjectPath:" + adapterObjectPath + Log.e(TAG, "getAddressFromObjectPath: AdapterObjectPath:" + adapterObjectPath +
" is not a prefix of deviceObjectPath:" + objectPath + " is not a prefix of deviceObjectPath:" + objectPath +
"bluetoothd crashed ?"); "bluetoothd crashed ?");
return null; return null;

View File

@ -171,7 +171,7 @@ public class GsmAlphabet {
* array cannot contain more than 255 septets. * array cannot contain more than 255 septets.
* *
* @param data The text string to encode. * @param data The text string to encode.
* @param header Optional header (includeing length byte) that precedes * @param header Optional header (including length byte) that precedes
* the encoded data, padded to septet boundary. * the encoded data, padded to septet boundary.
* @return Byte array containing header and encoded data. * @return Byte array containing header and encoded data.
*/ */
@ -204,7 +204,7 @@ public class GsmAlphabet {
* the packed septets. The returned array cannot contain more than 255 * the packed septets. The returned array cannot contain more than 255
* septets. * septets.
* *
* @param data the data string to endcode * @param data the data string to encode
* @throws EncodeException if String is too large to encode * @throws EncodeException if String is too large to encode
*/ */
public static byte[] stringToGsm7BitPacked(String data) public static byte[] stringToGsm7BitPacked(String data)
@ -223,7 +223,7 @@ public class GsmAlphabet {
* *
* @param data the text to convert to septets * @param data the text to convert to septets
* @param startingSeptetOffset the number of padding septets to put before * @param startingSeptetOffset the number of padding septets to put before
* the character data at the begining of the array * the character data at the beginning of the array
* @param throwException If true, throws EncodeException on invalid char. * @param throwException If true, throws EncodeException on invalid char.
* If false, replaces unencodable char with GSM alphabet space char. * If false, replaces unencodable char with GSM alphabet space char.
* *
@ -257,7 +257,7 @@ public class GsmAlphabet {
} }
/** /**
* Pack a 7-bit char into its appropirate place in a byte array * Pack a 7-bit char into its appropriate place in a byte array
* *
* @param bitOffset the bit offset that the septet should be packed at * @param bitOffset the bit offset that the septet should be packed at
* (septet index * 7) * (septet index * 7)

View File

@ -58,7 +58,7 @@ import static android.telephony.SmsMessage.MessageClass;
/** /**
* TODO(cleanup): internally returning null in many places makes * TODO(cleanup): internally returning null in many places makes
* debugging very hard (among many other reasons) and should be made * debugging very hard (among many other reasons) and should be made
* more meaningful (replaced with execptions for example). Null * more meaningful (replaced with exceptions for example). Null
* returns should only occur at the very outside of the module/class * returns should only occur at the very outside of the module/class
* scope. * scope.
*/ */
@ -614,7 +614,7 @@ public class SmsMessage extends SmsMessageBase {
* incrementing within the range 1..65535 remembering the state * incrementing within the range 1..65535 remembering the state
* via a persistent system property. (See C.S0015-B, v2.0, * via a persistent system property. (See C.S0015-B, v2.0,
* 4.3.1.5) Since this routine is expected to be accessed via via * 4.3.1.5) Since this routine is expected to be accessed via via
* binder-call, and hence should be threadsafe, it has been * binder-call, and hence should be thread-safe, it has been
* synchronized. * synchronized.
*/ */
private synchronized static int getNextMessageId() { private synchronized static int getNextMessageId() {

View File

@ -56,7 +56,7 @@ public class UserData {
* 0, with the resulting code of 0x20. * 0, with the resulting code of 0x20.
* *
* Note this mapping is also equivalent to that used by both the * Note this mapping is also equivalent to that used by both the
* IS5 and the IS-91 encodings. For the former this is defined * IA5 and the IS-91 encodings. For the former this is defined
* using CCITT Rec. T.50 Tables 1 and 3. For the latter IS 637 B, * using CCITT Rec. T.50 Tables 1 and 3. For the latter IS 637 B,
* Table 4.3.1.4.1-1 -- and note the encoding uses only 6 bits, * Table 4.3.1.4.1-1 -- and note the encoding uses only 6 bits,
* and hence only maps entries up to the '_' character. * and hence only maps entries up to the '_' character.