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

Commit c15c46e2 authored by Jordan Liu's avatar Jordan Liu Committed by android-build-merger
Browse files

ServiceStateTracker notifies via ContentProvider

am: b675e556

Change-Id: I0a26e83ebc47af2985e3d43ad969d50cdd826e43
parents 261ba682 b675e556
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.internal.telephony;

import static android.provider.Telephony.ServiceStateTable.getContentValuesForServiceState;
import static android.provider.Telephony.ServiceStateTable.getUriForSubId;

import static com.android.internal.telephony.CarrierActionAgent.CARRIER_ACTION_SET_RADIO_ENABLED;

import android.app.AlarmManager;
@@ -2842,8 +2845,13 @@ public class ServiceStateTracker extends Handler {

            setRoamingType(mSS);
            log("Broadcasting ServiceState : " + mSS);
            // notify using PhoneStateListener and the legacy intent ACTION_SERVICE_STATE_CHANGED
            mPhone.notifyServiceStateChanged(mSS);

            // insert into ServiceStateProvider. This will trigger apps to wake through JobScheduler
            mPhone.getContext().getContentResolver().insert(getUriForSubId(mPhone.getSubId()),
                    getContentValuesForServiceState(mSS));

            TelephonyMetrics.getInstance().writeServiceStateChanged(mPhone.getPhoneId(), mSS);
        }

+2 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.provider.Telephony.ServiceStateTable;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -529,6 +530,7 @@ public class ContextFixture implements TestFixture<Context> {
        doReturn(mConfiguration).when(mResources).getConfiguration();

        mContentResolver.addProvider(Settings.AUTHORITY, mContentProvider);
        mContentResolver.addProvider(ServiceStateTable.AUTHORITY, mContentProvider);
        mPermissionTable.add(PERMISSION_ENABLE_ALL);
    }