Merge "Typo fixes in comments and minor code cleanups." into gingerbread
This commit is contained in:
@ -16,8 +16,6 @@
|
||||
|
||||
package android.bluetooth;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* The result of execution of an single AT command.<p>
|
||||
*
|
||||
|
@ -16,16 +16,13 @@
|
||||
|
||||
package android.bluetooth;
|
||||
|
||||
import android.bluetooth.AtCommandHandler;
|
||||
import android.bluetooth.AtCommandResult;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* An AT (Hayes command) Parser based on (a subset of) the ITU-T V.250 standard.
|
||||
* <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
|
||||
* specifications. Also implements some V.250 features not required by
|
||||
* Bluetooth - such as chained commands.<p>
|
||||
@ -48,7 +45,7 @@ import java.util.*;
|
||||
* are no arguments for get commands.
|
||||
* <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
|
||||
* 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.
|
||||
* <li>Test Command. For example "AT+VGM=?. No arguments.
|
||||
* </ul>
|
||||
@ -60,7 +57,7 @@ import java.util.*;
|
||||
* 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
|
||||
* 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>
|
||||
*
|
||||
* Extended commands can be chained. For example:<p>
|
||||
@ -71,7 +68,7 @@ import java.util.*;
|
||||
* AT+CIMI
|
||||
* Except that only one final result code is return (although several
|
||||
* 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
|
||||
* register(String s, ...). Handlers for Basic command should be registered by
|
||||
@ -80,7 +77,7 @@ import java.util.*;
|
||||
*
|
||||
* Refer to:<ul>
|
||||
* <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 Handsfree Profile Spec (HFP 1.5)
|
||||
* </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
|
||||
* 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
|
||||
* names.
|
||||
*/
|
||||
@ -244,7 +241,7 @@ public class AtParser {
|
||||
* Processes an incoming AT command line.<p>
|
||||
* This method will invoke zero or one command handler methods for each
|
||||
* 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
|
||||
* converted to a String[] response with toStrings().
|
||||
*/
|
||||
@ -297,8 +294,8 @@ public class AtParser {
|
||||
|
||||
if (c == '+') {
|
||||
// Option 2: Extended Command
|
||||
// Search for first non-name character. Shortcircuit if we dont
|
||||
// handle this command name.
|
||||
// Search for first non-name character. Short-circuit if
|
||||
// we don't handle this command name.
|
||||
int i = findEndExtendedName(input, index + 1);
|
||||
String commandName = input.substring(index, i);
|
||||
if (!mExtHandlers.containsKey(commandName)) {
|
||||
|
@ -285,7 +285,7 @@ public final class BluetoothAdapter {
|
||||
private static final int ADDRESS_LENGTH = 17;
|
||||
|
||||
/**
|
||||
* Lazyily initialized singleton. Guaranteed final after first object
|
||||
* Lazily initialized singleton. Guaranteed final after first object
|
||||
* constructed.
|
||||
*/
|
||||
private static BluetoothAdapter sAdapter;
|
||||
@ -410,7 +410,7 @@ public final class BluetoothAdapter {
|
||||
* user action to turn off Bluetooth.
|
||||
* <p>This gracefully shuts down all Bluetooth connections, stops Bluetooth
|
||||
* 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
|
||||
* provided only for applications that include a user interface for changing
|
||||
* system settings, such as a "power manager" app.</p>
|
||||
@ -876,8 +876,8 @@ public final class BluetoothAdapter {
|
||||
public Pair<byte[], byte[]> readOutOfBandData() {
|
||||
if (getState() != STATE_ON) return null;
|
||||
try {
|
||||
byte[] hash = new byte[16];
|
||||
byte[] randomizer = new byte[16];
|
||||
byte[] hash;
|
||||
byte[] randomizer;
|
||||
|
||||
byte[] ret = mService.readOutOfBandData();
|
||||
|
||||
|
@ -23,7 +23,7 @@ import android.os.Handler;
|
||||
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
|
||||
*
|
||||
|
@ -34,8 +34,8 @@ import android.os.Parcelable;
|
||||
* Bluetooth profiles or services are actually supported by a device. Accurate
|
||||
* service discovery is done through SDP requests, which are automatically
|
||||
* performed when creating an RFCOMM socket with {@link
|
||||
* BluetoothDevice#createRfcommSocketToServiceRecord(UUID)} and {@link
|
||||
* BluetoothAdapter#listenUsingRfcommWithServiceRecord(String,UUID)}</p>
|
||||
* BluetoothDevice#createRfcommSocketToServiceRecord} and {@link
|
||||
* BluetoothAdapter#listenUsingRfcommWithServiceRecord}</p>
|
||||
*
|
||||
* <p>Use {@link BluetoothDevice#getBluetoothClass} to retrieve the class for
|
||||
* a remote device.
|
||||
|
@ -32,7 +32,7 @@ import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* <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
|
||||
* returned by {@link BluetoothAdapter#getBondedDevices()
|
||||
* 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)}.
|
||||
*
|
||||
* <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
|
||||
* communication can be authenticated and encrypted.
|
||||
* <p><i>Being bonded (paired) with a remote device does not necessarily
|
||||
* mean the device is currently connected. It just means that the ponding
|
||||
* procedure was compeleted at some earlier time, and the link key is still
|
||||
* mean the device is currently connected. It just means that the pending
|
||||
* procedure was completed at some earlier time, and the link key is still
|
||||
* stored locally, ready to use on the next connection.
|
||||
* </i>
|
||||
*/
|
||||
@ -283,7 +283,7 @@ public final class BluetoothDevice implements Parcelable {
|
||||
* not respond to pin request in time
|
||||
* @hide */
|
||||
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
|
||||
* @hide */
|
||||
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}.
|
||||
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
|
||||
*
|
||||
* @return true on sucess, false on error
|
||||
* @return true on success, false on error
|
||||
* @hide
|
||||
*/
|
||||
public boolean cancelBondProcess() {
|
||||
@ -532,7 +532,7 @@ public final class BluetoothDevice implements Parcelable {
|
||||
* authentication and encryption.
|
||||
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
|
||||
*
|
||||
* @return true on sucess, false on error
|
||||
* @return true on success, false on error
|
||||
* @hide
|
||||
*/
|
||||
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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
* <p>The remote device will be authenticated and communication on this
|
||||
* socket will be encrypted.
|
||||
* <p>Use {@link BluetoothSocket#connect} to intiate the outgoing
|
||||
* <p>Use {@link BluetoothSocket#connect} to initiate the outgoing
|
||||
* connection.
|
||||
* <p>Valid RFCOMM channels are in range 1 to 30.
|
||||
* <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
|
||||
* BluetoothAdapter#listenUsingRfcommWithServiceRecord} for peer-peer
|
||||
* 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
|
||||
* determine which channel to connect to.
|
||||
* <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.
|
||||
*
|
||||
* 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
|
||||
* @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.
|
||||
* @hide
|
||||
*/
|
||||
@ -784,9 +784,9 @@ public final class BluetoothDevice implements Parcelable {
|
||||
}
|
||||
byte[] pinBytes;
|
||||
try {
|
||||
pinBytes = pin.getBytes("UTF8");
|
||||
pinBytes = pin.getBytes("UTF-8");
|
||||
} 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;
|
||||
}
|
||||
if (pinBytes.length <= 0 || pinBytes.length > 16) {
|
||||
|
@ -36,7 +36,8 @@ public interface BluetoothDevicePicker {
|
||||
|
||||
/**
|
||||
* 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)
|
||||
public static final String ACTION_DEVICE_SELECTED =
|
||||
|
@ -45,7 +45,7 @@ import android.util.Log;
|
||||
* This BluetoothHeadset object is not immediately bound to the
|
||||
* BluetoothHeadset service. Use the ServiceListener interface to obtain a
|
||||
* 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.
|
||||
*
|
||||
@ -108,7 +108,7 @@ public final class BluetoothHeadset {
|
||||
|
||||
public static final int RESULT_FAILURE = 0;
|
||||
public static final int RESULT_SUCCESS = 1;
|
||||
/** Connection canceled before completetion. */
|
||||
/** Connection canceled before completion. */
|
||||
public static final int RESULT_CANCELED = 2;
|
||||
|
||||
/** Values for {@link #EXTRA_DISCONNECT_INITIATOR} */
|
||||
@ -116,11 +116,11 @@ public final class BluetoothHeadset {
|
||||
public static final int LOCAL_DISCONNECT = 1;
|
||||
|
||||
|
||||
/** Default priority for headsets that for which we will accept
|
||||
* inconing connections and auto-connect */
|
||||
/** Default priority for headsets for which we will accept
|
||||
* incoming connections and auto-connect. */
|
||||
public static final int PRIORITY_AUTO_CONNECT = 1000;
|
||||
/** Default priority for headsets that for which we will accept
|
||||
* inconing connections but not auto-connect */
|
||||
/** Default priority for headsets for which we will accept
|
||||
* incoming connections but not auto-connect. */
|
||||
public static final int PRIORITY_ON = 100;
|
||||
/** Default priority for headsets that should not be auto-connected
|
||||
* and not allow incoming connections. */
|
||||
@ -268,7 +268,7 @@ public final class BluetoothHeadset {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public boolean disconnectHeadset(BluetoothDevice device) {
|
||||
|
@ -197,7 +197,7 @@ public class BluetoothPbap {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public boolean disconnect() {
|
||||
|
@ -29,14 +29,14 @@ import java.io.IOException;
|
||||
* side, use a {@link BluetoothServerSocket} to create a listening server
|
||||
* socket. When a connection is accepted by the {@link BluetoothServerSocket},
|
||||
* 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.
|
||||
*
|
||||
* <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
|
||||
* 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
|
||||
* {@link BluetoothAdapter#listenUsingRfcommWithServiceRecord
|
||||
* BluetoothAdapter.listenUsingRfcommWithServiceRecord()}. Then call
|
||||
@ -70,7 +70,7 @@ public final class BluetoothServerSocket implements Closeable {
|
||||
* @param encrypt require the connection to be encrypted
|
||||
* @param port remote port
|
||||
* @throws IOException On error, for example Bluetooth not available, or
|
||||
* insufficient priveleges
|
||||
* insufficient privileges
|
||||
*/
|
||||
/*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port)
|
||||
throws IOException {
|
||||
|
@ -35,7 +35,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
* side, use a {@link BluetoothServerSocket} to create a listening server
|
||||
* socket. When a connection is accepted by the {@link BluetoothServerSocket},
|
||||
* 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.
|
||||
*
|
||||
* <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 uuid SDP uuid
|
||||
* @throws IOException On error, for example Bluetooth not available, or
|
||||
* insufficient priveleges
|
||||
* insufficient privileges
|
||||
*/
|
||||
/*package*/ BluetoothSocket(int type, int fd, boolean auth, boolean encrypt,
|
||||
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 port remote port
|
||||
* @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,
|
||||
int port) throws IOException {
|
||||
@ -226,7 +226,7 @@ public final class BluetoothSocket implements Closeable {
|
||||
}
|
||||
|
||||
// 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();
|
||||
try {
|
||||
mClosed = true;
|
||||
|
@ -89,7 +89,7 @@ public final class HeadsetBase {
|
||||
initializeNativeDataNative(-1);
|
||||
}
|
||||
|
||||
/* Create from an already exisiting rfcomm connection */
|
||||
/* Create from an already existing rfcomm connection */
|
||||
public HeadsetBase(PowerManager pm, BluetoothAdapter adapter, BluetoothDevice device,
|
||||
int socketFd, int rfcommChannel, Handler handler) {
|
||||
mDirection = DIRECTION_INCOMING;
|
||||
@ -128,7 +128,7 @@ public final class HeadsetBase {
|
||||
(System.currentTimeMillis() - timestamp) + " ms");
|
||||
|
||||
if (result.getResultCode() == AtCommandResult.ERROR) {
|
||||
Log.i(TAG, "Error pocessing <" + input + ">");
|
||||
Log.i(TAG, "Error processing <" + input + ">");
|
||||
}
|
||||
|
||||
sendURC(result.toString());
|
||||
|
@ -34,7 +34,7 @@ import java.util.Set;
|
||||
/**
|
||||
* TODO: Move this to
|
||||
* java/services/com/android/server/BluetoothEventLoop.java
|
||||
* and make the contructor package private again.
|
||||
* and make the constructor package private again.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@ -590,7 +590,7 @@ class BluetoothEventLoop {
|
||||
|
||||
private void onRestartRequired() {
|
||||
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 ***");
|
||||
mHandler.sendEmptyMessage(EVENT_RESTART_BLUETOOTH);
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ public class BluetoothService extends IBluetooth.Stub {
|
||||
// forked multiple times in a row, probably because there is
|
||||
// some race in sdptool or bluez when operated in parallel.
|
||||
// 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.
|
||||
switch (msg.arg1) {
|
||||
case 1:
|
||||
@ -673,7 +673,7 @@ public class BluetoothService extends IBluetooth.Stub {
|
||||
/** local cache of bonding state.
|
||||
/* we keep our own state to track the intermediate state BONDING, which
|
||||
/* bluez does not track.
|
||||
* All addreses must be passed in upper case.
|
||||
* All addresses must be passed in upper case.
|
||||
*/
|
||||
public class BondState {
|
||||
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
|
||||
private void updateAutoPairingData(String address) {
|
||||
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
|
||||
* explicitly discoverable.
|
||||
*
|
||||
* @param timeout_s The discoverable timeout in seconds.
|
||||
* @param timeout The discoverable timeout in seconds.
|
||||
*/
|
||||
public synchronized boolean setDiscoverableTimeout(int timeout) {
|
||||
mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
|
||||
@ -2083,12 +2083,12 @@ public class BluetoothService extends IBluetooth.Stub {
|
||||
/*package*/ String getAddressFromObjectPath(String objectPath) {
|
||||
String adapterObjectPath = getPropertyInternal("ObjectPath");
|
||||
if (adapterObjectPath == null || objectPath == null) {
|
||||
Log.e(TAG, "getAddressFromObjectPath: AdpaterObjectPath:" + adapterObjectPath +
|
||||
Log.e(TAG, "getAddressFromObjectPath: AdapterObjectPath:" + adapterObjectPath +
|
||||
" or deviceObjectPath:" + objectPath + " is null");
|
||||
return null;
|
||||
}
|
||||
if (!objectPath.startsWith(adapterObjectPath)) {
|
||||
Log.e(TAG, "getAddressFromObjectPath: AdpaterObjectPath:" + adapterObjectPath +
|
||||
Log.e(TAG, "getAddressFromObjectPath: AdapterObjectPath:" + adapterObjectPath +
|
||||
" is not a prefix of deviceObjectPath:" + objectPath +
|
||||
"bluetoothd crashed ?");
|
||||
return null;
|
||||
|
@ -171,7 +171,7 @@ public class GsmAlphabet {
|
||||
* array cannot contain more than 255 septets.
|
||||
*
|
||||
* @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.
|
||||
* @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
|
||||
* septets.
|
||||
*
|
||||
* @param data the data string to endcode
|
||||
* @param data the data string to encode
|
||||
* @throws EncodeException if String is too large to encode
|
||||
*/
|
||||
public static byte[] stringToGsm7BitPacked(String data)
|
||||
@ -223,7 +223,7 @@ public class GsmAlphabet {
|
||||
*
|
||||
* @param data the text to convert to septets
|
||||
* @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.
|
||||
* 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
|
||||
* (septet index * 7)
|
||||
|
@ -58,7 +58,7 @@ import static android.telephony.SmsMessage.MessageClass;
|
||||
/**
|
||||
* TODO(cleanup): internally returning null in many places makes
|
||||
* 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
|
||||
* scope.
|
||||
*/
|
||||
@ -614,7 +614,7 @@ public class SmsMessage extends SmsMessageBase {
|
||||
* incrementing within the range 1..65535 remembering the state
|
||||
* 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
|
||||
* binder-call, and hence should be threadsafe, it has been
|
||||
* binder-call, and hence should be thread-safe, it has been
|
||||
* synchronized.
|
||||
*/
|
||||
private synchronized static int getNextMessageId() {
|
||||
|
@ -56,7 +56,7 @@ public class UserData {
|
||||
* 0, with the resulting code of 0x20.
|
||||
*
|
||||
* 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,
|
||||
* Table 4.3.1.4.1-1 -- and note the encoding uses only 6 bits,
|
||||
* and hence only maps entries up to the '_' character.
|
||||
|
Reference in New Issue
Block a user