summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/CallerInfoUtils.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/java/com/android/incallui/CallerInfoUtils.java b/java/com/android/incallui/CallerInfoUtils.java
index 38043eda8..6f73f2f64 100644
--- a/java/com/android/incallui/CallerInfoUtils.java
+++ b/java/com/android/incallui/CallerInfoUtils.java
@@ -16,6 +16,8 @@
package com.android.incallui;
+import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
import android.content.Context;
import android.content.Loader;
import android.content.Loader.OnLoadCompleteListener;
@@ -33,6 +35,8 @@ import com.android.dialer.util.PermissionsUtil;
import com.android.incallui.call.DialerCall;
import java.util.Arrays;
+import org.lineageos.lib.phone.SensitivePhoneNumbers;
+
/** Utility methods for contact and caller info related functionality */
public class CallerInfoUtils {
@@ -100,6 +104,7 @@ public class CallerInfoUtils {
}
number = modifyForSpecialCnapCases(context, info, number, info.numberPresentation);
}
+ number = modifyPossibleSensitiveNumber(context, info, number);
info.phoneNumber = number;
}
@@ -140,6 +145,19 @@ public class CallerInfoUtils {
return cacheInfo;
}
+ static String modifyPossibleSensitiveNumber(Context context, CallerInfo ci, String number) {
+ if (ci == null || number == null) {
+ return number;
+ }
+ boolean isSensitiveNumber = SensitivePhoneNumbers.getInstance().isSensitiveNumber(context,
+ number, INVALID_SUBSCRIPTION_ID);
+ if (isSensitiveNumber) {
+ number = context.getString(R.string.unknown);
+ ci.numberPresentation = TelecomManager.PRESENTATION_UNKNOWN;
+ }
+ return number;
+ }
+
/**
* Handles certain "corner cases" for CNAP. When we receive weird phone numbers from the network
* to indicate different number presentations, convert them to expected number and presentation