Commit f1cfecc566e9dbd794b6e85c0790b4831ec3d086

Authored by 孙向锦
1 parent e26f343f

华为专用平板1.4.0.3版本

C5/app/src/main/AndroidManifest.xml
... ... @@ -3,7 +3,7 @@
3 3 xmlns:tools="http://schemas.android.com/tools"
4 4 package="com.sunvote.xpadapp"
5 5 android:versionCode="70"
6   - android:versionName="1.4.0.2"> <!-- android:sharedUserId="android.studentUID.system" -->
  6 + android:versionName="1.4.0.3"> <!-- android:sharedUserId="android.studentUID.system" -->
7 7  
8 8 <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"></uses-permission>
9 9 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
... ...
C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java
... ... @@ -274,7 +274,8 @@ public class MainActivity extends BaseActivity implements ComListener {
274 274  
275 275 clearApkFile();
276 276 FirmUpdateFragment.clearUpdateFile();
277   - setOnlineFragment();
  277 +// setOnlineFragment();
  278 + setOfflineFragment();
278 279 if(!isUnlock()){
279 280 setUnlockScreen();
280 281 }
... ... @@ -1713,7 +1714,7 @@ public class MainActivity extends BaseActivity implements ComListener {
1713 1714  
1714 1715 }
1715 1716  
1716   - mOnlineInfo = info;
  1717 + mOnlineInfo = (OnLineInfo) info.clone();
1717 1718 runOnUiThread(new Runnable() {
1718 1719 @Override
1719 1720 public void run() {
... ...
C5/app/src/main/java/com/sunvote/xpadapp/presenter/XPadPresenter.java
... ... @@ -193,7 +193,7 @@ public class XPadPresenter implements ComListener {
193 193 public void onOnLineEvent(OnLineInfo info) {
194 194 lastRecvHeartBeatTime = System.currentTimeMillis();
195 195 cl.onOnLineEvent(info);
196   - if(mModelInfo==null){
  196 + if(mModelInfo==null && info.onLine == 1){
197 197 getWorkMode();
198 198 }
199 199 try {
... ... @@ -201,7 +201,7 @@ public class XPadPresenter implements ComListener {
201 201 } catch (InterruptedException e) {
202 202 LogUtil.e(TAG,e);
203 203 }
204   - if(mKeypadInfo == null){
  204 + if(mKeypadInfo == null && info.onLine == 1){
205 205 getKeypadParam();
206 206 }
207 207  
... ...
C5/app/src/main/java/com/sunvote/xpadcomm/XPadApi.java
... ... @@ -93,13 +93,13 @@ public class XPadApi implements XPadApiInterface {
93 93 mBuffer[4] = 0x70;
94 94 mBuffer[5] = 0x03;
95 95 writeToCom(mBuffer);
96   - }
  96 +
97 97 try {
98 98 Thread.sleep(100);
99 99 } catch (InterruptedException e) {
100 100 e.printStackTrace();
101 101 }
102   - byte[] mBuffer = new byte[0x1F + 4];
  102 + mBuffer = new byte[0x1F + 4];
103 103 Arrays.fill(mBuffer, (byte) 0x0);
104 104 mBuffer[0] = (byte) 0xF5;
105 105 mBuffer[1] = (byte) 0xAA;
... ... @@ -109,6 +109,10 @@ public class XPadApi implements XPadApiInterface {
109 109 mBuffer[4] = 0x70;
110 110 mBuffer[5] = 0x04;
111 111 writeToCom(mBuffer);
  112 + }else{
  113 + onLineInfo.onLine = 2 ;
  114 + m_listener.onOnLineEvent(onLineInfo);
  115 + }
112 116 return true;
113 117 }
114 118 });
... ...
C5/app/src/main/java/com/sunvote/xpadcomm/XPadApiInterface.java
... ... @@ -181,6 +181,23 @@ public interface XPadApiInterface {
181 181  
182 182 return Arrays.hashCode(new Object[]{onLine, idMode, chan, rssi, tx, rx, baseId, keyId, keySn, comError});
183 183 }
  184 +
  185 + @Override
  186 + public Object clone(){
  187 + OnLineInfo lineInfo = new OnLineInfo();
  188 + lineInfo.onLine = onLine;
  189 + lineInfo.idMode = idMode;
  190 + lineInfo.chan = chan;
  191 + lineInfo.rssi = rssi;
  192 + lineInfo.tx = tx;
  193 + lineInfo.rx = rx;
  194 + lineInfo.baseId = baseId;
  195 + lineInfo.keyId = keyId;
  196 + lineInfo.keySn = new String(keySn);
  197 + lineInfo.comError = comError;
  198 +
  199 + return lineInfo;
  200 + }
184 201 }
185 202  
186 203  
... ...
C5/app/src/main/java/com/sunvote/xpadcomm/usb/UsbTransferManager.java
... ... @@ -272,6 +272,9 @@ public class UsbTransferManager {
272 272 workHandler.post(usbConnectionReceiverTask);
273 273 }
274 274 }else{
  275 + if(onUsbConnectListener != null){
  276 + onUsbConnectListener.onConnect(false);
  277 + }
275 278 LogUtil.d(TAG, "未连接:" + ref);
276 279 }
277 280 return ref;
... ...