Fix issue #5173952: Opening a Notification From Lock Screen...
...Should Skip Unsecure Lockscreen (ICS)
Also while I am in there, clean up logging of intent objects to include
even less sensitive information, while showing the true Intent in dump
output (since apps can't get to that).
Change-Id: I35fed714645b21e4304ba38a11ebb9c4c963538e
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 72cf26a..f44d038 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -5577,24 +5577,35 @@
@Override
public String toString() {
- StringBuilder b = new StringBuilder(128);
+ StringBuilder b = new StringBuilder(128);
b.append("Intent { ");
- toShortString(b, true, true);
+ toShortString(b, true, true, true);
b.append(" }");
return b.toString();
}
/** @hide */
- public String toShortString(boolean comp, boolean extras) {
- StringBuilder b = new StringBuilder(128);
- toShortString(b, comp, extras);
+ public String toInsecureString() {
+ StringBuilder b = new StringBuilder(128);
+
+ b.append("Intent { ");
+ toShortString(b, false, true, true);
+ b.append(" }");
+
return b.toString();
}
/** @hide */
- public void toShortString(StringBuilder b, boolean comp, boolean extras) {
+ public String toShortString(boolean secure, boolean comp, boolean extras) {
+ StringBuilder b = new StringBuilder(128);
+ toShortString(b, secure, comp, extras);
+ return b.toString();
+ }
+
+ /** @hide */
+ public void toShortString(StringBuilder b, boolean secure, boolean comp, boolean extras) {
boolean first = true;
if (mAction != null) {
b.append("act=").append(mAction);
@@ -5621,19 +5632,8 @@
}
first = false;
b.append("dat=");
- String scheme = mData.getScheme();
- if (scheme != null) {
- if (scheme.equalsIgnoreCase("tel")) {
- b.append("tel:xxx-xxx-xxxx");
- } else if (scheme.equalsIgnoreCase("sip")) {
- b.append("sip:xxxxxxxxxx");
- } else if (scheme.equalsIgnoreCase("sms")) {
- b.append("sms:xxx-xxx-xxxx");
- } else if (scheme.equalsIgnoreCase("smsto")) {
- b.append("smsto:xxx-xxx-xxxx");
- } else {
- b.append(mData);
- }
+ if (secure) {
+ b.append(mData.toSafeString());
} else {
b.append(mData);
}