
android-developer-preview - issue #1334
Send request over Mobile data when WIFI was ON.(Android L)
SDK: Android Dev Preview L.
Android build: LPV79.
Device : Nexus 5.
Problem: KITKAT(4.4.4) and below API's
1)startUsingNetworkFeature(int networkType, String feature) This method is deprecated. Deprecated in favor of the cleaner requestNetwork(NetworkRequest, ConnectivityManager.NetworkCallback).
2)requestRouteToHost(int networkType, int hostAddress) This method is deprecated. Deprecated in favor of the requestNetwork(NetworkRequest, ConnectivityManager.NetworkCallback), setProcessDefaultNetwork(Network) and getSocketFactory().
were used to send request over Mobile Data Network when WIFI and mobile data were on.
Starting Android L the API's is deprecated and no longer work.
New API's/Classes NetworkRequest.Builder,NetworkRequest,ConnectivityManager.NetworkCallback,requestNetwork,registerNetworkCallback were used.
Code: ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkRequest.Builder builder = new NetworkRequest.Builder();
builder.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED); builder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR);
NetworkRequest networkRequest = builder.build(); connectivityManager.requestNetwork(networkRequest, networkCallback); connectivityManager.registerNetworkCallback(networkRequest, networkCallback);
Working Scenario:
Only mobile data on onAvailable callback is received.
Not working Scenario: Both Mobile and Wifi is on and connected,onAvailable callback is not received from system.Hence not able to set setProcessDefaultNetwork ConnectivityManager.setProcessDefaultNetwork(preferedNetwork);
Frequently: Always
Expected output: Get mobile network avaliabe callback when wifi is on.
Am i missing something here or the firmware has some issues here?
ADB attached.
Thanks Nithin
- AndroidL_requestNetwork.txt 6.21KB
Comment #1
Posted on Sep 19, 2014 by Grumpy Wombat(No comment was entered for this change.)
Comment #2
Posted on Sep 19, 2014 by Grumpy WombatThank you for reporting this issue. We have passed this on to the development team and will update this issue with more information as it becomes available.
Comment #3
Posted on Sep 24, 2014 by Grumpy WombatAny update on this? Need this feature to force user to use mobile data network, so that app data usage billing can be done over it. Google please update.
Comment #4
Posted on Oct 31, 2014 by Happy GiraffeI need this feature to force and remove to user mobile data network. Please help me update it soon. Thanks.
Comment #5
Posted on Nov 17, 2014 by Happy ElephantI need feature to force wifi as high priority network when both WIFI and mobile data is present, please help me on this.
Comment #6
Posted on Nov 18, 2014 by Helpful Wombat(No comment was entered for this change.)
Comment #7
Posted on May 28, 2015 by Helpful Wombat(No comment was entered for this change.)
Status: PreviousRelease
Labels:
Type-Defect
Framework-Networking
17578391
Restrict-AddIssueComment-Commit