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

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

telephony: FastDormancy support

Motorola phones ship with FastDormancy functionality. The package
handling it depends on two telephony functions to disable it when
not supported. This patch implements those functions.

Change-Id: I0ede651c0d7c10e4ed930e7461705217509ed539
parent 29f2e8a8
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -836,6 +836,18 @@ public class TelephonyManager {
        return ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE));
    }

    /** FastDormancy get/setter */
    private static boolean sDormancyRejected = false;

    public static boolean isDormancyRejected() {
        return getDefault().sDormancyRejected;
    }

    public static boolean setDormancyRejected(boolean rejected) {
        getDefault().sDormancyRejected = rejected;
        return true;
    }

    //
    //
    // PhoneStateListener
+6 −1
Original line number Diff line number Diff line
@@ -2713,7 +2713,12 @@ public class RIL extends BaseCommands implements CommandsInterface {
                break;

            case RIL_UNSOL_OEM_HOOK_RAW:
                if (RILJ_LOGD) unsljLogvRet(response, IccUtils.bytesToHexString((byte[])ret));
                String hexstr = IccUtils.bytesToHexString((byte[])ret);
                if (RILJ_LOGD) unsljLogvRet(response, hexstr);
                if (hexstr.equals("72656a656374")) {
                    if (RILJ_LOGD) Log.i(LOG_TAG, "RIL got ~+FDORM=reject, let's use TelephonyManager to disable FastDormancy.");
                    android.telephony.TelephonyManager.setDormancyRejected(true);
                }
                if (mUnsolOemHookRawRegistrant != null) {
                    mUnsolOemHookRawRegistrant.notifyRegistrant(new AsyncResult(null, ret, null));
                }