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

Commit ac1d41c6 authored by Vinit Deshapnde's avatar Vinit Deshapnde
Browse files

Introduce network link quality statistics

This change starts tracking traffic quality data for WiFi and mobile
networks. The quality is tracked based on incidental traffic, and not
on specific measurements. Theoretical bandwidths are hard-coded, as
well as sampling interval; although sampling interval can be changed
by setting a system policy.

Bugs filed to remove shortcomings of this change -

10342372 Change LinkInfo name to something better
10342318 Move hardcoded values of MobileLinkInfo to resources
         so they can be updated without changing code

Bug: 10006249

Change-Id: I83d8c7594da20fe53abbd5e1f909b1f606b035bb
parent 231f0aaf
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.bluetooth;

import android.net.BaseNetworkStateTracker;
import android.os.IBinder;
import android.os.ServiceManager;
import android.os.INetworkManagementService;
@@ -54,7 +55,7 @@ import java.util.concurrent.atomic.AtomicReference;
 *
 * @hide
 */
public class BluetoothTetheringDataTracker implements NetworkStateTracker {
public class BluetoothTetheringDataTracker extends BaseNetworkStateTracker {
    private static final String NETWORKTYPE = "BLUETOOTH_TETHER";
    private static final String TAG = "BluetoothTethering";
    private static final boolean DBG = true;
@@ -66,18 +67,12 @@ public class BluetoothTetheringDataTracker implements NetworkStateTracker {
    private AtomicBoolean mDefaultRouteSet = new AtomicBoolean(false);

    private final Object mLinkPropertiesLock = new Object();
    private LinkProperties mLinkProperties;

    private LinkCapabilities mLinkCapabilities;

    private final Object mNetworkInfoLock = new Object();
    private NetworkInfo mNetworkInfo;

    private BluetoothPan mBluetoothPan;
    private static String mRevTetheredIface;
    /* For sending events to connectivity service handler */
    private Handler mCsHandler;
    protected Context mContext;
    private static BluetoothTetheringDataTracker sInstance;
    private BtdtHandler mBtdtHandler;
    private AtomicReference<AsyncChannel> mAsyncChannel = new AtomicReference<AsyncChannel>(null);