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

Commit 34fb42d1 authored by Jack Nudelman's avatar Jack Nudelman Committed by Automerger Merge Worker
Browse files

Merge changes from topics "VOIMS_OPT_IN", "d2d" am: 4e665fde

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1587734

Change-Id: I5b92ef6a6dbab485092e21274554e67e64003534
parents 697f7204 4e665fde
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -2101,6 +2101,43 @@ public class SubscriptionController extends ISub.Stub {
        }
    }

    /**
     * Set device to device status sharing preference
     * @param sharing the sharing preference to set
     * @param subId
     * @return the number of records updated
     */
    @Override
    public int setDeviceToDeviceStatusSharing(int sharing, int subId) {
        if (DBG) logd("[setDeviceToDeviceStatusSharing]- sharing:" + sharing + " subId:" + subId);

        enforceModifyPhoneState("setDeviceToDeviceStatusSharing");

        // Now that all security checks passes, perform the operation as ourselves.
        final long identity = Binder.clearCallingIdentity();
        try {
            validateSubId(subId);
            if (sharing < 0) {
                if (DBG) logd("[setDeviceToDeviceStatusSharing]- fail");
                return -1;
            }
            ContentValues value = new ContentValues(1);
            value.put(SubscriptionManager.D2D_STATUS_SHARING, sharing);
            if (DBG) logd("[setDeviceToDeviceStatusSharing]- sharing:" + sharing + " set");

            int result = updateDatabase(value, subId, true);

            // Refresh the Cache of Active Subscription Info List
            refreshCachedActiveSubscriptionInfoList();

            notifySubscriptionInfoChanged();

            return result;
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
    }

    public void syncGroupedSetting(int refSubId) {
        logd("syncGroupedSetting");
        try (Cursor cursor = mContext.getContentResolver().query(
@@ -3118,6 +3155,7 @@ public class SubscriptionController extends ISub.Stub {
                        case SubscriptionManager.DATA_ENABLED_OVERRIDE_RULES:
                        case SubscriptionManager.ALLOWED_NETWORK_TYPES:
                        case SubscriptionManager.VOIMS_OPT_IN_STATUS:
                        case SubscriptionManager.D2D_STATUS_SHARING:
                            resultValue = cursor.getString(0);
                            break;
                        default:
+2 −1
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ public class FakeTelephonyProvider extends MockContentProvider {
                    + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES + " BIGINT DEFAULT -1,"
                    + Telephony.SimInfo.COLUMN_IMS_RCS_UCE_ENABLED + " INTEGER DEFAULT 0, "
                    + Telephony.SimInfo.COLUMN_RCS_CONFIG + " BLOB,"
                    + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS + " TEXT"
                    + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS + " TEXT,"
                    + Telephony.SimInfo.COLUMN_D2D_STATUS_SHARING + " INTEGER DEFAULT 0"
                    + ");";
        }