summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/callintent
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/dialer/callintent')
-rw-r--r--java/com/android/dialer/callintent/CallIntentBuilder.java7
-rw-r--r--java/com/android/dialer/callintent/CallIntentParser.java22
2 files changed, 19 insertions, 10 deletions
diff --git a/java/com/android/dialer/callintent/CallIntentBuilder.java b/java/com/android/dialer/callintent/CallIntentBuilder.java
index e5449c804..36ea907ff 100644
--- a/java/com/android/dialer/callintent/CallIntentBuilder.java
+++ b/java/com/android/dialer/callintent/CallIntentBuilder.java
@@ -160,4 +160,11 @@ public class CallIntentBuilder {
public static int getLightbringerButtonAppearInSearchCount() {
return lightbringerButtonAppearInSearchCount;
}
+
+ @VisibleForTesting(otherwise = VisibleForTesting.NONE)
+ public static void clearLightbringerCounts() {
+ lightbringerButtonAppearInCollapsedCallLogItemCount = 0;
+ lightbringerButtonAppearInExpandedCallLogItemCount = 0;
+ lightbringerButtonAppearInSearchCount = 0;
+ }
}
diff --git a/java/com/android/dialer/callintent/CallIntentParser.java b/java/com/android/dialer/callintent/CallIntentParser.java
index 01afce06d..336adb66b 100644
--- a/java/com/android/dialer/callintent/CallIntentParser.java
+++ b/java/com/android/dialer/callintent/CallIntentParser.java
@@ -19,12 +19,13 @@ package com.android.dialer.callintent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
+import com.android.dialer.common.LogUtil;
import com.android.dialer.protos.ProtoParsers;
/** Parses data for a call extra to get any dialer specific app data. */
public class CallIntentParser {
- static final String EXTRA_CALL_SPECIFIC_APP_DATA_WRAPPER =
- "com.android.dialer.callintent.CALL_SPECIFIC_APP_DATA_WRAPPER";
+
+
@Nullable
public static CallSpecificAppData getCallSpecificAppData(@Nullable Bundle extras) {
if (extras == null) {
@@ -35,19 +36,20 @@ public class CallIntentParser {
return null;
}
+ if (extras.getByteArray(Constants.EXTRA_CALL_SPECIFIC_APP_DATA) == null) {
+ LogUtil.i(
+ "CallIntentParser.getCallSpecificAppData",
+ "unexpected null byte array for call specific app data proto");
+ return null;
+ }
+
return ProtoParsers.getTrusted(
- extras.getBundle(Constants.EXTRA_CALL_SPECIFIC_APP_DATA),
- EXTRA_CALL_SPECIFIC_APP_DATA_WRAPPER,
- CallSpecificAppData.getDefaultInstance());
+ extras, Constants.EXTRA_CALL_SPECIFIC_APP_DATA, CallSpecificAppData.getDefaultInstance());
}
public static void putCallSpecificAppData(
@NonNull Bundle extras, @NonNull CallSpecificAppData callSpecificAppData) {
- // We wrap our bundle for consumers that may not have access to ProtoParsers in their class
- // loader. This is necessary to prevent ClassNotFoundException's
- Bundle wrapperBundle = new Bundle();
- ProtoParsers.put(wrapperBundle, EXTRA_CALL_SPECIFIC_APP_DATA_WRAPPER, callSpecificAppData);
- extras.putBundle(Constants.EXTRA_CALL_SPECIFIC_APP_DATA, wrapperBundle);
+ ProtoParsers.put(extras, Constants.EXTRA_CALL_SPECIFIC_APP_DATA, callSpecificAppData);
}
private CallIntentParser() {}