Fix documentation errors
Fix typos.
Fix javadoc error.
Fix wrong instructions about new returning null.
Change-Id: I76bca22e386839007fc99667b07649a4ced4180f
diff --git a/core/java/android/view/SurfaceHolder.java b/core/java/android/view/SurfaceHolder.java
index 1b242b3..2a16725 100644
--- a/core/java/android/view/SurfaceHolder.java
+++ b/core/java/android/view/SurfaceHolder.java
@@ -25,9 +25,10 @@
* monitor changes to the surface. This interface is typically available
* through the {@link SurfaceView} class.
*
- * <p>When using this interface from a thread different than the one running
+ * <p>When using this interface from a thread other than the one running
* its {@link SurfaceView}, you will want to carefully read the
- * {@link #lockCanvas} and {@link Callback#surfaceCreated Callback.surfaceCreated}.
+ * methods
+ * {@link #lockCanvas} and {@link Callback#surfaceCreated Callback.surfaceCreated()}.
*/
public interface SurfaceHolder {
@@ -46,7 +47,7 @@
/**
* Exception that is thrown from {@link #lockCanvas} when called on a Surface
- * whose is SURFACE_TYPE_PUSH_BUFFERS.
+ * whose type is SURFACE_TYPE_PUSH_BUFFERS.
*/
public static class BadSurfaceTypeException extends RuntimeException {
public BadSurfaceTypeException() {
@@ -62,7 +63,7 @@
* changes to the surface. When used with a {@link SurfaceView}, the
* Surface being held is only available between calls to
* {@link #surfaceCreated(SurfaceHolder)} and
- * {@link #surfaceDestroyed(SurfaceHolder). The Callback is set with
+ * {@link #surfaceDestroyed(SurfaceHolder)}. The Callback is set with
* {@link SurfaceHolder#addCallback SurfaceHolder.addCallback} method.
*/
public interface Callback {
@@ -110,7 +111,7 @@
/**
* Called when the application needs to redraw the content of its
* surface, after it is resized or for some other reason. By not
- * returning here until the redraw is complete, you can ensure that
+ * returning from here until the redraw is complete, you can ensure that
* the user will not see your surface in a bad state (at its new
* size before it has been correctly drawn that way). This will
* typically be preceeded by a call to {@link #surfaceChanged}.
@@ -122,7 +123,7 @@
/**
* Add a Callback interface for this holder. There can several Callback
- * interfaces associated to a holder.
+ * interfaces associated with a holder.
*
* @param callback The new Callback interface.
*/
@@ -187,7 +188,7 @@
* surface is displayed. The default is false, allowing it to turn off.
* This is safe to call from any thread.
*
- * @param screenOn Supply to true to force the screen to stay on, false
+ * @param screenOn Set to true to force the screen to stay on, false
* to allow it to turn off.
*/
public void setKeepScreenOn(boolean screenOn);
@@ -195,14 +196,14 @@
/**
* Start editing the pixels in the surface. The returned Canvas can be used
* to draw into the surface's bitmap. A null is returned if the surface has
- * not been created or otherwise can not be edited. You will usually need
+ * not been created or otherwise cannot be edited. You will usually need
* to implement {@link Callback#surfaceCreated Callback.surfaceCreated}
* to find out when the Surface is available for use.
*
* <p>The content of the Surface is never preserved between unlockCanvas() and
* lockCanvas(), for this reason, every pixel within the Surface area
* must be written. The only exception to this rule is when a dirty
- * rectangle is specified, in which case, non dirty pixels will be
+ * rectangle is specified, in which case, non-dirty pixels will be
* preserved.
*
* <p>If you call this repeatedly when the Surface is not ready (before
@@ -213,7 +214,7 @@
* <p>If null is not returned, this function internally holds a lock until
* the corresponding {@link #unlockCanvasAndPost} call, preventing
* {@link SurfaceView} from creating, destroying, or modifying the surface
- * while it is being drawn. This can be more convenience than accessing
+ * while it is being drawn. This can be more convenient than accessing
* the Surface directly, as you do not need to do special synchronization
* with a drawing thread in {@link Callback#surfaceDestroyed
* Callback.surfaceDestroyed}.
@@ -224,7 +225,7 @@
/**
- * Just like {@link #lockCanvas()} but allows to specify a dirty rectangle.
+ * Just like {@link #lockCanvas()} but allows specification of a dirty rectangle.
* Every
* pixel within that rectangle must be written; however pixels outside
* the dirty rectangle will be preserved by the next call to lockCanvas().