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

Commit 8e2a1c76 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

Expose api to retrieve wakelock information per client

Expose api to retrieve wakelock information per client
Provide calling package name in cell info apis

BUG=31041780
Change-Id: Id8ca0006478212c006a103b83fb720532e9c0fab
parent 1b907992
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -108,6 +108,17 @@ public class ClientWakelockTracker {
        }
    }

    public boolean isClientActive(String clientId) {
        ClientWakelockAccountant client = getClientWakelockAccountant(clientId);
        synchronized (mActiveClients) {
            if (mActiveClients.contains(client)) {
                return true;
            }
        }

        return false;
    }

    void dumpClientRequestTracker() {
        Rlog.d(RIL.RILJ_LOG_TAG, "-------mClients---------------");
        synchronized (mClients) {
+12 −3
Original line number Diff line number Diff line
@@ -24,7 +24,9 @@ import com.android.internal.telephony.uicc.IccCardStatus;

import android.os.Message;
import android.os.Handler;
import android.os.WorkSource;
import android.service.carrier.CarrierIdentifier;
import android.telephony.ClientRequestStats;

import java.util.List;

@@ -1384,8 +1386,9 @@ public interface CommandsInterface {
     * Query neighboring cell ids
     *
     * @param response s callback message to cell ids
     * @param workSource calling WorkSource
     */
    void getNeighboringCids(Message response);
    default void getNeighboringCids(Message response, WorkSource workSource){}

    /**
     * Request to enable/disable network state change notifications when
@@ -1727,8 +1730,9 @@ public interface CommandsInterface {
     * AsyncResult.result is a of Collection<CellInfo>
     *
     * @param result is sent back to handler and result.obj is a AsyncResult
     * @param workSource calling WorkSource
     */
    void getCellInfoList(Message result);
    default void getCellInfoList(Message result, WorkSource workSource) {}

    /**
     * Sets the minimum time in milli-seconds between when RIL_UNSOL_CELL_INFO_LIST
@@ -1744,8 +1748,9 @@ public interface CommandsInterface {
     * @param response.obj is AsyncResult ar when sent to associated handler
     *                        ar.exception carries exception on failure or null on success
     *                        otherwise the error.
     * @param workSource calling WorkSource
     */
    void setCellInfoListRate(int rateInMillis, Message response);
    default void setCellInfoListRate(int rateInMillis, Message response, WorkSource workSource){}

    /**
     * Fires when RIL_UNSOL_CELL_INFO_LIST is received from the RIL.
@@ -2052,4 +2057,8 @@ public interface CommandsInterface {
     * @param h handler to be removed
     */
    public void unregisterForPcoData(Handler h);

    default public List<ClientRequestStats> getClientRequestStats() {
        return null;
    }
}
+5 −4
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.os.Registrant;
import android.os.RegistrantList;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.WorkSource;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.provider.Telephony;
@@ -411,9 +412,9 @@ public class GsmCdmaPhone extends Phone {
    }

    @Override
    public CellLocation getCellLocation() {
    public CellLocation getCellLocation(WorkSource workSource) {
        if (isPhoneTypeGsm()) {
            return mSST.getCellLocation();
            return mSST.getCellLocation(workSource);
        } else {
            CdmaCellLocation loc = (CdmaCellLocation)mSST.mCellLoc;

@@ -1736,9 +1737,9 @@ public class GsmCdmaPhone extends Phone {
    }

    @Override
    public void getNeighboringCids(Message response) {
    public void getNeighboringCids(Message response, WorkSource workSource) {
        if (isPhoneTypeGsm()) {
            mCi.getNeighboringCids(response);
            mCi.getNeighboringCids(response, workSource);
        } else {
            /*
             * This is currently not implemented.  At least as of June
+17 −4
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.os.Message;
import android.os.Registrant;
import android.os.RegistrantList;
import android.os.SystemProperties;
import android.os.WorkSource;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.service.carrier.CarrierIdentifier;
@@ -41,6 +42,8 @@ import android.telecom.VideoProfile;
import android.telephony.CellIdentityCdma;
import android.telephony.CellInfo;
import android.telephony.CellInfoCdma;
import android.telephony.CellLocation;
import android.telephony.ClientRequestStats;
import android.telephony.PhoneStateListener;
import android.telephony.RadioAccessFamily;
import android.telephony.Rlog;
@@ -1156,6 +1159,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mCi.getNetworkSelectionMode(message);
    }

    public List<ClientRequestStats> getClientRequestStats() {
        return mCi.getClientRequestStats();
    }

    /**
     * Manually selects a network. <code>response</code> is
     * dispatched when this is complete.  <code>response.obj</code> will be
@@ -1577,13 +1584,18 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    }

    /**
     * @param workSource calling WorkSource
     * @return all available cell information or null if none.
     */
    public List<CellInfo> getAllCellInfo() {
        List<CellInfo> cellInfoList = getServiceStateTracker().getAllCellInfo();
    public List<CellInfo> getAllCellInfo(WorkSource workSource) {
        List<CellInfo> cellInfoList = getServiceStateTracker().getAllCellInfo(workSource);
        return privatizeCellInfoList(cellInfoList);
    }

    public CellLocation getCellLocation() {
        return getCellLocation(null);
    }

    /**
     * Clear CDMA base station lat/long values if location setting is disabled.
     * @param cellInfoList the original cell info list from the RIL
@@ -1626,9 +1638,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * A onCellInfoChanged.
     *
     * @param rateInMillis the rate
     * @param workSource calling WorkSource
     */
    public void setCellInfoListRate(int rateInMillis) {
        mCi.setCellInfoListRate(rateInMillis, null);
    public void setCellInfoListRate(int rateInMillis, WorkSource workSource) {
        mCi.setCellInfoListRate(rateInMillis, null, workSource);
    }

    /**
+5 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.net.NetworkCapabilities;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.WorkSource;
import android.telephony.CellInfo;
import android.telephony.CellLocation;
import android.telephony.CarrierConfigManager;
@@ -219,8 +220,9 @@ public interface PhoneInternalInterface {

    /**
     * Get the current CellLocation.
     * @param workSource calling WorkSource
     */
    CellLocation getCellLocation();
    CellLocation getCellLocation(WorkSource workSource);

    /**
     * Get the current DataState. No change notification exists at this
@@ -655,8 +657,9 @@ public interface PhoneInternalInterface {
     *
     * @param response callback message that is dispatched when the query
     * completes.
     * @param workSource calling WorkSource
     */
    void getNeighboringCids(Message response);
    default void getNeighboringCids(Message response, WorkSource workSource){}

    /**
     * Mutes or unmutes the microphone for the active call. The microphone
Loading