Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: LineageOS/android_frameworks_opt_telephony
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: lineage-18.1
Choose a base ref
...
head repository: sagit-los17/android_frameworks_opt_telephony
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: lineage-18.1
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 9 commits
  • 21 files changed
  • 6 contributors

Commits on Dec 16, 2020

  1. Enable vendor Telephony plugin: MSIM Changes

    MSIM Changes that are needed to enable vendor telephony framework.
    
    [Pig]: Update to LA.QSSI.11.0.r1-06700-qssi.0
    
    CRs-Fixed: 2172757
    Change-Id: I80a46de96c34d5e2a4ce952830f6beb862522de5
    Sneh Bansal authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    b76a6d7 View commit details
  2. Enable vendor Telephony plugin

    - Add hooks to vendor components.
    - Change access specifiers of members from private to protected.
    - Override factory methods.
    - Add support for HIDL service to implement vendor/OEM specific features.
    
    CRs-Fixed: 2178879
    
    Start using inject framework support
    
    - Start using inject mechanism to invoke vendor specific code.
    - Add the inject support for the classes extended in vendor space.
    
    Change-Id: I35b9761c15aebc32f48107bbe6b3bcec9a1eb670
    CRs-Fixed: 2394018
    
    Fix to inject vendor specific files
    
    Send appropriate TelephonyComponentFactory object to GsmCdmaPhone constructor
    to inject vendor specific classes from GsmCdmaPhone.
    
    Change-Id: I12d476763c4849b2b7627075a4a5b80f6a5361b9
    CRs-Fixed: 2404615
    
    [Pig]: Update to LA.QSSI.11.0.r1-06700-qssi.0
    
    Change-Id: I0b8369f88c05d56973c0adb6f08607460601302e
    Sneh Bansal authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    be79a7e View commit details
  3. CDMA MO SMS follow on DC feature

    Add new API to send MO CDMA SMS with expectMore option.
    
    CRs-Fixed: 2242430
    Change-Id: I5f504628186eab50f18584251dcbe198483b360f
    Chaitanya Saggurthi authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    30d1c28 View commit details
  4. Add support for retry with new DDS API and update QtiPhoneSwitcher

    Modify access specifier of PhoneSwitcher members to support retry with new DDS API,
    and QtiPhoneSwitcher update
    
    Change-Id: Ibc6960a110d6e5927b76de35b76b9084da0161ae
    CRs-Fixed: 2406274
    Susheel Nyamala authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    bbdb897 View commit details
  5. Fix to block sim selection popup for data

    Grant protected access for member variables required
    to override methods for blocking sim selection popup
    display
    
    Change-Id: I3c70687c59ada9e0dc51e55a6b34356dee3f4e54
    CRs-Fixed: 2442591
    Susheel Nyamala authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    a86eb6d View commit details
  6. FR57912: Add support for pdp data reject with cause code 29,33,55

    1. Modify access specifiers
    2. Handle EVENT_RETRY_CONNECTION in inactive state
    
    Change-Id: I9ff528d37c05edd7f190f7c3ab7175b390e3cc49
    CRs-Fixed: 2460148
    Susheel Nyamala authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    d40ed77 View commit details
  7. Fix imsi info error when insert some china operator card.

    Imsi only show mccmnc when the phone type is cdma phone since the
    length of return from RIL is 0 but not NULL for mMin. if mMin is
    NULL or length is 0, mPhone.getSubscriberId() will get NULL when
    the phone type is cdma, hence the flow of get imsi will move on
    to retrieve the imsi from IccRecords.
    
    Change-Id: Idda892c736db046d8924bb45a5fbb2a5f2a6d248
    CRs-Fixed: 2212375
    qiongz authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    f3cad05 View commit details
  8. Define EF MSPL/MLPL/PRL values and paths

    Add several EF paths for UI to get CDMA device info.
    
    Change-Id: Iff43d6b5a6706e54aaf50867419c30a1a322cb2f
    CRs-Fixed: 2177396
    zhu youhua authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    ca59192 View commit details
  9. SimPhoneBook: Add ANR/EMAIL support for USIM phonebook.

    1. Add multi-EF_ANR/EF_EMAIL support for each ADN record.
    2. Add the related interfaces for getting count of ADN,ANR,EMAIL
        - getAdnRecordsCapacity
    3. Use updateIccRecordInEf for all update/insert/delete operations.
        - add updateAdnRecordsWithContentValuesInEfBySearchUsingSubId for
          updating IccRecord
    
    Update method call to notifyDataConnection
    
    -notifyOffApnsOfAvailability() no longer exists upstream, so the methods
    it calls needed updating
    -update synchronization pattern in
    updateAdnRecordsWithContentValuesInEfBySearch()
    
    Change-Id: I074085b68d133f91ecc75801bac4a4aa569fbc88
    
    [Pig]: Update to LA.QSSI.11.0.r1-06700-qssi.0
    
    Bug: 23044962
    Change-Id: Ia272a015568c69bacf36d774d82aa069eff86d74
    Yujing Gu authored and sbwml committed Dec 16, 2020
    Copy the full SHA
    1e46866 View commit details
Showing with 568 additions and 94 deletions.
  1. +50 −0 src/java/com/android/internal/telephony/IIccPhoneBook.aidl
  2. +102 −3 src/java/com/android/internal/telephony/IccPhoneBookInterfaceManager.java
  3. +63 −26 src/java/com/android/internal/telephony/IccProvider.java
  4. +2 −1 src/java/com/android/internal/telephony/MultiSimSettingController.java
  5. +6 −6 src/java/com/android/internal/telephony/Phone.java
  6. +26 −5 src/java/com/android/internal/telephony/PhoneFactory.java
  7. +7 −4 src/java/com/android/internal/telephony/PhoneSwitcher.java
  8. +19 −5 src/java/com/android/internal/telephony/RIL.java
  9. +2 −2 src/java/com/android/internal/telephony/ServiceStateTracker.java
  10. +32 −9 src/java/com/android/internal/telephony/SubscriptionController.java
  11. +36 −0 src/java/com/android/internal/telephony/TelephonyComponentFactory.java
  12. +43 −0 src/java/com/android/internal/telephony/UiccPhoneBookController.java
  13. +9 −7 src/java/com/android/internal/telephony/dataconnection/DataConnection.java
  14. +17 −9 src/java/com/android/internal/telephony/dataconnection/DcTracker.java
  15. +2 −2 src/java/com/android/internal/telephony/dataconnection/TelephonyNetworkFactory.java
  16. +100 −14 src/java/com/android/internal/telephony/uicc/AdnRecord.java
  17. +5 −0 src/java/com/android/internal/telephony/uicc/CsimFileHandler.java
  18. +6 −0 src/java/com/android/internal/telephony/uicc/IccConstants.java
  19. +5 −0 src/java/com/android/internal/telephony/uicc/RuimFileHandler.java
  20. +1 −1 ...telephonytests/src/com/android/internal/telephony/dataconnection/TelephonyNetworkFactoryTest.java
  21. +35 −0 tests/telephonytests/src/com/android/internal/telephony/uicc/IccPhoneBookInterfaceManagerTest.java
50 changes: 50 additions & 0 deletions src/java/com/android/internal/telephony/IIccPhoneBook.aidl
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@

package com.android.internal.telephony;

import android.content.ContentValues;
import com.android.internal.telephony.uicc.AdnRecord;

/**
@@ -112,6 +113,21 @@ interface IIccPhoneBook {
String newPhoneNumber, int index,
String pin2);

/**
* Replace oldAdn with newAdn in ADN-like record in EF
*
* getAdnRecordsInEf must be called at least once before this function,
* otherwise an error will be returned
*
* @param subId user preferred subId
* @param efid must be one among EF_ADN, EF_FDN, and EF_SDN
* @param values including ADN,EMAIL,ANR to be updated
* @param pin2 required to update EF_FDN, otherwise must be null
* @return true for success
*/
boolean updateAdnRecordsWithContentValuesInEfBySearchUsingSubId(int subId,
int efid, in ContentValues values, String pin2);

/**
* Update an ADN-like EF record by record index
*
@@ -157,4 +173,38 @@ interface IIccPhoneBook {
@UnsupportedAppUsage
int[] getAdnRecordsSizeForSubscriber(int subId, int efid);

/**
* Get the capacity of ADN records
*
* @return int[10] array
* capacity[0] is the max count of ADN
* capacity[1] is the used count of ADN
* capacity[2] is the max count of EMAIL
* capacity[3] is the used count of EMAIL
* capacity[4] is the max count of ANR
* capacity[5] is the used count of ANR
* capacity[6] is the max length of name
* capacity[7] is the max length of number
* capacity[8] is the max length of email
* capacity[9] is the max length of anr
*/
int[] getAdnRecordsCapacity();

/**
* Get the capacity of ADN records
*
* @param subId user preferred subId
* @return int[10] array
* capacity[0] is the max count of ADN
* capacity[1] is the used count of ADN
* capacity[2] is the max count of EMAIL
* capacity[3] is the used count of EMAIL
* capacity[4] is the max count of ANR
* capacity[5] is the used count of ANR
* capacity[6] is the max length of name
* capacity[7] is the max length of number
* capacity[8] is the max length of email
* capacity[9] is the max length of anr
*/
int[] getAdnRecordsCapacityForSubscriber(int subId);
}
Original file line number Diff line number Diff line change
@@ -17,11 +17,13 @@
package com.android.internal.telephony;

import android.compat.annotation.UnsupportedAppUsage;
import android.content.ContentValues;
import android.content.pm.PackageManager;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;

import com.android.internal.telephony.uicc.AdnRecord;
import com.android.internal.telephony.uicc.AdnRecordCache;
@@ -52,9 +54,9 @@ public class IccPhoneBookInterfaceManager {
protected static final int EVENT_LOAD_DONE = 2;
protected static final int EVENT_UPDATE_DONE = 3;

private static final class Request {
public static final class Request {
AtomicBoolean mStatus = new AtomicBoolean(false);
Object mResult = null;
public Object mResult = null;
}

@UnsupportedAppUsage
@@ -198,6 +200,67 @@ protected void loge(String msg) {
}
}

/**
* Replace oldAdn with newAdn in ADN-like record in EF
*
* getAdnRecordsInEf must be called at least once before this function,
* otherwise an error will be returned.
* throws SecurityException if no WRITE_CONTACTS permission
*
* @param efid must be one among EF_ADN, EF_FDN, and EF_SDN
* @param values old adn tag, phone number, email and anr to be replaced
* new adn tag, phone number, email and anr to be stored
* @param newPhoneNumber adn number ot be stored
* @param oldPhoneNumber adn number to be replaced
* Set both oldTag, oldPhoneNubmer, oldEmail and oldAnr to ""
* means to replace an empty record, aka, insert new record
* Set both newTag, newPhoneNubmer, newEmail and newAnr ""
* means to replace the old record with empty one, aka, delete old record
* @param pin2 required to update EF_FDN, otherwise must be null
* @return true for success
*/
public boolean updateAdnRecordsWithContentValuesInEfBySearch(int efid, ContentValues values,
String pin2) {

if (mPhone.getContext().checkCallingOrSelfPermission(
android.Manifest.permission.WRITE_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires android.permission.WRITE_CONTACTS permission");
}

String oldTag = values.getAsString(IccProvider.STR_TAG);
String newTag = values.getAsString(IccProvider.STR_NEW_TAG);
String oldPhoneNumber = values.getAsString(IccProvider.STR_NUMBER);
String newPhoneNumber = values.getAsString(IccProvider.STR_NEW_NUMBER);
String oldEmail = values.getAsString(IccProvider.STR_EMAILS);
String newEmail = values.getAsString(IccProvider.STR_NEW_EMAILS);
String oldAnr = values.getAsString(IccProvider.STR_ANRS);
String newAnr = values.getAsString(IccProvider.STR_NEW_ANRS);
String[] oldEmailArray = TextUtils.isEmpty(oldEmail) ? null : getStringArray(oldEmail);
String[] newEmailArray = TextUtils.isEmpty(newEmail) ? null : getStringArray(newEmail);
String[] oldAnrArray = TextUtils.isEmpty(oldAnr) ? null : getAnrStringArray(oldAnr);
String[] newAnrArray = TextUtils.isEmpty(newAnr) ? null : getAnrStringArray(newAnr);
efid = updateEfForIccType(efid);

if (DBG)
logd("updateAdnRecordsWithContentValuesInEfBySearch: efid=" + efid + ", values = " +
values + ", pin2=" + pin2);

checkThread();
Request updateRequest = new Request();
synchronized (updateRequest) {
Message response = mBaseHandler.obtainMessage(EVENT_UPDATE_DONE, updateRequest);
AdnRecord oldAdn = new AdnRecord(oldTag, oldPhoneNumber, oldEmailArray, oldAnrArray);
AdnRecord newAdn = new AdnRecord(newTag, newPhoneNumber, newEmailArray, newAnrArray);
if (mAdnCache != null) {
mAdnCache.updateAdnBySearch(efid, oldAdn, newAdn, pin2, response);
waitForResult(updateRequest);
} else {
loge("Failure while trying to update by search due to uninitialised adncache");
}
}
return (boolean) updateRequest.mResult;
}

/**
* Update an ADN-like EF record by record index
*
@@ -334,7 +397,7 @@ protected void waitForResult(Request request) {
}

@UnsupportedAppUsage
private int updateEfForIccType(int efid) {
protected int updateEfForIccType(int efid) {
// Check if we are trying to read ADN records
if (efid == IccConstants.EF_ADN) {
if (mPhone.getCurrentUiccAppType() == AppType.APPTYPE_USIM) {
@@ -343,5 +406,41 @@ private int updateEfForIccType(int efid) {
}
return efid;
}

protected String[] getStringArray(String str) {
if (str != null) {
return str.split(",");
}
return null;
}

protected String[] getAnrStringArray(String str) {
if (str != null) {
return str.split(":");
}
return null;
}

/**
* Get the capacity of ADN records
*
* @return int[6] array
* capacity[0] is the max count of ADN
* capacity[1] is the used count of ADN
* capacity[2] is the max count of EMAIL
* capacity[3] is the used count of EMAIL
* capacity[4] is the max count of ANR
* capacity[5] is the used count of ANR
* capacity[6] is the max length of name
* capacity[7] is the max length of number
* capacity[8] is the max length of email
* capacity[9] is the max length of anr
*/
public int[] getAdnRecordsCapacity() {
if (DBG) logd("getAdnRecordsCapacity" );
int capacity[] = new int[10];

return capacity;
}
}

89 changes: 63 additions & 26 deletions src/java/com/android/internal/telephony/IccProvider.java
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ public class IccProvider extends ContentProvider {
"name",
"number",
"emails",
"anrs",
"_id"
};

@@ -61,10 +62,15 @@ public class IccProvider extends ContentProvider {
protected static final int SDN_SUB = 6;
protected static final int ADN_ALL = 7;

protected static final String STR_TAG = "tag";
protected static final String STR_NUMBER = "number";
protected static final String STR_EMAILS = "emails";
protected static final String STR_PIN2 = "pin2";
public static final String STR_TAG = "tag";
public static final String STR_NUMBER = "number";
public static final String STR_EMAILS = "emails";
public static final String STR_ANRS = "anrs";
public static final String STR_NEW_TAG = "newTag";
public static final String STR_NEW_NUMBER = "newNumber";
public static final String STR_NEW_EMAILS = "newEmails";
public static final String STR_NEW_ANRS = "newAnrs";
public static final String STR_PIN2 = "pin2";

private static final UriMatcher URL_MATCHER =
new UriMatcher(UriMatcher.NO_MATCH);
@@ -204,8 +210,20 @@ public Uri insert(Uri url, ContentValues initialValues) {

String tag = initialValues.getAsString("tag");
String number = initialValues.getAsString("number");
// TODO(): Read email instead of sending null.
boolean success = addIccRecordToEf(efType, tag, number, null, pin2, subId);

String emails = initialValues.getAsString("emails");
String anrs = initialValues.getAsString("anrs");

ContentValues values = new ContentValues();
values.put(STR_TAG,"");
values.put(STR_NUMBER,"");
values.put(STR_EMAILS,"");
values.put(STR_ANRS,"");
values.put(STR_NEW_TAG,tag);
values.put(STR_NEW_NUMBER,number);
values.put(STR_NEW_EMAILS,emails);
values.put(STR_NEW_ANRS,anrs);
boolean success = updateIccRecordInEf(efType, values, pin2, subId);

if (!success) {
return null;
@@ -298,7 +316,8 @@ public int delete(Uri url, String where, String[] whereArgs) {
// parse where clause
String tag = null;
String number = null;
String[] emails = null;
String emails = null;
String anrs = null;
String pin2 = null;

String[] tokens = where.split(" AND ");
@@ -322,18 +341,29 @@ public int delete(Uri url, String where, String[] whereArgs) {
} else if (STR_NUMBER.equals(key)) {
number = normalizeValue(val);
} else if (STR_EMAILS.equals(key)) {
//TODO(): Email is null.
emails = null;
emails = normalizeValue(val);
} else if (STR_ANRS.equals(key)) {
anrs = normalizeValue(val);
} else if (STR_PIN2.equals(key)) {
pin2 = normalizeValue(val);
}
}

if (efType == FDN && TextUtils.isEmpty(pin2)) {
ContentValues values = new ContentValues();
values.put(STR_TAG,tag);
values.put(STR_NUMBER,number);
values.put(STR_EMAILS,emails);
values.put(STR_ANRS,anrs);
values.put(STR_NEW_TAG,"");
values.put(STR_NEW_NUMBER,"");
values.put(STR_NEW_EMAILS,"");
values.put(STR_NEW_ANRS,"");
if ((efType == FDN) && TextUtils.isEmpty(pin2)) {
return 0;
}

boolean success = deleteIccRecordFromEf(efType, tag, number, emails, pin2, subId);
if (DBG) log("delete mvalues= " + values);
boolean success = updateIccRecordInEf(efType, values, pin2, subId);
if (!success) {
return 0;
}
@@ -386,8 +416,7 @@ public int update(Uri url, ContentValues values, String where, String[] whereArg
String newNumber = values.getAsString("newNumber");
String[] newEmails = null;
// TODO(): Update for email.
boolean success = updateIccRecordInEf(efType, tag, number,
newTag, newNumber, pin2, subId);
boolean success = updateIccRecordInEf(efType, values, pin2, subId);

if (!success) {
return 0;
@@ -421,7 +450,7 @@ private MatrixCursor loadFromEf(int efType, int subId) {
// Load the results
final int N = adnRecords.size();
final MatrixCursor cursor = new MatrixCursor(ADDRESS_BOOK_COLUMN_NAMES, N);
if (DBG) log("adnRecords.size=" + N);
log("adnRecords.size=" + N);
for (int i = 0; i < N ; i++) {
loadRecord(adnRecords.get(i), cursor, i);
}
@@ -467,24 +496,21 @@ private MatrixCursor loadFromEf(int efType, int subId) {
}

private boolean
updateIccRecordInEf(int efType, String oldName, String oldNumber,
String newName, String newNumber, String pin2, int subId) {
if (DBG) log("updateIccRecordInEf: efType=0x" + Integer.toHexString(efType).toUpperCase() +
", oldname=" + Rlog.pii(TAG, oldName) + ", oldnumber=" + Rlog.pii(TAG, oldNumber) +
", newname=" + Rlog.pii(TAG, newName) + ", newnumber=" + Rlog.pii(TAG, newName) +
", subscription=" + subId);

updateIccRecordInEf(int efType, ContentValues values, String pin2, int subId) {
boolean success = false;

if (DBG) log("updateIccRecordInEf: efType=" + efType +
", values: [ "+ values + " ], subId:" + subId);
try {
IIccPhoneBook iccIpb = IIccPhoneBook.Stub.asInterface(
TelephonyFrameworkInitializer
.getTelephonyServiceManager()
.getIccPhoneBookServiceRegisterer()
.get());
if (iccIpb != null) {
success = iccIpb.updateAdnRecordsInEfBySearchForSubscriber(subId, efType, oldName,
oldNumber, newName, newNumber, pin2);
success = iccIpb
.updateAdnRecordsWithContentValuesInEfBySearchUsingSubId(
subId, efType, values, pin2);
}
} catch (RemoteException ex) {
// ignore it
@@ -495,7 +521,6 @@ private MatrixCursor loadFromEf(int efType, int subId) {
return success;
}


private boolean deleteIccRecordFromEf(int efType, String name, String number, String[] emails,
String pin2, int subId) {
if (DBG) log("deleteIccRecordFromEf: efType=0x" +
@@ -533,9 +558,10 @@ private boolean deleteIccRecordFromEf(int efType, String name, String number, St
@UnsupportedAppUsage
private void loadRecord(AdnRecord record, MatrixCursor cursor, int id) {
if (!record.isEmpty()) {
Object[] contact = new Object[4];
Object[] contact = new Object[5];
String alphaTag = record.getAlphaTag();
String number = record.getNumber();
String[] anrs = record.getAdditionalNumbers();

if (DBG) log("loadRecord: " + alphaTag + ", " + Rlog.pii(TAG, number));
contact[0] = alphaTag;
@@ -551,7 +577,18 @@ private void loadRecord(AdnRecord record, MatrixCursor cursor, int id) {
}
contact[2] = emailString.toString();
}
contact[3] = id;

if (anrs != null) {
StringBuilder anrString = new StringBuilder();
for (String anr : anrs) {
if (DBG) log("Adding anr:" + anr);
anrString.append(anr);
anrString.append(":");
}
contact[3] = anrString.toString();
}

contact[4] = id;
cursor.addRow(contact);
}
}
Loading