diff options
| -rw-r--r-- | docs/html/guide/topics/ui/notifiers/toasts.jd | 31 | ||||
| -rw-r--r-- | keystore/java/android/security/keystore/KeyGenParameterSpec.java | 28 |
2 files changed, 30 insertions, 29 deletions
diff --git a/docs/html/guide/topics/ui/notifiers/toasts.jd b/docs/html/guide/topics/ui/notifiers/toasts.jd index d9627274fa3e..2262a9ab9567 100644 --- a/docs/html/guide/topics/ui/notifiers/toasts.jd +++ b/docs/html/guide/topics/ui/notifiers/toasts.jd @@ -76,16 +76,22 @@ To nudge it down, increase the value of the last parameter. <h2 id="CustomToastView">Creating a Custom Toast View</h2> -<p>If a simple text message isn't enough, you can create a customized layout for your -toast notification. To create a custom layout, define a View layout, -in XML or in your application code, and pass the root {@link android.view.View} object -to the {@link android.widget.Toast#setView(View)} method.</p> - -<p>For example, you can create the layout for the toast visible in the screenshot to the right -with the following XML (saved as <em>toast_layout.xml</em>):</p> +<p> + If a simple text message isn't enough, you can create a customized layout + for your toast notification. To create a custom layout, define a View + layout, in XML or in your application code, and pass the root {@link + android.view.View} object to the {@link android.widget.Toast#setView(View)} + method. +</p> + +<p> + For example, you can create the layout for the toast visible in the + screenshot to the right with the following XML (saved as + <em>layout/custom_toast.xml</em>): +</p> <pre> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/toast_layout_root" + android:id="@+id/custom_toast_container" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" @@ -105,13 +111,16 @@ with the following XML (saved as <em>toast_layout.xml</em>):</p> </LinearLayout> </pre> -<p>Notice that the ID of the LinearLayout element is "toast_layout_root". You must use this -ID to inflate the layout from the XML, as shown here:</p> +<p> + Notice that the ID of the LinearLayout element is "custom_toast_container". + You must use this ID and the ID of the XML layout file "custom_toast" to + inflate the layout, as shown here: +</p> <pre> LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.custom_toast, - (ViewGroup) findViewById(R.id.toast_layout_root)); + (ViewGroup) findViewById(R.id.custom_toast_container)); TextView text = (TextView) layout.findViewById(R.id.text); text.setText("This is a custom toast"); diff --git a/keystore/java/android/security/keystore/KeyGenParameterSpec.java b/keystore/java/android/security/keystore/KeyGenParameterSpec.java index cbef540562e1..ed40b77be4a4 100644 --- a/keystore/java/android/security/keystore/KeyGenParameterSpec.java +++ b/keystore/java/android/security/keystore/KeyGenParameterSpec.java @@ -571,13 +571,12 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec { * * <p>If this method returns {@code null}, and the spec is used to generate an asymmetric (RSA * or EC) key pair, the public key will have a self-signed certificate if it has purpose {@link - * KeyProperties#PURPOSE_SIGN} (see {@link #KeyGenParameterSpec(String, int)). If does not have - * purpose {@link KeyProperties#PURPOSE_SIGN}, it will have a fake certificate. + * KeyProperties#PURPOSE_SIGN}. If does not have purpose {@link KeyProperties#PURPOSE_SIGN}, it + * will have a fake certificate. * * <p>Symmetric keys, such as AES and HMAC keys, do not have public key certificates. If a - * {@link KeyGenParameterSpec} with {@link #hasAttestationCertificate()} returning - * non-{@code null} is used to generate a symmetric (AES or HMAC) key, - * {@link KeyGenerator#generateKey())} will throw + * KeyGenParameterSpec with getAttestationChallenge returning non-null is used to generate a + * symmetric (AES or HMAC) key, {@link javax.crypto.KeyGenerator#generateKey()} will throw * {@link java.security.InvalidAlgorithmParameterException}. * * @see Builder#setAttestationChallenge(byte[]) @@ -1050,11 +1049,6 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec { return this; } - /* - * TODO(swillden): Update this documentation to describe the hardware and software root - * keys, including information about CRL/OCSP services for discovering revocations, and to - * link to documentation of the extension format and content. - */ /** * Sets whether an attestation certificate will be generated for this key pair, and what * challenge value will be placed in the certificate. The attestation certificate chain @@ -1074,17 +1068,15 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec { * * <p>If {@code attestationChallenge} is {@code null}, and this spec is used to generate an * asymmetric (RSA or EC) key pair, the public key certificate will be self-signed if the - * key has purpose {@link KeyProperties#PURPOSE_SIGN} (see - * {@link #KeyGenParameterSpec(String, int)). If the key does not have purpose - * {@link KeyProperties#PURPOSE_SIGN}, it is not possible to use the key to sign a - * certificate, so the public key certificate will contain a dummy signature. + * key has purpose {@link android.security.keystore.KeyProperties#PURPOSE_SIGN}. If the key + * does not have purpose {@link android.security.keystore.KeyProperties#PURPOSE_SIGN}, it is + * not possible to use the key to sign a certificate, so the public key certificate will + * contain a dummy signature. * * <p>Symmetric keys, such as AES and HMAC keys, do not have public key certificates. If a - * {@code getAttestationChallenge} returns non-{@code null} and the spec is used to - * generate a symmetric (AES or HMAC) key, {@link KeyGenerator#generateKey()} will throw + * {@link #getAttestationChallenge()} returns non-null and the spec is used to generate a + * symmetric (AES or HMAC) key, {@link javax.crypto.KeyGenerator#generateKey()} will throw * {@link java.security.InvalidAlgorithmParameterException}. - * - * @see Builder#setAttestationChallenge(String attestationChallenge) */ @NonNull public Builder setAttestationChallenge(byte[] attestationChallenge) { |