Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fba9ca44 authored by Chen Xu's avatar Chen Xu
Browse files

make CallerInfo as SystemAPI

1. move CallerInfo from telephony.internal to andorid.telephony package
2. expose APIs inside CallerInfo which are consumed by non-telephony
code.

Bug: 140908357
Test: Build
Change-Id: Ie95897c77e97e40f5357c107aede82edfea44d5a
(cherry picked from commit b9a1eefe)
Merged-in: Ie95897c77e97e40f5357c107aede82edfea44d5a
parent 30b39050
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -7201,6 +7201,13 @@ package android.telephony {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallQuality> CREATOR;
  }
  public class CallerInfo {
    method @Nullable public android.net.Uri getContactDisplayPhotoUri();
    method public long getContactId();
    method @Nullable public String getName();
    method @Nullable public String getPhoneNumber();
  }
  public class CarrierConfigManager {
    method @NonNull public static android.os.PersistableBundle getDefaultConfig();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void overrideConfig(int, @Nullable android.os.PersistableBundle);
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ com.android.internal.os.SomeArgs
com.android.internal.policy.DecorView
com.android.internal.statusbar.IStatusBarService
com.android.internal.telephony.AppSmsManager
com.android.internal.telephony.CallerInfoAsyncQuery$OnQueryCompleteListener
android.telephony.CallerInfoAsyncQuery$OnQueryCompleteListener
com.android.internal.telephony.CarrierActionAgent
com.android.internal.telephony.cat.CatService
com.android.internal.telephony.cat.IconLoader
+0 −3
Original line number Diff line number Diff line
@@ -1167,9 +1167,6 @@ Lcom/android/internal/telephony/Call$State;->INCOMING:Lcom/android/internal/tele
Lcom/android/internal/telephony/Call$State;->values()[Lcom/android/internal/telephony/Call$State;
Lcom/android/internal/telephony/Call$State;->WAITING:Lcom/android/internal/telephony/Call$State;
Lcom/android/internal/telephony/Call;-><init>()V
Lcom/android/internal/telephony/CallerInfoAsyncQuery$CallerInfoAsyncQueryHandler;-><init>(Lcom/android/internal/telephony/CallerInfoAsyncQuery;Landroid/content/Context;)V
Lcom/android/internal/telephony/CallerInfoAsyncQuery$CookieWrapper;-><init>()V
Lcom/android/internal/telephony/CallerInfoAsyncQuery;->release()V
Lcom/android/internal/telephony/CallForwardInfo;-><init>()V
Lcom/android/internal/telephony/CallTracker;-><init>()V
Lcom/android/internal/telephony/cat/AppInterface$CommandType;->values()[Lcom/android/internal/telephony/cat/AppInterface$CommandType;
+1 −1
Original line number Diff line number Diff line
@@ -4695,7 +4695,7 @@ com.android.internal.telephony.CallManager$CallManagerHandler
com.android.internal.telephony.CallManager
com.android.internal.telephony.CallStateException
com.android.internal.telephony.CallTracker
com.android.internal.telephony.CallerInfoAsyncQuery$OnQueryCompleteListener
android.telephony.CallerInfoAsyncQuery$OnQueryCompleteListener
com.android.internal.telephony.CarrierActionAgent$1
com.android.internal.telephony.CarrierActionAgent
com.android.internal.telephony.CarrierAppUtils
+9 −9
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;

import com.android.internal.telephony.CallerInfo;
import android.telephony.CallerInfo;
import com.android.internal.telephony.PhoneConstants;

import java.util.List;
@@ -728,10 +728,11 @@ public class CallLog {
            String accountAddress = getLogAccountAddress(context, accountHandle);

            int numberPresentation = getLogNumberPresentation(number, presentation);
            String name = (ci != null) ? ci.getName() : "";
            if (numberPresentation != PRESENTATION_ALLOWED) {
                number = "";
                if (ci != null) {
                    ci.name = "";
                    name = "";
                }
            }

@@ -760,9 +761,7 @@ public class CallLog {
            values.put(PHONE_ACCOUNT_ID, accountId);
            values.put(PHONE_ACCOUNT_ADDRESS, accountAddress);
            values.put(NEW, Integer.valueOf(1));
            if ((ci != null) && (ci.name != null)) {
                values.put(CACHED_NAME, ci.name);
            }
            values.put(CACHED_NAME, name);
            values.put(ADD_FOR_ALL_USERS, addForAllUsers ? 1 : 0);

            if (callType == MISSED_TYPE) {
@@ -773,7 +772,7 @@ public class CallLog {
            values.put(CALL_SCREENING_APP_NAME, charSequenceToString(callScreeningAppName));
            values.put(CALL_SCREENING_COMPONENT_NAME, callScreeningComponentName);

            if ((ci != null) && (ci.contactIdOrZero > 0)) {
            if ((ci != null) && (ci.getContactId() > 0)) {
                // Update usage information for the number associated with the contact ID.
                // We need to use both the number and the ID for obtaining a data ID since other
                // contacts may have the same number.
@@ -787,17 +786,18 @@ public class CallLog {
                    cursor = resolver.query(Phone.CONTENT_URI,
                            new String[] { Phone._ID },
                            Phone.CONTACT_ID + " =? AND " + Phone.NORMALIZED_NUMBER + " =?",
                            new String[] { String.valueOf(ci.contactIdOrZero),
                            new String[] { String.valueOf(ci.getContactId()),
                                    normalizedPhoneNumber},
                            null);
                } else {
                    final String phoneNumber = ci.phoneNumber != null ? ci.phoneNumber : number;
                    final String phoneNumber = ci.getPhoneNumber() != null
                        ? ci.getPhoneNumber() : number;
                    cursor = resolver.query(
                            Uri.withAppendedPath(Callable.CONTENT_FILTER_URI,
                                    Uri.encode(phoneNumber)),
                            new String[] { Phone._ID },
                            Phone.CONTACT_ID + " =?",
                            new String[] { String.valueOf(ci.contactIdOrZero) },
                            new String[] { String.valueOf(ci.getContactId()) },
                            null);
                }

Loading