From 06be2ca90e07c7f3ddf43541581d9305e353a003 Mon Sep 17 00:00:00 2001 From: xLaMbChOpSx Date: Mon, 30 Jun 2014 18:43:07 +1000 Subject: [PATCH] Device Class Updates Small updates to methods providing data from the device class, flow on changes made to the Service and Device Fragment. Gradle updated with the release of Android Studio 0.8.1 --- .../AIMSICD/fragments/DeviceFragment.java | 1 + .../AIMSICD/service/AimsicdService.java | 6 +++- .../com/SecUpwN/AIMSICD/utils/Device.java | 31 +------------------ build.gradle | 2 +- 4 files changed, 8 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/fragments/DeviceFragment.java b/app/src/main/java/com/SecUpwN/AIMSICD/fragments/DeviceFragment.java index 4031e276c..ed2c95561 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/fragments/DeviceFragment.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/fragments/DeviceFragment.java @@ -103,6 +103,7 @@ private void updateUI() { TableLayout tableLayout; TableRow tr; if (mBound) { + mAimsicdService.refreshDevice(); tableLayout = (TableLayout) mView.findViewById(R.id.mainView); switch (mAimsicdService.mDevice.getPhoneID()) { case TelephonyManager.PHONE_TYPE_GSM: { diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/service/AimsicdService.java b/app/src/main/java/com/SecUpwN/AIMSICD/service/AimsicdService.java index 9d1ce9b61..2d9ac4be4 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/service/AimsicdService.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/service/AimsicdService.java @@ -197,7 +197,7 @@ public void onCreate() { prefs.registerOnSharedPreferenceChangeListener(this); loadPreferences(); - mDevice.refreshDeviceInfo(tm, lm); //Telephony Manager, Location Manager + mDevice.refreshDeviceInfo(tm); //Telephony Manager setNotification(); mRequestExecutor = new SamsungMulticlientRilExecutor(); @@ -500,6 +500,10 @@ public boolean handleMessage(Message msg) { } } + public void refreshDevice() { + mDevice.refreshDeviceInfo(tm); + } + /** * Process User Preferences */ diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Device.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Device.java index 397fd2432..5ceffac87 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Device.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Device.java @@ -26,65 +26,36 @@ public class Device { * Device Declarations */ private int mPhoneID = -1; - private int mMcc = -1; - private int mMnc = -1; - private int mSignalInfo = -1; - private int mNetID = -1; - private int mLac = -1; - private int mCellID = -1; - private int mSID = -1; - private int mPSC = -1; - private int mTimingAdvance = -1; - private double mLongitude = 0.0; - private double mLatitude = 0.0; - private String mNetType = ""; - private String mCellInfo = ""; - private String mDataState = ""; - private String mDataStateShort = ""; - private String mNetName = ""; - private String mMmcmcc = ""; - private String mSimCountry = ""; - private String mPhoneType = ""; - private String mIMEI = ""; - private String mIMEIV = ""; - private String mSimOperator = ""; - private String mSimOperatorName = ""; - private String mSimSerial = ""; - private String mSimSubs = ""; - private String mDataActivityType = ""; - private String mDataActivityTypeShort = ""; - private boolean mRoaming; private final List mNeighboringCells = new ArrayList<>(); - private Location mLastLocation; private static final int TWO_MINUTES = 1000 * 60 * 2; @@ -93,7 +64,7 @@ public class Device { /** * Refreshes all device specific details */ - public void refreshDeviceInfo(TelephonyManager tm, LocationManager lm) { + public void refreshDeviceInfo(TelephonyManager tm) { //Phone type and associated details mIMEI = tm.getDeviceId(); mIMEIV = tm.getDeviceSoftwareVersion(); diff --git a/build.gradle b/build.gradle index 6e6e9698d..d280c11e7 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:0.11.+' + classpath 'com.android.tools.build:gradle:0.12.+' } }