This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.fisherbone.fuzhu.utils;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
@@ -78,12 +79,12 @@ public class DeviceUtils {
|
||||
return UUIDStr;
|
||||
}
|
||||
} else {
|
||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE);
|
||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
return TODO;
|
||||
}
|
||||
String imei = telephonyManager.getDeviceId();
|
||||
@SuppressLint("MissingPermission") String imei = telephonyManager.getDeviceId();
|
||||
|
||||
return imei;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user