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

Commit c4aa6f6d authored by Meng Wang's avatar Meng Wang
Browse files

Remove unused SystemProperties.set

Bug: 140908357
Test: make
Merged-In: I47239b57bbbd37695fba5a37cc64b78428189a31
Change-Id: I47239b57bbbd37695fba5a37cc64b78428189a31
parent dcb8aa7c
Loading
Loading
Loading
Loading
+0 −69
Original line number Original line Diff line number Diff line
@@ -6418,75 +6418,6 @@ public class TelephonyManager {
        }
        }
    }
    }


    /**
     * Sets a per-phone telephony property with the value specified.
     *
     * @hide
     */
    @UnsupportedAppUsage
    public static void setTelephonyProperty(int phoneId, String property, String value) {
        String propVal = "";
        String p[] = null;
        String prop = SystemProperties.get(property);

        if (value == null) {
            value = "";
        }
        value.replace(',', ' ');
        if (prop != null) {
            p = prop.split(",");
        }

        if (!SubscriptionManager.isValidPhoneId(phoneId)) {
            Rlog.d(TAG, "setTelephonyProperty: invalid phoneId=" + phoneId +
                    " property=" + property + " value: " + value + " prop=" + prop);
            return;
        }

        for (int i = 0; i < phoneId; i++) {
            String str = "";
            if ((p != null) && (i < p.length)) {
                str = p[i];
            }
            propVal = propVal + str + ",";
        }

        propVal = propVal + value;
        if (p != null) {
            for (int i = phoneId + 1; i < p.length; i++) {
                propVal = propVal + "," + p[i];
            }
        }

        int propValLen = propVal.length();
        try {
            propValLen = propVal.getBytes("utf-8").length;
        } catch (java.io.UnsupportedEncodingException e) {
            Rlog.d(TAG, "setTelephonyProperty: utf-8 not supported");
        }
        if (propValLen > SystemProperties.PROP_VALUE_MAX) {
            Rlog.d(TAG, "setTelephonyProperty: property too long phoneId=" + phoneId +
                    " property=" + property + " value: " + value + " propVal=" + propVal);
            return;
        }

        SystemProperties.set(property, propVal);
    }

    /**
     * Sets a global telephony property with the value specified.
     *
     * @hide
     */
    public static void setTelephonyProperty(String property, String value) {
        if (value == null) {
            value = "";
        }
        Rlog.d(TAG, "setTelephonyProperty: success" + " property=" +
                property + " value: " + value);
        SystemProperties.set(property, value);
    }

    /**
    /**
     * Inserts or updates a list property. Expands the list if its length is not enough.
     * Inserts or updates a list property. Expands the list if its length is not enough.
     */
     */