Skip to content

Commit 057ddf8

Browse files
committed
fix imsi
1 parent 54c3808 commit 057ddf8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

VideoOS/VenvyLibrary/src/main/java/cn/com/venvy/common/utils/VenvyDeviceUtil.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,15 @@ public static String getIMEI(Context context) {
116116
* @return
117117
*/
118118
public static String getIMSI(Context context) {
119-
TelephonyManager tm = (TelephonyManager) context
120-
.getSystemService(Context.TELEPHONY_SERVICE);//
121-
return tm.getSubscriberId();
119+
String imsi = "";
120+
try {
121+
TelephonyManager tm = (TelephonyManager) context
122+
.getSystemService(Context.TELEPHONY_SERVICE);//
123+
imsi = tm.getSubscriberId();
124+
} catch (Exception e) {
125+
e.printStackTrace();
126+
}
127+
return imsi;
122128
}
123129

124130
/**

0 commit comments

Comments
 (0)