What steps will reproduce the problem?
1. Create a isConnected() method within an Activity, such as the following:
private boolean isConnected() {
ConnectivityManager connectivityManager
= (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
2. Disable WiFi and data on the phone that is connected to your Glass via
Bluetooth
3. Use or log isConnected() and notice that it returns true, even though Glass
"Can't reach Google right now" if you try to do something like voice recognition
What is the expected output? What do you see instead?
isConnected() should return false, since Glass isn't connected. Instead, it
returns true and thus attempts doing things that require connection, which then
fail.
What version of the product are you using? On what operating system?
Glass Version 2 XE12
Please provide any additional information below.
I dumped information about the NetworkInfo instance used in my isConnected()
method when my phone had data and when data was disabled. Strangely enough, the
information was the same both times:
activeNetworkInfo.toString(): NetworkInfo: type: COMPANION_PROXY[], state:
CONNECTED/CONNECTED, reason: enabled, extra: (none), roaming: false, failover:
false, isAvailable: true
It is also important to note that isConnected() correctly returns false when
Bluetooth is disabled (because connectivityManager.getActiveNetworkInfo()
returns null). So the issue is when Bluetooth is connected but the phone
doesn't have internet access.
Original issue reported on code.google.com by warlock....@gmail.com on 1 Jan 2014 at 8:34
Original issue reported on code.google.com by
warlock....@gmail.com
on 1 Jan 2014 at 8:34