Typo fixes in comments and minor code cleanups.

* Fix some typos in Javadoc and log messages.
* Remove redundant initializer in BluetoothAdapter.readOutOfBandData()
* Use canonical "UTF-8" charset name instead of "UTF8" in
    BluetoothDevice.convertPinToBytes()

Change-Id: I58cd5dc48a7ad0053d204c5f590b4b3d438d8672
diff --git a/core/java/android/bluetooth/AtCommandResult.java b/core/java/android/bluetooth/AtCommandResult.java
index 638be2d..375a6dd 100644
--- a/core/java/android/bluetooth/AtCommandResult.java
+++ b/core/java/android/bluetooth/AtCommandResult.java
@@ -16,8 +16,6 @@
 
 package android.bluetooth;
 
-import java.util.*;
-
 /**
  * The result of execution of an single AT command.<p>
  *
diff --git a/core/java/android/bluetooth/AtParser.java b/core/java/android/bluetooth/AtParser.java
index 1ea3150..328fb2b 100644
--- a/core/java/android/bluetooth/AtParser.java
+++ b/core/java/android/bluetooth/AtParser.java
@@ -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 @@
  * 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 @@
  * 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 @@
  * 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 @@
  *
  * 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 @@
     }
 
     /**
-     * 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 @@
     }
 
     /**
-     * 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 @@
      * 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 @@
 
             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)) {
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 33fd395..3040319 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -285,7 +285,7 @@
     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 @@
      * 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 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();
 
diff --git a/core/java/android/bluetooth/BluetoothAudioGateway.java b/core/java/android/bluetooth/BluetoothAudioGateway.java
index bc32060..9351393 100644
--- a/core/java/android/bluetooth/BluetoothAudioGateway.java
+++ b/core/java/android/bluetooth/BluetoothAudioGateway.java
@@ -23,7 +23,7 @@
 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
  *
diff --git a/core/java/android/bluetooth/BluetoothClass.java b/core/java/android/bluetooth/BluetoothClass.java
index c7fea9e..6a878d7 100644
--- a/core/java/android/bluetooth/BluetoothClass.java
+++ b/core/java/android/bluetooth/BluetoothClass.java
@@ -34,8 +34,8 @@
  * 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.
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index e577ec4..ada3c24 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -32,7 +32,7 @@
 
 /**
  * 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 @@
  * {@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 @@
      * <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 @@
      * 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 @@
      * 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 @@
      * 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 @@
       *  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 @@
      * 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 @@
      * <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 @@
     /**
      * 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 @@
         }
         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) {
diff --git a/core/java/android/bluetooth/BluetoothDevicePicker.java b/core/java/android/bluetooth/BluetoothDevicePicker.java
index 05eed0e..3a07033 100644
--- a/core/java/android/bluetooth/BluetoothDevicePicker.java
+++ b/core/java/android/bluetooth/BluetoothDevicePicker.java
@@ -36,7 +36,8 @@
 
     /**
      * 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 =
diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java
index 4a91a8c..197b022 100644
--- a/core/java/android/bluetooth/BluetoothHeadset.java
+++ b/core/java/android/bluetooth/BluetoothHeadset.java
@@ -45,7 +45,7 @@
  * 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 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 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 @@
 
     /**
      * 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) {
diff --git a/core/java/android/bluetooth/BluetoothPbap.java b/core/java/android/bluetooth/BluetoothPbap.java
index b48f48e..4be077c 100644
--- a/core/java/android/bluetooth/BluetoothPbap.java
+++ b/core/java/android/bluetooth/BluetoothPbap.java
@@ -197,7 +197,7 @@
 
     /**
      * 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() {
diff --git a/core/java/android/bluetooth/BluetoothServerSocket.java b/core/java/android/bluetooth/BluetoothServerSocket.java
index c9c6c0a..83e59e2 100644
--- a/core/java/android/bluetooth/BluetoothServerSocket.java
+++ b/core/java/android/bluetooth/BluetoothServerSocket.java
@@ -29,14 +29,14 @@
  * 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 @@
      * @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 {
diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java
index ad03399..719d730 100644
--- a/core/java/android/bluetooth/BluetoothSocket.java
+++ b/core/java/android/bluetooth/BluetoothSocket.java
@@ -35,7 +35,7 @@
  * 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 @@
      * @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 @@
      * @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 @@
         }
 
         // 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;
diff --git a/core/java/android/bluetooth/HeadsetBase.java b/core/java/android/bluetooth/HeadsetBase.java
index e2935c9..22495a7 100644
--- a/core/java/android/bluetooth/HeadsetBase.java
+++ b/core/java/android/bluetooth/HeadsetBase.java
@@ -89,7 +89,7 @@
         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 @@
                        (System.currentTimeMillis() - timestamp) + " ms");
 
         if (result.getResultCode() == AtCommandResult.ERROR) {
-            Log.i(TAG, "Error pocessing <" + input + ">");
+            Log.i(TAG, "Error processing <" + input + ">");
         }
 
         sendURC(result.toString());
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index bcb151a..94f80cc 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -34,7 +34,7 @@
 /**
  * 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 @@
 
     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);
         }
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index dfe3a25..71b4ee2 100644
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -464,7 +464,7 @@
                 // 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 @@
     /** 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 @@
             }
         }
 
-        // 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 @@
      * 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 @@
     /*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;
diff --git a/telephony/java/com/android/internal/telephony/GsmAlphabet.java b/telephony/java/com/android/internal/telephony/GsmAlphabet.java
index 7edf065..30ee77c 100644
--- a/telephony/java/com/android/internal/telephony/GsmAlphabet.java
+++ b/telephony/java/com/android/internal/telephony/GsmAlphabet.java
@@ -171,7 +171,7 @@
      * 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 @@
      * 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 @@
      *
      * @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 @@
     }
 
     /**
-     * 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)
diff --git a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
index 0f3b8ff..6f024ed 100755
--- a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
@@ -58,7 +58,7 @@
 /**
  * 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 @@
      * 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() {
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/UserData.java b/telephony/java/com/android/internal/telephony/cdma/sms/UserData.java
index d93852c..189d97d 100644
--- a/telephony/java/com/android/internal/telephony/cdma/sms/UserData.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/UserData.java
@@ -56,7 +56,7 @@
      * 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.