Commit 82c80498 by sikang

bug fix

parent 84db658a
......@@ -123,32 +123,37 @@ public class DeviceUtils {
* 如果APP更改了语言,需要在更改之前初始化
*/
public void init(Context context) {
deviceInfoBean.setScreenWidth(context.getResources().getDisplayMetrics().widthPixels);
deviceInfoBean.setScreenHeight(context.getResources().getDisplayMetrics().heightPixels);
deviceInfoBean.setRoot(AppInfoUtils.isRoot());
deviceInfoBean.setAndroidId(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID));
deviceInfoBean.setLocal(Locale.getDefault());
deviceInfoBean.setTimeZone(TimeZone.getDefault());
long[] ramInfo = getRAMInfo(context);
deviceInfoBean.setTotalMemory(ramInfo[0]);
deviceInfoBean.setFreeMemory(ramInfo[1]);
long[] romInfo = getROMInfo();
deviceInfoBean.setDiskSpace(romInfo[0]);
deviceInfoBean.setDiskFreeSpace(romInfo[1]);
deviceInfoBean.setAppSign(BuildConfig.KEYSTORE_SIGN);
deviceInfoBean.setBaseBandVersion(getBaseBandVersion());
deviceInfoBean.setBattery(getBattery(context));
deviceInfoBean.setBluetooth(Settings.Secure.getString(context.getContentResolver(), "bluetooth_address"));
deviceInfoBean.setCameraNum(Camera.getNumberOfCameras());
deviceInfoBean.setDebug((Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADB_ENABLED, 0) > 0));
deviceInfoBean.setSimulator(isSimulator());
deviceInfoBean.setKernelVersion(getKernelVersion());
deviceInfoBean.setMacAddress(getMacAddress());
deviceInfoBean.setUpTime(SystemClock.elapsedRealtime());
try {
deviceInfoBean.setScreenWidth(context.getResources().getDisplayMetrics().widthPixels);
deviceInfoBean.setScreenHeight(context.getResources().getDisplayMetrics().heightPixels);
deviceInfoBean.setRoot(AppInfoUtils.isRoot());
deviceInfoBean.setAndroidId(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID));
deviceInfoBean.setLocal(Locale.getDefault());
deviceInfoBean.setTimeZone(TimeZone.getDefault());
long[] ramInfo = getRAMInfo(context);
deviceInfoBean.setTotalMemory(ramInfo[0]);
deviceInfoBean.setFreeMemory(ramInfo[1]);
long[] romInfo = getROMInfo();
deviceInfoBean.setDiskSpace(romInfo[0]);
deviceInfoBean.setDiskFreeSpace(romInfo[1]);
deviceInfoBean.setAppSign(BuildConfig.KEYSTORE_SIGN);
deviceInfoBean.setBaseBandVersion(getBaseBandVersion());
deviceInfoBean.setBattery(getBattery(context));
deviceInfoBean.setBluetooth(Settings.Secure.getString(context.getContentResolver(), "bluetooth_address"));
deviceInfoBean.setDebug((Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADB_ENABLED, 0) > 0));
deviceInfoBean.setSimulator(isSimulator());
deviceInfoBean.setKernelVersion(getKernelVersion());
deviceInfoBean.setMacAddress(getMacAddress());
deviceInfoBean.setUpTime(SystemClock.elapsedRealtime());
deviceInfoBean.setCameraNum(Camera.getNumberOfCameras());
}catch (Exception e){
}
// WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
// deviceInfoBean.setWifiSsid(wifi.getConnectionInfo().getSSID());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment