Diving inside Android Wifi

Embed Size (px)

Citation preview

Nanik Tolaram

[email protected]

nanikjava

DivingInside Wifi

About

Senior Platform Engineer @ Blocksglobal

Commercial Product screener.digital & lumenhealth.org

Android Writer magazine.odroid.com

Why should I care ?

Battery life

Bandwidth

Responsive apps

Happy User

High Level View

YoutubeGMailWhatsAppFacebookFrameworkWifi Android LayerLinux KernelWifi Hardware

Inside Framework

WifiService+WifiServiceImplWifiStateMachineWifiNative

com_android_server_wifi_wifinative.cppwifi.c (HAL)wpa_supplicant daemonWifiTrafficPollerWifiWatchdogStateMachinewpa_supplicant client libraryLinux Kernel

local socket interface

Java Layer

Native Layer

Youtube

Wifi Issues

Unreliable

Unpredictable

High battery usage

Async architecture

Solution

Use when needed

Batched download

Fixed size download

Push notification download

Android API

JobScheduler + JobInfo

ConnectivityManagerandroid.net.conn.CONNECTIVITY_CHANGE