Skip to content

Commit 69ea4e1

Browse files
committed
Documentation fixes found over vacation hacking.
Change-Id: I28900026465d66d950cf4f05f0c202b46c3c2d43
1 parent 8d98aeb commit 69ea4e1

File tree

8 files changed

+65
-42
lines changed

8 files changed

+65
-42
lines changed

core/java/android/app/AlertDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ public Builder setNeutralButton(CharSequence text, final OnClickListener listene
428428
}
429429

430430
/**
431-
* Sets whether the dialog is cancelable or not default is true.
431+
* Sets whether the dialog is cancelable or not. Default is true.
432432
*
433433
* @return This Builder object to allow for chaining of calls to set methods
434434
*/

core/java/android/database/sqlite/SQLiteDatabase.java

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,9 +1409,13 @@ public Cursor rawQuery(String sql, String[] selectionArgs,
14091409
* Convenience method for inserting a row into the database.
14101410
*
14111411
* @param table the table to insert the row into
1412-
* @param nullColumnHack SQL doesn't allow inserting a completely empty row,
1413-
* so if initialValues is empty this column will explicitly be
1414-
* assigned a NULL value
1412+
* @param nullColumnHack optional; may be <code>null</code>.
1413+
* SQL doesn't allow inserting a completely empty row without
1414+
* naming at least one column name. If your provided <code>values</code> is
1415+
* empty, no column names are known and an empty row can't be inserted.
1416+
* If not set to null, the <code>nullColumnHack</code> parameter
1417+
* provides the name of nullable column name to explicitly insert a NULL into
1418+
* in the case where your <code>values</code> is empty.
14151419
* @param values this map contains the initial column values for the
14161420
* row. The keys should be the column names and the values the
14171421
* column values
@@ -1430,9 +1434,13 @@ public long insert(String table, String nullColumnHack, ContentValues values) {
14301434
* Convenience method for inserting a row into the database.
14311435
*
14321436
* @param table the table to insert the row into
1433-
* @param nullColumnHack SQL doesn't allow inserting a completely empty row,
1434-
* so if initialValues is empty this column will explicitly be
1435-
* assigned a NULL value
1437+
* @param nullColumnHack optional; may be <code>null</code>.
1438+
* SQL doesn't allow inserting a completely empty row without
1439+
* naming at least one column name. If your provided <code>values</code> is
1440+
* empty, no column names are known and an empty row can't be inserted.
1441+
* If not set to null, the <code>nullColumnHack</code> parameter
1442+
* provides the name of nullable column name to explicitly insert a NULL into
1443+
* in the case where your <code>values</code> is empty.
14361444
* @param values this map contains the initial column values for the
14371445
* row. The keys should be the column names and the values the
14381446
* column values
@@ -1448,11 +1456,15 @@ public long insertOrThrow(String table, String nullColumnHack, ContentValues val
14481456
* Convenience method for replacing a row in the database.
14491457
*
14501458
* @param table the table in which to replace the row
1451-
* @param nullColumnHack SQL doesn't allow inserting a completely empty row,
1452-
* so if initialValues is empty this row will explicitly be
1453-
* assigned a NULL value
1459+
* @param nullColumnHack optional; may be <code>null</code>.
1460+
* SQL doesn't allow inserting a completely empty row without
1461+
* naming at least one column name. If your provided <code>initialValues</code> is
1462+
* empty, no column names are known and an empty row can't be inserted.
1463+
* If not set to null, the <code>nullColumnHack</code> parameter
1464+
* provides the name of nullable column name to explicitly insert a NULL into
1465+
* in the case where your <code>initialValues</code> is empty.
14541466
* @param initialValues this map contains the initial column values for
1455-
* the row. The key
1467+
* the row.
14561468
* @return the row ID of the newly inserted row, or -1 if an error occurred
14571469
*/
14581470
public long replace(String table, String nullColumnHack, ContentValues initialValues) {
@@ -1469,9 +1481,13 @@ public long replace(String table, String nullColumnHack, ContentValues initialVa
14691481
* Convenience method for replacing a row in the database.
14701482
*
14711483
* @param table the table in which to replace the row
1472-
* @param nullColumnHack SQL doesn't allow inserting a completely empty row,
1473-
* so if initialValues is empty this row will explicitly be
1474-
* assigned a NULL value
1484+
* @param nullColumnHack optional; may be <code>null</code>.
1485+
* SQL doesn't allow inserting a completely empty row without
1486+
* naming at least one column name. If your provided <code>initialValues</code> is
1487+
* empty, no column names are known and an empty row can't be inserted.
1488+
* If not set to null, the <code>nullColumnHack</code> parameter
1489+
* provides the name of nullable column name to explicitly insert a NULL into
1490+
* in the case where your <code>initialValues</code> is empty.
14751491
* @param initialValues this map contains the initial column values for
14761492
* the row. The key
14771493
* @throws SQLException
@@ -1487,9 +1503,13 @@ public long replaceOrThrow(String table, String nullColumnHack,
14871503
* General method for inserting a row into the database.
14881504
*
14891505
* @param table the table to insert the row into
1490-
* @param nullColumnHack SQL doesn't allow inserting a completely empty row,
1491-
* so if initialValues is empty this column will explicitly be
1492-
* assigned a NULL value
1506+
* @param nullColumnHack optional; may be <code>null</code>.
1507+
* SQL doesn't allow inserting a completely empty row without
1508+
* naming at least one column name. If your provided <code>initialValues</code> is
1509+
* empty, no column names are known and an empty row can't be inserted.
1510+
* If not set to null, the <code>nullColumnHack</code> parameter
1511+
* provides the name of nullable column name to explicitly insert a NULL into
1512+
* in the case where your <code>initialValues</code> is empty.
14931513
* @param initialValues this map contains the initial column values for the
14941514
* row. The keys should be the column names and the values the
14951515
* column values
@@ -1726,10 +1746,10 @@ public int updateWithOnConflict(String table, ContentValues values,
17261746

17271747
/**
17281748
* Execute a single SQL statement that is not a query. For example, CREATE
1729-
* TABLE, DELETE, INSERT, etc. Multiple statements separated by ;s are not
1730-
* supported. it takes a write lock
1749+
* TABLE, DELETE, INSERT, etc. Multiple statements separated by semicolons are not
1750+
* supported. Takes a write lock.
17311751
*
1732-
* @throws SQLException If the SQL string is invalid for some reason
1752+
* @throws SQLException if the SQL string is invalid
17331753
*/
17341754
public void execSQL(String sql) throws SQLException {
17351755
BlockGuard.getThreadPolicy().onWriteToDisk();
@@ -1760,12 +1780,12 @@ public void execSQL(String sql) throws SQLException {
17601780

17611781
/**
17621782
* Execute a single SQL statement that is not a query. For example, CREATE
1763-
* TABLE, DELETE, INSERT, etc. Multiple statements separated by ;s are not
1764-
* supported. it takes a write lock,
1783+
* TABLE, DELETE, INSERT, etc. Multiple statements separated by semicolons are not
1784+
* supported. Takes a write lock.
17651785
*
17661786
* @param sql
17671787
* @param bindArgs only byte[], String, Long and Double are supported in bindArgs.
1768-
* @throws SQLException If the SQL string is invalid for some reason
1788+
* @throws SQLException if the SQL string is invalid
17691789
*/
17701790
public void execSQL(String sql, Object[] bindArgs) throws SQLException {
17711791
BlockGuard.getThreadPolicy().onWriteToDisk();

core/java/android/hardware/Camera.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ public static class CameraInfo {
183183
* the right of the screen, the value should be 270.
184184
*
185185
* @see #setDisplayOrientation(int)
186-
* @see #setRotation(int)
187-
* @see #setPreviewSize(int, int)
188-
* @see #setPictureSize(int, int)
189-
* @see #setJpegThumbnailSize(int, int)
186+
* @see Parameters#setRotation(int)
187+
* @see Parameters#setPreviewSize(int, int)
188+
* @see Parameters#setPictureSize(int, int)
189+
* @see Parameters#setJpegThumbnailSize(int, int)
190190
*/
191191
public int orientation;
192192
};
@@ -609,9 +609,10 @@ private static void postEventFromNative(Object camera_ref,
609609
public interface AutoFocusCallback
610610
{
611611
/**
612-
* Called when the camera auto focus completes. If the camera does not
613-
* support auto-focus and autoFocus is called, onAutoFocus will be
614-
* called immediately with success.
612+
* Called when the camera auto focus completes. If the camera
613+
* does not support auto-focus and autoFocus is called,
614+
* onAutoFocus will be called immediately with a fake value of
615+
* <code>success</code> set to <code>true</code>.
615616
*
616617
* @param success true if focus was successful, false if otherwise
617618
* @param camera the Camera service object
@@ -785,12 +786,12 @@ public final void takePicture(ShutterCallback shutter, PictureCallback raw,
785786
* is, the image is reflected along the central vertical axis of the camera
786787
* sensor. So the users can see themselves as looking into a mirror.
787788
*
788-
* This does not affect the order of byte array passed in {@link
789+
* <p>This does not affect the order of byte array passed in {@link
789790
* PreviewCallback#onPreviewFrame}, JPEG pictures, or recorded videos. This
790791
* method is not allowed to be called during preview.
791792
*
792-
* If you want to make the camera image show in the same orientation as
793-
* the display, you can use the following code.<p>
793+
* <p>If you want to make the camera image show in the same orientation as
794+
* the display, you can use the following code.
794795
* <pre>
795796
* public static void setCameraDisplayOrientation(Activity activity,
796797
* int cameraId, android.hardware.Camera camera) {
@@ -1767,26 +1768,27 @@ private int pixelFormatForCameraFormat(String format) {
17671768
* the orientation in the EXIF header will be missing or 1 (row #0 is
17681769
* top and column #0 is left side).
17691770
*
1770-
* If applications want to rotate the picture to match the orientation
1771+
* <p>If applications want to rotate the picture to match the orientation
17711772
* of what users see, apps should use {@link
17721773
* android.view.OrientationEventListener} and {@link CameraInfo}.
17731774
* The value from OrientationEventListener is relative to the natural
17741775
* orientation of the device. CameraInfo.orientation is the angle
1775-
* between camera orientation and natural device orientation. The sum or
1776+
* between camera orientation and natural device orientation. The sum
17761777
* of the two is the rotation angle for back-facing camera. The
17771778
* difference of the two is the rotation angle for front-facing camera.
17781779
* Note that the JPEG pictures of front-facing cameras are not mirrored
17791780
* as in preview display.
17801781
*
1781-
* For example, suppose the natural orientation of the device is
1782+
* <p>For example, suppose the natural orientation of the device is
17821783
* portrait. The device is rotated 270 degrees clockwise, so the device
17831784
* orientation is 270. Suppose a back-facing camera sensor is mounted in
17841785
* landscape and the top side of the camera sensor is aligned with the
17851786
* right edge of the display in natural orientation. So the camera
17861787
* orientation is 90. The rotation should be set to 0 (270 + 90).
17871788
*
1788-
* The reference code is as follows.
1789+
* <p>The reference code is as follows.
17891790
*
1791+
* <pre>
17901792
* public void public void onOrientationChanged(int orientation) {
17911793
* if (orientation == ORIENTATION_UNKNOWN) return;
17921794
* android.hardware.Camera.CameraInfo info =
@@ -1801,6 +1803,7 @@ private int pixelFormatForCameraFormat(String format) {
18011803
* }
18021804
* mParameters.setRotation(rotation);
18031805
* }
1806+
* </pre>
18041807
*
18051808
* @param rotation The rotation angle in degrees relative to the
18061809
* orientation of the camera. Rotation can only be 0,

core/java/android/view/View.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9127,7 +9127,7 @@ public interface OnLongClickListener {
91279127
*
91289128
* @param v The view that was clicked and held.
91299129
*
9130-
* return True if the callback consumed the long click, false otherwise
9130+
* @return true if the callback consumed the long click, false otherwise.
91319131
*/
91329132
boolean onLongClick(View v);
91339133
}

docs/html/guide/appendix/faq/commontasks.jd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ and the {@link android.os.Handler} documentation.</p>
655655
and <code>STRIKE</code> (strikethrough).
656656
So, for example, in res/values/strings.xml you could declare this:<br />
657657
<code>&lt;resource&gt;<br />
658-
&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;id=&quot;@+id/styled_welcome_message&quot;&gt;We
658+
&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&nbsp;id=&quot;@+id/styled_welcome_message&quot;&gt;We
659659
are &lt;b&gt;&lt;i&gt;so&lt;/i&gt;&lt;/b&gt; glad to see you.&lt;/string&gt;<br />
660660
&lt;/resources&gt;</code></li>
661661
<li>To style text on the fly, or to add highlighting or more complex styling,

docs/html/resources/articles/contacts.jd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ disable aggregation altogether, as described in the sections below.</p>
107107
<p>When a raw contact is added or modified, the system looks for matching
108108
(overlapping) raw contacts with which to aggregate it. It may not find any
109109
matching raw contacts, in which case it will create an aggregate contact that
110-
contains just the original raw contact. If it finds a single match,it creates a
110+
contains just the original raw contact. If it finds a single match, it creates a
111111
new contact that contains the two raw contacts. And it may even find multiple
112112
similar raw contacts, in which case it chooses the closest match. </p>
113113

docs/html/resources/faq/commontasks.jd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ and the {@link android.os.Handler} documentation.</p>
655655
and <code>STRIKE</code> (strikethrough).
656656
So, for example, in res/values/strings.xml you could declare this:<br />
657657
<code>&lt;resource&gt;<br />
658-
&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;id=&quot;@+id/styled_welcome_message&quot;&gt;We
658+
&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&nbsp;id=&quot;@+id/styled_welcome_message&quot;&gt;We
659659
are &lt;b&gt;&lt;i&gt;so&lt;/i&gt;&lt;/b&gt; glad to see you.&lt;/string&gt;<br />
660660
&lt;/resources&gt;</code></li>
661661
<li>To style text on the fly, or to add highlighting or more complex styling,

graphics/java/android/graphics/drawable/Drawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public void setChangingConfigurations(int configs) {
202202

203203
/**
204204
* Return a mask of the configuration parameters for which this drawable
205-
* mau change, requiring that it be re-created. The default implementation
205+
* may change, requiring that it be re-created. The default implementation
206206
* returns whatever was provided through
207207
* {@link #setChangingConfigurations(int)} or 0 by default. Subclasses
208208
* may extend this to or in the changing configurations of any other

0 commit comments

Comments
 (0)