Skip to content

Commit 09446e7

Browse files
committed
Added CHANGE_WIFI_MULTICAST_STATE permission to manifest
1 parent f4bb1ef commit 09446e7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.thirdegg.chromecast.api.v2">
33
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
4+
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
45
</manifest>

chromecast/src/main/java/com/thirdegg/chromecast/api/v2/utils/AndroidUtils.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.net.UnknownHostException;
88

99
public class AndroidUtils {
10+
1011
public static InetAddress getDeviceIpAddress(WifiManager wifi) {
1112
InetAddress result = null;
1213
try {
@@ -16,8 +17,12 @@ public static InetAddress getDeviceIpAddress(WifiManager wifi) {
1617
// figure out our wifi address, otherwise bail
1718
WifiInfo wifiinfo = wifi.getConnectionInfo();
1819
int intaddr = wifiinfo.getIpAddress();
19-
byte[] byteaddr = new byte[]{(byte) (intaddr & 0xff), (byte) (intaddr >> 8 & 0xff),
20-
(byte) (intaddr >> 16 & 0xff), (byte) (intaddr >> 24 & 0xff)};
20+
byte[] byteaddr = new byte[]{
21+
(byte) (intaddr & 0xff),
22+
(byte) (intaddr >> 8 & 0xff),
23+
(byte) (intaddr >> 16 & 0xff),
24+
(byte) (intaddr >> 24 & 0xff)
25+
};
2126
result = InetAddress.getByAddress(byteaddr);
2227
} catch (UnknownHostException ex) {
2328
ex.printStackTrace();

0 commit comments

Comments
 (0)