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

Commit 381f5be0 authored by Emilio López's avatar Emilio López
Browse files

Set path to null when running on certain phones

Zeppelin, as well as other Motorola phones (Motus, Morrison, etc)
require path as null for mobile data to work. If path is something
else, important data like MCC and MNC cannot be retrieved, so
you cannot choose an APN, and data then obviously doesn't work.

This change was tested on Zeppelin only, as I don't have any other
phones to test this on.

Change-Id: Iacd3fdc15c0b5930c5330a82b23c04ed214b7efa
parent 5e241b6d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -497,4 +497,7 @@
    <integer name="cm_default_remapped_long_vol_down_index">0</integer>
    <integer name="cm_default_remapped_both_vol_index">0</integer>
    <integer name="cm_default_remapped_long_both_vol_index">0</integer>

    <!-- Set this to true to get data working on some Motorola phones -->
    <bool name="config_rilNeedsNullPath">false</bool>
</resources>
+7 −0
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
    private static final boolean DBG = false;
    static final boolean RILJ_LOGD = Config.LOGD;
    static final boolean RILJ_LOGV = DBG ? Config.LOGD : Config.LOGV;
    private boolean rilNeedsNullPath = false;

    /**
     * Wake lock timeout should be longer than the longest timeout in
@@ -621,6 +622,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        super(context);
        mCdmaSubscription  = cdmaSubscription;
        mNetworkMode = networkMode;
        rilNeedsNullPath = context.getResources().getBoolean(com.android.internal.R.bool.config_rilNeedsNullPath);
        //At startup mPhoneType is first set from networkMode
        switch(networkMode) {
            case RILConstants.NETWORK_MODE_WCDMA_PREF:
@@ -1461,6 +1463,11 @@ public final class RIL extends BaseCommands implements CommandsInterface {

        rr.mp.writeInt(command);
        rr.mp.writeInt(fileid);
        // MB501 (zeppelin) and other phones (motus, morrison, etc) require this
        // to get data working
        if (rilNeedsNullPath) {
            path = null;
        }
        rr.mp.writeString(path);
        rr.mp.writeInt(p1);
        rr.mp.writeInt(p2);