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

Commit 87c2958c authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Upgrade logging in PhoneSwitcher.

Bug shows that PhoneSwitcher doesn't think phone0 is default,
but all of that action happened 30-60 minutes ago.  Upgrade
PhoneSwitchers local log to capture this info.

bug:27344401
Change-Id: Ide4f26f73ecaeb807aae7715ea59f6fb78ae86de
parent df0b65dd
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -264,7 +264,8 @@ public class PhoneSwitcher extends Handler {
     * phones that aren't in the active phone list.  Finally, activate all
     * phones in the active phone list.
     */
    private void onEvaluate(boolean requestsChanged, String why) {
    private void onEvaluate(boolean requestsChanged, String reason) {
        StringBuilder sb = new StringBuilder(reason);
        if (isEmergency()) {
            log("onEvalute aborted due to Emergency");
            return;
@@ -273,20 +274,24 @@ public class PhoneSwitcher extends Handler {
        boolean diffDetected = requestsChanged;
        final int dataSub = mSubscriptionController.getDefaultDataSubId();
        if (dataSub != mDefaultDataSubscription) {
            sb.append(" default ").append(mDefaultDataSubscription).append("->").append(dataSub);
            mDefaultDataSubscription = dataSub;
            diffDetected = true;

        }

        for (int i = 0; i < mNumPhones; i++) {
            int sub = mSubscriptionController.getSubIdUsingPhoneId(i);
            if (sub != mPhoneSubscriptions[i]) {
                sb.append(" phone[").append(i).append("] ").append(mPhoneSubscriptions[i]);
                sb.append("->").append(sub);
                mPhoneSubscriptions[i] = sub;
                diffDetected = true;
            }
        }

        if (diffDetected) {
            log("evaluating due to " + why);
            log("evaluating due to " + sb.toString());

            List<Integer> newActivePhones = new ArrayList<Integer>();