aboutsummaryrefslogtreecommitdiff
path: root/java/com
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2021-03-14 14:15:28 +0100
committerMichael W <baddaemon87@gmail.com>2021-03-14 14:56:52 +0100
commitb8c4d4cd8614d1050d4e8cf8008cb7ec96f6d2af (patch)
treeae374c0965d153e0557d0d02796b68973d15adcb /java/com
parentff3f9e7f9f61d3f1b0e0b4c3af60fa2095833d0d (diff)
downloadDialer-b8c4d4cd8614d1050d4e8cf8008cb7ec96f6d2af.tar.gz
Dialer: Move assertion to top of method
* Instead of using the number unchecked in various places and fail later when the value is null, move the assertion to the top of the method so we don't have to do all the work in between when we fail it anyway * Also change the occurances of getPhoneNumber() so we don't have to call into that various times instead of once Change-Id: Ibf7ab971dc1ee65e3d8bcc7668e9f9c8c3a30651
Diffstat (limited to 'java/com')
-rw-r--r--java/com/android/dialer/postcall/PostCall.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/com/android/dialer/postcall/PostCall.java b/java/com/android/dialer/postcall/PostCall.java
index 542b8d09c..376cb456b 100644
--- a/java/com/android/dialer/postcall/PostCall.java
+++ b/java/com/android/dialer/postcall/PostCall.java
@@ -72,13 +72,14 @@ public class PostCall {
private static void promptUserToSendMessage(Activity activity, View rootView) {
LogUtil.i("PostCall.promptUserToSendMessage", "returned from call, showing post call SnackBar");
+ String number = Assert.isNotNull(getPhoneNumber(activity));
String message = activity.getString(R.string.post_call_message);
EnrichedCallManager manager = EnrichedCallComponent.get(activity).getEnrichedCallManager();
- EnrichedCallCapabilities capabilities = manager.getCapabilities(getPhoneNumber(activity));
+ EnrichedCallCapabilities capabilities = manager.getCapabilities(number);
LogUtil.i(
"PostCall.promptUserToSendMessage",
"number: %s, capabilities: %s",
- LogUtil.sanitizePhoneNumber(getPhoneNumber(activity)),
+ LogUtil.sanitizePhoneNumber(number),
capabilities);
boolean isRcsPostCall = capabilities != null && capabilities.isPostCallCapable();
@@ -87,7 +88,6 @@ public class PostCall {
? activity.getString(R.string.post_call_add_message)
: activity.getString(R.string.post_call_send_message);
- String number = Assert.isNotNull(getPhoneNumber(activity));
OnClickListener onClickListener =
v -> {
Logger.get(activity)