CloudServices/NativeSync: Difference between revisions

Jump to navigation Jump to search
Line 159: Line 159:
We don't quite follow the [[Fennec/NativeUI/CodingStyle]]. See also [http://source.android.com/source/code-style.html the Android coding style].
We don't quite follow the [[Fennec/NativeUI/CodingStyle]]. See also [http://source.android.com/source/code-style.html the Android coding style].


=== Formatting Javadoc comments ===
Document all parameters and any return value; always start parameter and return value documentation lower case.  Please put one blank line after summary and before documenting parameters and return types.  Java is verbose enough already; please don't include type information unless it is truly useful.  Please don't include author lines; we have <tt>git blame</tt> and big sticks for that already.  Use paragraph, code, and list HTML tags when appropriate.
Eclipse will format Javadoc comments for you: select the entire comment and (by default) type <tt>Command-Shift-F</tt>.  This introduces trailing blanks; remove them by hand.  You can preview your formatted Javadoc by hovering over the function name in Eclipse.  Example:
<pre>
  /**
  * Generate a "plain" auth token.
  * <p>
  * Android caches only the value of the key
  * <code>AccountManager.KEY_AUTHTOKEN</code>, so if a caller needs the other
  * keys in this bundle, it needs to invalidate the token (so that the bundle
  * is re-generated).
  *
  * @param context
  *          Android context.
  * @param account
  *          Android account.
  * @return a <code>Bundle</code> instance containing a subset of the following
  *        keys: (caller's must check for missing keys)
  *        <ul>
  *        <li><code>AccountManager.KEY_ACCOUNT_TYPE</code>: the Android
  *        Account's type</li>
  *
  *        <li><code>AccountManager.KEY_ACCOUNT_NAME</code>: the Android
  *        Account's name</li>
  *
  *        <li><code>AccountManager.KEY_AUTHTOKEN</code>: the Sync account's
  *        password </li>
  *
  *        <li><code> Constants.OPTION_USERNAME</code>: the Sync account's
  *        hashed username</li>
  *
  *        <li><code>Constants.OPTION_SERVER</code>: the Sync account's
  *        server</li>
  *
  *        <li><code> Constants.OPTION_SYNCKEY</code>: the Sync account's
  *        sync key</li>
  *
  *        </ul>
  * @throws NetworkErrorException
  */
  public static Bundle getPlainAuthToken(final Context context, final Account account)
      throws NetworkErrorException {
    ...
  }
</pre>
=== Running unit test code coverage ===
=== Running unit test code coverage ===


Confirmed users
355

edits

Navigation menu