summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubin Xu <rubinxu@google.com>2016-08-23 22:29:15 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-08-23 22:29:15 +0000
commit8910bf2ca0a10d13f6b63301f157567ccefc36eb (patch)
tree9892f9bf3ae12f5aa51425cb0fc4a56c8be5faf5
parent4bb1cc1facc95aa89059c5aa42cf4227f4b3cc9b (diff)
parentf38514ccd666be39410bfff734ef6318979c3f05 (diff)
Merge "Handle null packageName in PendingIntentRecord" into nyc-mr1-dev am: 6acd5e7361 am: 2f6eecbed0
am: f38514ccd6 Change-Id: I1071a92b4ff74a57bf94c9b6aad9df4fb3852072
-rw-r--r--keystore/java/android/security/KeyChain.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/keystore/java/android/security/KeyChain.java b/keystore/java/android/security/KeyChain.java
index adfdfba6a33d..4fc789249c5c 100644
--- a/keystore/java/android/security/KeyChain.java
+++ b/keystore/java/android/security/KeyChain.java
@@ -20,6 +20,7 @@ import android.annotation.Nullable;
import android.annotation.WorkerThread;
import android.app.Activity;
import android.app.PendingIntent;
+import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -397,6 +398,9 @@ public final class KeyChain {
*
* <p> This method may block while waiting for a connection to another process, and must never
* be called from the main thread.
+ * <p> As {@link Activity} and {@link Service} contexts are short-lived and can be destroyed
+ * at any time from the main thread, it is safer to rely on a long-lived context such as one
+ * returned from {@link Context#getApplicationContext()}.
*
* @param alias The alias of the desired private key, typically returned via
* {@link KeyChainAliasCallback#alias}.
@@ -443,6 +447,9 @@ public final class KeyChain {
*
* <p> This method may block while waiting for a connection to another process, and must never
* be called from the main thread.
+ * <p> As {@link Activity} and {@link Service} contexts are short-lived and can be destroyed
+ * at any time from the main thread, it is safer to rely on a long-lived context such as one
+ * returned from {@link Context#getApplicationContext()}.
*
* @param alias The alias of the desired certificate chain, typically
* returned via {@link KeyChainAliasCallback#alias}.