SDK: Android 5.0.1.
Android build: LRX22C.
Device : Nexus 5.
Problem: KITKAT(4.4.4) and below API\'s
1) startUsingNetworkFeature(int n
Well finally found solution for this. Trick was to use capability as NET_CAPABILITY_INTERNET. Which is same as startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, FEATURE_ENABLE_HIPRI);
See the Firmware design here
builder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);
builder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR);
After this I am able to get onAvailable callback from system and later I set my process default network as mobile data.
Hence all the request goes over mobile data even if wifi is on. WOW!
Note: This was not working in initial releases of Preview L.
Edit 19-10-2015: setProcessDefaultNetwork is now depcreated use bindProcessToNetwork