applicationId "mobile.miki"\r
minSdkVersion 18\r
targetSdkVersion 20\r
- versionCode 1\r
- versionName "20191116-0900"\r
+ versionCode 2\r
+ versionName "20191120-2030"\r
}\r
buildTypes {\r
release {\r
-[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"20191116-0900","enabled":true,"outputFile":"FactoryMode.apk","fullName":"release","baseName":"release"},"path":"FactoryMode.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":2,"versionName":"20191120-2030","enabled":true,"outputFile":"FactoryMode.apk","fullName":"release","baseName":"release"},"path":"FactoryMode.apk","properties":{}}]
\ No newline at end of file
readGpsThread = new ReadGpsThread();\r
readGpsThread.start();\r
locationManager.addGpsStatusListener(statusListener);//搜星\r
- getLocationInfo();\r
+ if(running){\r
+ if(pcbatest){\r
+ tvGps.setText(getString(R.string.pcbatest_gps_pass_rules));\r
+ }else{\r
+ tvGps.setText(getString(R.string.ageing_gps_pass_rules));\r
+ }\r
+ }else{\r
+ tvGps.setText(getString(R.string.gps_pass_rules));\r
+ }\r
+ getLocationInfo(); //设定GPS优先\r
\r
}\r
\r
private GpsStatus.Listener statusListener = new GpsStatus.Listener() {\r
public void onGpsStatusChanged(int event) { // GPS状态变化时的回调,如卫星数\r
GpsStatus status = locationManager.getGpsStatus(null); //取当前状态\r
- int satelliteInfo = updateGpsStatus(event, status);\r
- numberOfSatellites = satelliteInfo;\r
- if (numberOfSatellites >= 3) {\r
- tvResult.setText(getResources().getString(\r
- R.string.location_sucess));\r
- if (readGpsThread != null) {\r
- readGpsThread.endThread();\r
- }\r
- if (flag) {\r
- flag = false;\r
- pass();\r
- }\r
+ updateGpsStatus(event, status); //只更新状态\r
+ numberOfSatellites = numSatelliteList.size();\r
+\r
+ switch (event){\r
+ case GpsStatus.GPS_EVENT_SATELLITE_STATUS:\r
+\r
+ if (running && !pcbatest){\r
+ //如果是自动测试,则有3颗大于20的就算通过\r
+ if (max3Satellite.size() >= 3 && max3Satellite.get(2).getSnr()>=30) {\r
+ tvResult.setText(getResources().getString(\r
+ R.string.location_sucess));\r
+ if (readGpsThread != null) {\r
+ readGpsThread.endThread();\r
+ }\r
+ if (flag) {\r
+ flag = false;\r
+ pass();\r
+ }\r
+ }\r
+ }\r
+ if (running && pcbatest){\r
+ //如果是pcba测试,则只要有一颗大于30的星就算通过。\r
+ if (max3Satellite.size() > 0 && max3Satellite.get(0).getSnr()>=30) {\r
+ tvResult.setText(getResources().getString(\r
+ R.string.location_sucess));\r
+ if (readGpsThread != null) {\r
+ readGpsThread.endThread();\r
+ }\r
+ if (flag) {\r
+ flag = false;\r
+ pass();\r
+ }\r
+ }\r
+ }\r
+\r
+ break;\r
+ case GpsStatus.GPS_EVENT_FIRST_FIX:\r
+ //普通测试,必须定位才算通过\r
+ tvResult.setText(getResources().getString(\r
+ R.string.location_sucess));\r
+ if (readGpsThread != null) {\r
+ readGpsThread.endThread();\r
+ }\r
+ if (flag) {\r
+ flag = false;\r
+ pass();\r
+ }\r
+ break;\r
+ case GpsStatus.GPS_EVENT_STARTED:\r
+ // tvGps.setText("GPS_EVENT_STARTED");\r
+ break;\r
+ case GpsStatus.GPS_EVENT_STOPPED:\r
+ // tvGps.setText("GPS_EVENT_STOPPED");\r
+ break;\r
+ default:\r
+ break;\r
}\r
\r
+\r
+\r
+\r
}\r
};\r
\r
private void get3MaxSnrSatellite(GpsSatellite gst){\r
\r
float snr = gst.getSnr();\r
+ for (int k=0;k<max3Satellite.size();k++) {\r
+ if( max3Satellite.get(k).getPrn()==gst.getPrn())\r
+ max3Satellite.remove(k);\r
+ }\r
max3Satellite.add(gst);//先添加进来。\r
\r
//从大到小排序\r
while (it.hasNext() && count <= maxSatellites) {\r
GpsSatellite s = it.next();\r
float snr = s.getSnr();\r
- if (snr >= 20) {//只有信躁比不为0的时候才算搜到了星\r
+ if (snr > 0) {//只有信躁比不为0的时候才算搜到了星\r
strengh = snr;\r
// Toast.makeText(this, "信躁比大于20", Toast.LENGTH_LONG).show();\r
//排序取得最大3个SNR\r
get3MaxSnrSatellite(s);\r
+ numSatelliteList.add(s);\r
}\r
- numSatelliteList.add(s);\r
+\r
count++;\r
}\r
- sb2.append("搜索到卫星个数(SNR>20):" + numSatelliteList.size()+" \n Max 3 SNRs[ " );\r
+ sb2.append("搜索到卫星个数(SNR>0):" + numSatelliteList.size()+" \n Max 3 SNRs[ " );\r
for (int i=0;i<max3Satellite.size();i++){\r
sb2.append(max3Satellite.get(i).getSnr());\r
sb2.append(", ");\r
Log.e("dxc", sb2.toString());\r
//tv_satellites.setText(null);\r
tv_satellites.setText(sb2);\r
- if (strengh >= 20 && numSatelliteList.size() >= 3) {\r
- return numSatelliteList.size();\r
- }\r
\r
return 0;\r
}\r
\r
@Override\r
public void onClick(View arg0) {\r
- Intent intent = new Intent(this, DialerTestActivity.class);\r
+ Intent intent ;\r
+\r
+ if (pcbatest){\r
+ intent = new Intent(this, GravitySensorActivity.class);\r
+\r
+ }else{\r
+ intent = new Intent(this, DialerTestActivity.class);\r
+ }\r
+\r
intent.putExtra("running", true);\r
intent.putExtra("pcbatest",pcbatest);\r
Intent intent1 = new Intent(this, TestMainActivity.class);\r
private LinearLayout mapcopytools;
private TextView Factory_test_title;
private LinearLayout download_mode;
+ private LinearLayout shutdown_system;
private LinearLayout dial;
private LinearLayout flagPosition;
mapcopytools = (LinearLayout) findViewById(R.id.map_copy_tools);
Factory_test_title = (TextView) findViewById(R.id.Factory_test_title);
download_mode = (LinearLayout) findViewById(R.id.download_mode);
+ shutdown_system = (LinearLayout)findViewById(R.id.shutdown_system);
dial = (LinearLayout)findViewById(R.id.dail);
download_mode.setVisibility(View.GONE);
flagPosition = (LinearLayout)findViewById(R.id.flagposiontion);
download_mode.setOnClickListener(this);
dial.setOnClickListener(this);
flagPosition.setOnClickListener(this);
+ shutdown_system.setOnClickListener(this);
// Log.d(TAG, "onCreate");
Settings.System.putInt(getContentResolver(), "mobile.miki.FactoryModeRunning", 1);
break;
+ case R.id.shutdown_system:
+ Intent ii = new Intent();
+ ii.setAction("com.eqc.shutdown_sos_noneed");
+ startActivity(ii);
+ break;
case R.id.Factory_test_title:
long secondTime = System.currentTimeMillis();
// 判断每次点击的事件间隔是否符合连击的有效范围
android:layout_height="1dp"\r
android:background="#c0c0c0" />\r
\r
+ <LinearLayout\r
+ android:id="@+id/shutdown_system"\r
+ android:layout_width="match_parent"\r
+ android:layout_height="match_parent"\r
+ android:layout_weight="1"\r
+ android:background="@drawable/listpress"\r
+ android:gravity="center_vertical"\r
+ android:orientation="vertical">\r
+\r
+ <TextView\r
+ style="@style/title_text_large_style"\r
+ android:layout_width="match_parent"\r
+ android:layout_height="match_parent"\r
+ android:gravity="center"\r
+ android:text="@string/poweroff"\r
+ android:textSize="22sp" />\r
+\r
+ <TextView\r
+ style="@style/content_text_medium_style"\r
+ android:layout_width="match_parent"\r
+ android:layout_height="match_parent"\r
+ android:layout_marginTop="2dp"\r
+ android:gravity="center_vertical"\r
+ android:text="@string/Engineer_mode_title"\r
+ android:visibility="gone" />\r
+ </LinearLayout>\r
+\r
+ <View\r
+ android:id="@+id/view2"\r
+ android:layout_width="match_parent"\r
+ android:layout_height="1dp"\r
+ android:background="#c0c0c0" />\r
+\r
<LinearLayout\r
android:id="@+id/dail"\r
android:layout_width="match_parent"\r
<string name="brightness_test">屏幕亮度(请拖动滚动条):</string>\r
<string name="acc_test">acc点火测试</string>\r
<string name="brightLight">按键灯测试</string>\r
-\r
+ <string name="pcbatest_gps_pass_rules">通过标准:有1颗星 SNR > 30 </string>\r
+ <string name="ageing_gps_pass_rules">通过标准:有3颗星 SNR > 30</string>\r
+ <string name="gps_pass_rules">通过标准:GPS必须定位</string>\r
<string name="ring_test">正在播放音乐,请注意收听...</string>\r
<string name="fm_isRing">提示:将收音机的频率调至101.0MHZ,测试收音机是否收到音乐,收到则成功,反之则失败。</string>\r
<string name="sim_hasRead">已识别</string>\r
<string name="china_dianxin"> "中国电信" </string>\r
<string name="sim_fail1"> "SIM卡过期" </string>\r
<string name="benji"> " 工厂测试" </string>\r
+ <string name="poweroff">关机</string>\r
<string name="gongcheng"> "工厂测试" </string>\r
<string name="moshi"> "工程模式" </string>\r
<string name="shintool"> "地图拷贝工具" </string>\r
<string name="start_test_new">Start Testing</string>\r
<string name="benji">Factory test</string>\r
<string name="resunme">Reset</string>\r
+ <string name="poweroff">PowerOff</string>\r
<string name="tip2">Logo: pass (green), not pass (red), not measured (white)</string>\r
<string name="clear_new">Clear the test data</string>\r
<string name="version_new">Version and calibration</string>\r
<string name="fail">FAIL</string>\r
<string name="success">SUCCESS</string>\r
<string name="network">network</string>\r
+ <string name="pcbatest_gps_pass_rules">Pass Rule: one satellite SNR > 30 </string>\r
+ <string name="ageing_gps_pass_rules">Pass Rule: 3 satellites SNR > 30</string>\r
+ <string name="gps_pass_rules">Pass Rule: GPS Must Fixed</string>\r
<string name="location_sucess">Location success </string>\r
<string name="location_fail">Location fail</string>\r
<string name="gps_searching">Getting Gps information...</string>\r