lineage-sdk: Fix traffic stats for tethering and vpn use cases

Problems with current TrafficStats.getTotal[RT]XBytes()
implementation:

* Tethering related traffic is not counted at all.

* If you have a VPN active, stats are double counted.

So change the approach and track traffic on all non-VPN Internet
capable networks since:

* Tethering traffic is included in interface specific stats
  (unlike getTotal*).

* VPN networks are excluded so no longer double counted.

* Works correctly regardless of hotspot "Allow clients to use
  VPNs" hotspot setting.

* Works with simultaneous wifi ap and wifi upstream.
  (WIFI_HIDL_FEATURE_DUAL_INTERFACE = true)

Change-Id: Ic1135f10388b5be427202b092acd1444f94bd2b6
1 file changed
tree: dc6d169809318df393803a269c05f92cd0eeeb3d
  1. api/
  2. host/
  3. lineage/
  4. packages/
  5. samples/
  6. sdk/
  7. tests/
  8. .gitignore
  9. Android.bp
  10. Android.mk
  11. CleanSpec.mk
  12. org.lineageos.platform.xml
  13. README.md
README.md

LineageOS Platform SDK

The Platform SDK provides a set of APIs that give you easy access to a variety of different features within LineageOS. The SDK exposes APIs and system level framework access in the Android framework that aren't available in any other distribution.

Setup

You can either download from prebuilts hosted on github or pull directly via Gradle.

Building against release artifacts

Our stable releases are mirrored in Maven Central, and you can fetch the current release by setting your build.gradle dependencies to

dependencies {
    compile 'org.lineageos:platform.sdk:5.+'
}

Building against development snapshots

Within build.gradle make sure your repositories list sonatype OSS repos for snapshots

repositories {
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots/"
    }
}

You can target the future or development branch by setting your dependencies for 6.0-SNAPSHOT

dependencies {
    compile 'org.lineageos:platform.sdk:6.0-SNAPSHOT'
}

Wiki

For further inquiries regarding this project, please reference the wiki.