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

Commit 0cc586d2 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "[SP15.2] Remove unused getVtDataUsage in Telephony" am: 4221a1b2 am: 2fa5b5de

Change-Id: If5f00e8f8ddd31163f24c600c6da60f7636e4cd0
parents 21f4cdab 2fa5b5de
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.net.LinkProperties;
import android.net.NetworkCapabilities;
import android.net.NetworkStats;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Handler;
@@ -4076,18 +4075,6 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        return this;
    }

    /**
     * Get aggregated video call data usage since boot.
     * Permissions android.Manifest.permission.READ_NETWORK_USAGE_HISTORY is required.
     *
     * @param perUidStats True if requesting data usage per uid, otherwise overall usage.
     * @return Snapshot of video call data usage
     */
    public NetworkStats getVtDataUsage(boolean perUidStats) {
        if (mImsPhone == null) return null;
        return mImsPhone.getVtDataUsage(perUidStats);
    }

    /**
     * SIP URIs aliased to the current subscriber given by the IMS implementation.
     * Applicable only on IMS; used in absence of line1number.
+0 −6
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.NetworkStats;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
@@ -1995,11 +1994,6 @@ public class ImsPhone extends ImsPhoneBase {
        return mWakeLock;
    }

    @Override
    public NetworkStats getVtDataUsage(boolean perUidStats) {
        return mCT.getVtDataUsage(perUidStats);
    }

    /**
     * Update roaming state and WFC mode in the following situations:
     *     1) voice is in service.
+1 −25
Original line number Diff line number Diff line
@@ -263,8 +263,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    /**
     * A class implementing {@link AbstractNetworkStatsProvider} to report VT data usage to system.
     */
    // TODO: 1. Directly reports diff in updateVtDataUsage.
    //       2. Remove unused getVtDataUsage.
    // TODO: Directly reports diff in updateVtDataUsage.
    @VisibleForTesting(visibility = PRIVATE)
    public class VtDataUsageProvider extends AbstractNetworkStatsProvider {
        private int mToken = 0;
@@ -4345,29 +4344,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        return isActiveCallVideo && isActiveCallOnWifi && isIncomingCallAudio && !isVoWifiEnabled;
    }

    /**
     * Get aggregated video call data usage since boot.
     *
     * @param perUidStats True if requesting data usage per uid, otherwise overall usage.
     * @return Snapshot of video call data usage
     */
    public NetworkStats getVtDataUsage(boolean perUidStats) {

        // If there is an ongoing VT call, request the latest VT usage from the modem. The latest
        // usage will return asynchronously so it won't be counted in this round, but it will be
        // eventually counted when next getVtDataUsage is called.
        if (mState != PhoneConstants.State.IDLE) {
            for (ImsPhoneConnection conn : mConnections) {
                VideoProvider videoProvider = conn.getVideoProvider();
                if (videoProvider != null) {
                    videoProvider.onRequestConnectionDataUsage();
                }
            }
        }

        return perUidStats ? mVtDataUsageUidSnapshot : mVtDataUsageSnapshot;
    }

    public void registerPhoneStateListener(PhoneStateListener listener) {
        mPhoneStateListeners.add(listener);
    }