diff options
author | roldenburg <roldenburg@google.com> | 2017-06-21 12:15:03 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-06-21 13:49:44 -0700 |
commit | 64ba7ccfacc75e0733de64c4df2be9f25aa811cb (patch) | |
tree | 1fa52bfc077ac8f72708a4bc7162978d642206f6 /java | |
parent | 22edf57d65dd1382128df841d7bfc4c74dc17814 (diff) |
Make Lightbringer getPackageName Nullable
An empty string isn't as clear and can lead to incorrectly matching other
intents when just comparing package names.
PiperOrigin-RevId: 159725546
Change-Id: I2943b3569fb6409f5c69deb2032f3d8248f6c14d
Diffstat (limited to 'java')
3 files changed, 4 insertions, 4 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 79c00e483..b8b029f7b 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -877,7 +877,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder // We check to see if we are starting a Lightbringer intent. The reason is Lightbringer // intents need to be started using startActivityForResult instead of the usual startActivity String packageName = intent.getPackage(); - if (getLightbringer().getPackageName().equals(packageName)) { + if (packageName != null && packageName.equals(getLightbringer().getPackageName())) { startLightbringerActivity(intent); } else if (CallDetailsActivity.isLaunchIntent(intent)) { PerformanceReport.recordClick(UiAction.Type.OPEN_CALL_DETAIL); diff --git a/java/com/android/dialer/lightbringer/Lightbringer.java b/java/com/android/dialer/lightbringer/Lightbringer.java index 510f8a9a7..669e571a0 100644 --- a/java/com/android/dialer/lightbringer/Lightbringer.java +++ b/java/com/android/dialer/lightbringer/Lightbringer.java @@ -53,7 +53,7 @@ public interface Lightbringer { @MainThread PhoneAccountHandle getPhoneAccountHandle(); - @NonNull + @Nullable @MainThread String getPackageName(); } diff --git a/java/com/android/dialer/lightbringer/stub/LightbringerStub.java b/java/com/android/dialer/lightbringer/stub/LightbringerStub.java index c835fea0f..1cb3c1ff0 100644 --- a/java/com/android/dialer/lightbringer/stub/LightbringerStub.java +++ b/java/com/android/dialer/lightbringer/stub/LightbringerStub.java @@ -92,9 +92,9 @@ public class LightbringerStub implements Lightbringer { return null; } - @NonNull + @Nullable @Override public String getPackageName() { - return ""; + return null; } } |