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

Commit bc36fd87 authored by junyulai's avatar junyulai
Browse files

[SP15.2] Remove unused getVtDataUsage in Telephony

Test: atest FrameworkTelephonyTests
Bug: 143923500
Change-Id: If7ca124efd31d5bfdd667b0d026bd14058481988
parent cce98d06
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;
@@ -1987,11 +1986,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
@@ -261,8 +261,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;
@@ -4083,29 +4082,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);
    }