add a enter point of temperature test.
authorTrillGates <williamtrillgates@gmail.com>
Thu, 3 Jun 2021 12:13:15 +0000 (20:13 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Thu, 3 Jun 2021 12:13:15 +0000 (20:13 +0800)
app/release/FactoryMode_V101_202106031710_release.apk [moved from app/release/FactoryMode_V96_202105212033_release.apk with 93% similarity]
app/release/output.json
app/src/main/java/mobile/miki/mainui/TestMainList.java
app/src/main/res/layout/dig_layout_testlist.xml
app/src/main/res/layout/dig_layout_testlist_280.xml
app/src/main/res/values-zh-rCN/strings.xml
app/src/main/res/values/strings.xml
app/version_code.properties

similarity index 93%
rename from app/release/FactoryMode_V96_202105212033_release.apk
rename to app/release/FactoryMode_V101_202106031710_release.apk
index 71040da..5ab005e 100644 (file)
Binary files a/app/release/FactoryMode_V96_202105212033_release.apk and b/app/release/FactoryMode_V101_202106031710_release.apk differ
index 5766678..1f14df6 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":96,"versionName":"202105212033","enabled":true,"outputFile":"FactoryMode_V96_202105212033_release.apk","fullName":"release","baseName":"release"},"path":"FactoryMode_V96_202105212033_release.apk","properties":{}}]
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":101,"versionName":"202106031710","enabled":true,"outputFile":"FactoryMode_V101_202106031710_release.apk","fullName":"release","baseName":"release"},"path":"FactoryMode_V101_202106031710_release.apk","properties":{}}]
\ No newline at end of file
index b623f12..8d4d51f 100644 (file)
@@ -5,6 +5,7 @@ import android.content.ComponentName;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
+import android.content.IntentFilter;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.os.Bundle;
@@ -12,6 +13,7 @@ import android.os.Handler;
 import android.os.Message;
 import android.provider.Settings;
 import android.provider.Settings.SettingNotFoundException;
+import android.support.v4.app.INotificationSideChannel;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.LinearLayout;
@@ -38,348 +40,362 @@ import mobile.miki.shutdown_activity;
 
 /*add tyy  程序主入口 */
 public class TestMainList extends BaseActivity implements OnClickListener {
-       public static final String FORMAT_AND_FACTORY_RESET = "com.android.internal.os.storage.FORMAT_AND_FACTORY_RESET";
-       private static final String MASTER_CLEAR = "android.intent.action.MASTER_CLEAR";
-       private LinearLayout moblietest;
-       private LinearLayout pcbatest;
-       private LinearLayout engineermodetest;
-       private LinearLayout  ageingmodetest;
-       private LinearLayout mapcopytools;
-       private TextView Factory_test_title;
-       private LinearLayout download_mode;
-       private LinearLayout shutdown_system;
-       private LinearLayout dial;
-       private LinearLayout flagPosition;
+    public static final String FORMAT_AND_FACTORY_RESET = "com.android.internal.os.storage.FORMAT_AND_FACTORY_RESET";
+    private static final String MASTER_CLEAR = "android.intent.action.MASTER_CLEAR";
+    private LinearLayout moblietest;
+    private LinearLayout pcbatest;
+    private LinearLayout engineermodetest;
+    private LinearLayout ageingmodetest;
+    private LinearLayout mapcopytools;
+    private TextView Factory_test_title;
+    private LinearLayout download_mode;
+    private LinearLayout shutdown_system;
+    private LinearLayout dial;
+    private LinearLayout flagPosition;
     private LinearLayout gpsFulltest;
     private LinearLayout tempAdjust;
-       @Override
-       protected void onCreate(Bundle savedInstanceState) {
-               // TODO Auto-generated method stub
-               super.onCreate(savedInstanceState);
-               MyApplication.getInstance().addActivity(this);
-               if (FTUtils.isGT09()) {
-                       setContentView(R.layout.dig_layout_testlist_280);
-               } else {
-                       setContentView(R.layout.dig_layout_testlist);
-               }
-
-               pcbatest = (LinearLayout) findViewById(R.id.pcba_test);
-               moblietest = (LinearLayout) findViewById(R.id.moblie_test);
-               engineermodetest = (LinearLayout) findViewById(R.id.engineer_mode_test);
-               ageingmodetest = (LinearLayout) findViewById(R.id.ageing_mode);
-               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);
+    private LinearLayout tempDataGet;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        // TODO Auto-generated method stub
+        super.onCreate(savedInstanceState);
+        MyApplication.getInstance().addActivity(this);
+        if (FTUtils.isGT09()) {
+            setContentView(R.layout.dig_layout_testlist_280);
+        } else {
+            setContentView(R.layout.dig_layout_testlist);
+        }
+
+        pcbatest = (LinearLayout) findViewById(R.id.pcba_test);
+        moblietest = (LinearLayout) findViewById(R.id.moblie_test);
+        engineermodetest = (LinearLayout) findViewById(R.id.engineer_mode_test);
+        ageingmodetest = (LinearLayout) findViewById(R.id.ageing_mode);
+        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);
 
         gpsFulltest = (LinearLayout) findViewById(R.id.gps_full_test);
 
-        tempAdjust = (LinearLayout)findViewById(R.id.tempAdjustLayout);
-               flagPosition = (LinearLayout)findViewById(R.id.flagposiontion);
-               if (!FTUtils.isSugar()) {
-                       flagPosition.setVisibility(View.GONE);
-               }
-
-               if(FTUtils.doPCBATest()){
-                       pcbatest.setVisibility(View.VISIBLE);
-               }else{
-                       pcbatest.setVisibility(View.GONE);
-               }
-
-               String title=Factory_test_title.getText().toString();
-               Factory_test_title.setText(title+" "+getVersionCode());
-               pcbatest.setOnClickListener(this);
-               moblietest.setOnClickListener(this);
-               engineermodetest.setOnClickListener(this);
-               ageingmodetest.setOnClickListener(this);
-               mapcopytools.setOnClickListener(this);
-               Factory_test_title.setOnClickListener(this);
-               download_mode.setOnClickListener(this);
-               dial.setOnClickListener(this);
-               flagPosition.setOnClickListener(this);
-               shutdown_system.setOnClickListener(this);
+        tempAdjust = (LinearLayout) findViewById(R.id.tempAdjustLayout);
+        flagPosition = (LinearLayout) findViewById(R.id.flagposiontion);
+        tempDataGet = (LinearLayout) findViewById(R.id.temp_data_get);
+        if (!FTUtils.isSugar()) {
+            flagPosition.setVisibility(View.GONE);
+        }
+
+        if (FTUtils.doPCBATest()) {
+            pcbatest.setVisibility(View.VISIBLE);
+        } else {
+            pcbatest.setVisibility(View.GONE);
+        }
+
+        String title = Factory_test_title.getText().toString();
+        Factory_test_title.setText(title + " " + getVersionCode());
+        pcbatest.setOnClickListener(this);
+        moblietest.setOnClickListener(this);
+        engineermodetest.setOnClickListener(this);
+        ageingmodetest.setOnClickListener(this);
+        mapcopytools.setOnClickListener(this);
+        Factory_test_title.setOnClickListener(this);
+        download_mode.setOnClickListener(this);
+        dial.setOnClickListener(this);
+        flagPosition.setOnClickListener(this);
+        shutdown_system.setOnClickListener(this);
         gpsFulltest.setOnClickListener(this);
         tempAdjust.setOnClickListener(this);
+        tempDataGet.setOnClickListener(this);
 //             Log.d(TAG, "onCreate");
-               Settings.System.putInt(getContentResolver(), "mobile.miki.FactoryModeRunning", 1);
-               Config.initConfig(this);
-       }
-       public  String getVersionCode( )  {
-               // 获取packagemanager的实例
-               PackageManager packageManager = this.getPackageManager();
-               // getPackageName()是你当前类的包名
-               try {
-                       PackageInfo packInfo = packageManager.getPackageInfo(this.getPackageName(), 0);
-                       String version = "V"+packInfo.versionCode;
-                       return version;
-
-               }catch (Exception e){
-                       e.printStackTrace();
-               }
-               return "";
-       }
-       @Override
-       protected void onResume() {
-               // TODO Auto-generated method stub
-               super.onResume();
-       }
-
-       @Override
-       protected void onDestroy() {
-               // TODO Auto-generated method stub
-               Settings.System.putInt(getContentResolver(), "mobile.miki.FactoryModeRunning", 0);
+        Settings.System.putInt(getContentResolver(), "mobile.miki.FactoryModeRunning", 1);
+        Config.initConfig(this);
+    }
+
+    public String getVersionCode() {
+        // 获取packagemanager的实例
+        PackageManager packageManager = this.getPackageManager();
+        // getPackageName()是你当前类的包名
+        try {
+            PackageInfo packInfo = packageManager.getPackageInfo(this.getPackageName(), 0);
+            String version = "V" + packInfo.versionCode;
+            return version;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+    @Override
+    protected void onResume() {
+        // TODO Auto-generated method stub
+        super.onResume();
+    }
+
+    @Override
+    protected void onDestroy() {
+        // TODO Auto-generated method stub
+        Settings.System.putInt(getContentResolver(), "mobile.miki.FactoryModeRunning", 0);
 //             Log.d(TAG, "onDestroy");
-               super.onDestroy();
-       }
-
-       @Override
-       protected void onPause() {
-               // TODO Auto-generated method stub
-               super.onPause();
-       }
-
-       @Override
-       public void onClick(View view) {
-               // TODO Auto-generated method stub
-               Intent intent;
-               switch (view.getId()) {
-               case R.id.pcba_test:
-                       intent = new Intent(TestMainList.this, VersionActivity.class);
-                       intent.putExtra("running", true);
-                       intent.putExtra("pcbatest", true);
-                       startActivityForResult(intent, 0);
-                       break;
-               case R.id.moblie_test:
-                       intent = new Intent(TestMainList.this, VersionActivity.class);
-                       intent.putExtra("running", true);
-                       intent.putExtra("pcbatest", false);
-                       startActivityForResult(intent, 0);
-                       break;
-               case R.id.engineer_mode_test:
-                       intent = new Intent(TestMainList.this, TestMainActivity.class);
-                       intent.putExtra("home", false);
-                       startActivity(intent);
-                       break;
-               case R.id.ageing_mode:
-                       intent = new Intent(TestMainList.this, AgeingModeActivity.class);
-                       startActivity(intent);
-                       break;
-               case R.id.map_copy_tools:
-
-                       intent = new Intent(TestMainList.this, FactoryReset_activity.class);
-                       startActivity(intent);
-
-                       break;
-
-               case R.id.shutdown_system:
-                       intent = new Intent(TestMainList.this, shutdown_activity.class);
-                       startActivity(intent);
+        super.onDestroy();
+    }
+
+    @Override
+    protected void onPause() {
+        // TODO Auto-generated method stub
+        super.onPause();
+    }
+
+    @Override
+    public void onClick(View view) {
+        // TODO Auto-generated method stub
+        Intent intent;
+        switch (view.getId()) {
+            case R.id.pcba_test:
+                intent = new Intent(TestMainList.this, VersionActivity.class);
+                intent.putExtra("running", true);
+                intent.putExtra("pcbatest", true);
+                startActivityForResult(intent, 0);
+                break;
+            case R.id.moblie_test:
+                intent = new Intent(TestMainList.this, VersionActivity.class);
+                intent.putExtra("running", true);
+                intent.putExtra("pcbatest", false);
+                startActivityForResult(intent, 0);
+                break;
+            case R.id.engineer_mode_test:
+                intent = new Intent(TestMainList.this, TestMainActivity.class);
+                intent.putExtra("home", false);
+                startActivity(intent);
+                break;
+            case R.id.ageing_mode:
+                intent = new Intent(TestMainList.this, AgeingModeActivity.class);
+                startActivity(intent);
+                break;
+            case R.id.map_copy_tools:
+
+                intent = new Intent(TestMainList.this, FactoryReset_activity.class);
+                startActivity(intent);
+
+                break;
+
+            case R.id.shutdown_system:
+                intent = new Intent(TestMainList.this, shutdown_activity.class);
+                startActivity(intent);
 //                     Intent ii = new Intent();
 //                     ii.setAction("com.eqc.shutdown_sos_noneed");
 //                     startActivity(ii);
-                       break;
-               case R.id.Factory_test_title:
-                       long secondTime = System.currentTimeMillis();
-                       // 判断每次点击的事件间隔是否符合连击的有效范围
-                       // 不符合时,有可能是连击的开始,否则就仅仅是单击
-                       if (secondTime - firstTime <= interval) {
-
-                               ++count1;
-                       } else {
-
-                               count1 = 1;
-                       }
-                       // 延迟,用于判断用户的点击操作是否结束
-                       delay();
-                       firstTime = secondTime;
-                       break;
-
-               case R.id.download_mode:
-                       intent = new Intent(TestMainList.this, DownLoad.class);
-                       startActivity(intent);
-                       break;
-               case R.id.dail:
-                       intent = new Intent();
-                       intent.setComponent(new ComponentName("com.android.dialer", "com.android.dialer.DialtactsActivity"));
-                       startActivity(intent);
-                       break;
-               case R.id.flagposiontion:
-                       intent = new Intent(TestMainList.this, FlagPositionActivity.class);
-                       startActivity(intent);
-                       break;
-        case R.id.gps_full_test:
-            intent = new Intent(TestMainList.this, GPSActivity.class);
-            startActivity(intent);
-            break;
-               case R.id.tempAdjustLayout:
-                       intent = new Intent(TestMainList.this, TemperatureAdjustActivity.class);
-                       startActivity(intent);
-                       break;
-               default:
-                       break;
-               }
-       }
-
-       private int count1 = 0;
-       private long firstTime = 0;
-       private Timer delayTimer;
-       private TimerTask task;
-       private long interval = 500;
-       private static final String ALLOW_INSTALL_ACTION = "intent.action.xls.allow.install";
-
-       // 延迟时间是连击的时间间隔有效范围
-       private void delay() {
-               if (task != null) {
-                       task.cancel();
-               }
-
-               task = new TimerTask() {
-                       @Override
-                       public void run() {
-
-                               Message message = new Message();
-                               message.what = 0;
-                               mHandler.sendMessage(message);
-
-                       }
-               };
-               delayTimer = new Timer();
-               delayTimer.schedule(task, interval);
-       }
-
-       private Handler mHandler = new Handler() {
-               public void handleMessage(android.os.Message msg) {
-
-                       switch (msg.what) {
-                       case 0:// 点击事件结束后的事件处理
-                               if (count1 >= 8) {
-
-                                       delayTimer.cancel();
-                                       count1 = 0;
-                                       Intent intent = new Intent(TestMainList.this, ModeSelectActivity.class);
-                                       intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-                                       startActivity(intent);
+                break;
+            case R.id.Factory_test_title:
+                long secondTime = System.currentTimeMillis();
+                // 判断每次点击的事件间隔是否符合连击的有效范围
+                // 不符合时,有可能是连击的开始,否则就仅仅是单击
+                if (secondTime - firstTime <= interval) {
+
+                    ++count1;
+                } else {
+
+                    count1 = 1;
+                }
+                // 延迟,用于判断用户的点击操作是否结束
+                delay();
+                firstTime = secondTime;
+                break;
+
+            case R.id.download_mode:
+                intent = new Intent(TestMainList.this, DownLoad.class);
+                startActivity(intent);
+                break;
+            case R.id.dail:
+                intent = new Intent();
+                intent.setComponent(new ComponentName("com.android.dialer", "com.android.dialer.DialtactsActivity"));
+                startActivity(intent);
+                break;
+            case R.id.flagposiontion:
+                intent = new Intent(TestMainList.this, FlagPositionActivity.class);
+                startActivity(intent);
+                break;
+            case R.id.gps_full_test:
+                intent = new Intent(TestMainList.this, GPSActivity.class);
+                startActivity(intent);
+                break;
+            case R.id.tempAdjustLayout:
+                intent = new Intent(TestMainList.this, TemperatureAdjustActivity.class);
+                startActivity(intent);
+                break;
+            case R.id.temp_data_get:
+                intent = new Intent();
+                ComponentName componentName = new ComponentName("com.ic.temperaturetest", "com.ic.temperaturetest.MainActivity");
+                intent.setComponent(componentName);
+                startActivity(intent);
+                break;
+            default:
+                break;
+        }
+    }
+
+    private int count1 = 0;
+    private long firstTime = 0;
+    private Timer delayTimer;
+    private TimerTask task;
+    private long interval = 500;
+    private static final String ALLOW_INSTALL_ACTION = "intent.action.xls.allow.install";
+
+    // 延迟时间是连击的时间间隔有效范围
+    private void delay() {
+        if (task != null) {
+            task.cancel();
+        }
+
+        task = new TimerTask() {
+            @Override
+            public void run() {
+
+                Message message = new Message();
+                message.what = 0;
+                mHandler.sendMessage(message);
+
+            }
+        };
+        delayTimer = new Timer();
+        delayTimer.schedule(task, interval);
+    }
+
+    private Handler mHandler = new Handler() {
+        public void handleMessage(android.os.Message msg) {
+
+            switch (msg.what) {
+                case 0:// 点击事件结束后的事件处理
+                    if (count1 >= 8) {
+
+                        delayTimer.cancel();
+                        count1 = 0;
+                        Intent intent = new Intent(TestMainList.this, ModeSelectActivity.class);
+                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                        startActivity(intent);
 //                                     Intent intent=new Intent();
 //                                     intent.setAction(ALLOW_INSTALL_ACTION);
 //                                     sendBroadcast(intent);
 //                                     sendBroadcast(intent);
 //                                     Toast.makeText(TestMainList.this, "已经解除安装限制!", Toast.LENGTH_SHORT).show();
 //                                     chooseDialog();
-                               }
-                               super.handleMessage(msg);
-                       }
-               };
-       };
-
-       @Override
-       public void onBackPressed() {
-               MyApplication.getInstance().exit();
-
-               finish();
-               android.os.Process.killProcess(android.os.Process.myPid());
-               System.exit(0);
-       }
-       
-       
-       private void chooseDialog() {
-               int closeCarRecord = 0;
-               try {
-                       closeCarRecord = Settings.System.getInt(getContentResolver(), "closeCarRecord");
-               } catch (SettingNotFoundException e) {
-                       e.printStackTrace();
-               }
-               final HashMap<Integer,Boolean> sboolean = new HashMap<Integer,Boolean>();
-               if(closeCarRecord == 0) {
-                       sboolean.put(0, false);
-               } else if (closeCarRecord == 1){
-                       sboolean.put(0, true);
-               }
-               sboolean.put(1, false);
-               final ArrayList<String> list = new ArrayList<String>();
-               final String[] items = { "关闭行车记录仪","解除安装限制"};
-               boolean[] selected = new boolean[items.length];
-               for (int i = 0; i < selected.length; i++) {
-                       selected[i] =  sboolean.get(i);
-                       //selected[i] = false;
-               }
-               AlertDialog.Builder builder = new AlertDialog.Builder(TestMainList.this);
-               builder.setIcon(R.drawable.ic_launcher);
-               builder.setTitle("请选择");
-               builder.setMultiChoiceItems(items, selected,
-                               new DialogInterface.OnMultiChoiceClickListener() {
-
-                                       @Override
-                                       public void onClick(DialogInterface dialog, int which,
-                                                       boolean isChecked) {
-                                               // TODO Auto-generated method stub
-                                               if (isChecked) {
-                                                       list.add(items[which]);
-                                               } else {
-                                                       list.remove(items[which]);
-                                               }
-                                               sboolean.put(which, isChecked);
-                                               
-                                       }
-                               });
-               builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
-                       @Override
-                       public void onClick(DialogInterface dialog, int which) {
-                               if(list.size() == 0) {
-                                       Settings.System.putInt(getContentResolver(),
-                                                       "closeCarRecord", 0);
-                               } else if(list.size() > 0) {
-                                       if(list.size() == 1) {
-                                               if(list.get(0).equals(items[0])) {
-                                                       closeRecord();
-                                               }else {
-                                                       openRecord();
-                                                       allowInstall();
-                                               }
-                                       } else if(list.size() == 2) {
-                                               closeRecord();
-                                               allowInstall();
-                                       }
-                               }
-
-                       }
-               });
-               builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
-
-                       @Override
-                       public void onClick(DialogInterface dialog, int which) {
-
-                       }
-               });
-               builder.create().show();
-       }
-       
-       /**
-        * 关闭行车记录仪
-        */
-       private void closeRecord() {
-               Settings.System.putInt(getContentResolver(),
-                               "closeCarRecord", 1);
-       }
-       
-       /**
-        * 打开行车记录仪
-        */
-       private void openRecord() {
-               Settings.System.putInt(getContentResolver(),
-                               "closeCarRecord", 0);
-       }
-       
-       /**
-        * 解决安全限制
-        */
-       private void allowInstall() {
-               Intent intent=new Intent();
-               intent.setAction(ALLOW_INSTALL_ACTION);
-               sendBroadcast(intent);
-               sendBroadcast(intent);
-               Toast.makeText(TestMainList.this, "已经解除安装限制!", Toast.LENGTH_SHORT).show();
-       }
+                    }
+                    super.handleMessage(msg);
+            }
+        }
+
+        ;
+    };
+
+    @Override
+    public void onBackPressed() {
+        MyApplication.getInstance().exit();
+
+        finish();
+        android.os.Process.killProcess(android.os.Process.myPid());
+        System.exit(0);
+    }
+
+
+    private void chooseDialog() {
+        int closeCarRecord = 0;
+        try {
+            closeCarRecord = Settings.System.getInt(getContentResolver(), "closeCarRecord");
+        } catch (SettingNotFoundException e) {
+            e.printStackTrace();
+        }
+        final HashMap<Integer, Boolean> sboolean = new HashMap<Integer, Boolean>();
+        if (closeCarRecord == 0) {
+            sboolean.put(0, false);
+        } else if (closeCarRecord == 1) {
+            sboolean.put(0, true);
+        }
+        sboolean.put(1, false);
+        final ArrayList<String> list = new ArrayList<String>();
+        final String[] items = {"关闭行车记录仪", "解除安装限制"};
+        boolean[] selected = new boolean[items.length];
+        for (int i = 0; i < selected.length; i++) {
+            selected[i] = sboolean.get(i);
+            //selected[i] = false;
+        }
+        AlertDialog.Builder builder = new AlertDialog.Builder(TestMainList.this);
+        builder.setIcon(R.drawable.ic_launcher);
+        builder.setTitle("请选择");
+        builder.setMultiChoiceItems(items, selected,
+                new DialogInterface.OnMultiChoiceClickListener() {
+
+                    @Override
+                    public void onClick(DialogInterface dialog, int which,
+                                        boolean isChecked) {
+                        // TODO Auto-generated method stub
+                        if (isChecked) {
+                            list.add(items[which]);
+                        } else {
+                            list.remove(items[which]);
+                        }
+                        sboolean.put(which, isChecked);
+
+                    }
+                });
+        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+            @Override
+            public void onClick(DialogInterface dialog, int which) {
+                if (list.size() == 0) {
+                    Settings.System.putInt(getContentResolver(),
+                            "closeCarRecord", 0);
+                } else if (list.size() > 0) {
+                    if (list.size() == 1) {
+                        if (list.get(0).equals(items[0])) {
+                            closeRecord();
+                        } else {
+                            openRecord();
+                            allowInstall();
+                        }
+                    } else if (list.size() == 2) {
+                        closeRecord();
+                        allowInstall();
+                    }
+                }
+
+            }
+        });
+        builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
+
+            @Override
+            public void onClick(DialogInterface dialog, int which) {
+
+            }
+        });
+        builder.create().show();
+    }
+
+    /**
+     * 关闭行车记录仪
+     */
+    private void closeRecord() {
+        Settings.System.putInt(getContentResolver(),
+                "closeCarRecord", 1);
+    }
+
+    /**
+     * 打开行车记录仪
+     */
+    private void openRecord() {
+        Settings.System.putInt(getContentResolver(),
+                "closeCarRecord", 0);
+    }
+
+    /**
+     * 解决安全限制
+     */
+    private void allowInstall() {
+        Intent intent = new Intent();
+        intent.setAction(ALLOW_INSTALL_ACTION);
+        sendBroadcast(intent);
+        sendBroadcast(intent);
+        Toast.makeText(TestMainList.this, "已经解除安装限制!", Toast.LENGTH_SHORT).show();
+    }
 
 }
index 6db009f..53c9d16 100644 (file)
                 android:textSize="22sp" />\r
         </LinearLayout>\r
 \r
+        <View\r
+            android:id="@+id/view4"\r
+            android:layout_width="match_parent"\r
+            android:layout_height="wrap_content"\r
+            android:layout_weight="1"\r
+            android:background="#c0c0c0" />\r
+\r
+\r
+        <LinearLayout\r
+            android:id="@+id/temp_data_get"\r
+            android:layout_width="match_parent"\r
+            android:layout_height="match_parent"\r
+            android:layout_weight="1"\r
+            android:background="@drawable/listpress"\r
+            android:clickable="true"\r
+            android:gravity="center_vertical"\r
+            android:orientation="vertical">\r
+\r
+            <TextView\r
+                android:id="@+id/temp_data_get_Tv"\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:layout_weight="1"\r
+                android:gravity="center_vertical"\r
+                android:text="@string/Engineer_mode_title"\r
+                android:visibility="gone" />\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/temp_data_get_text"\r
+                android:textSize="15sp" />\r
+        </LinearLayout>\r
+\r
+\r
     </LinearLayout>\r
 </ScrollView>
\ No newline at end of file
index 9234bd1..73588d0 100644 (file)
@@ -2,8 +2,7 @@
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    >
+    android:layout_height="match_parent">
 
     <LinearLayout
         android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="1dp"
             android:background="#c0c0c0" />
+
         <LinearLayout
             android:id="@+id/flagposiontion"
             android:layout_width="match_parent"
                 android:textSize="15sp" />
         </LinearLayout>
 
+        <View
+            android:id="@+id/view4"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:background="#c0c0c0" />
+
+
+        <LinearLayout
+            android:id="@+id/temp_data_get"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:background="@drawable/listpress"
+            android:clickable="true"
+            android:gravity="center_vertical"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/temp_data_get_Tv"
+                style="@style/content_text_medium_style"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginTop="2dp"
+                android:layout_weight="1"
+                android:gravity="center_vertical"
+                android:text="@string/Engineer_mode_title"
+                android:visibility="gone" />
+
+            <TextView
+                style="@style/title_text_large_style"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:text="@string/temp_data_get_text"
+                android:textSize="15sp" />
+        </LinearLayout>
+
+
     </LinearLayout>
 </ScrollView>
\ No newline at end of file
index d063d1d..cac2f0f 100644 (file)
@@ -50,6 +50,7 @@
     <string name="signalTest">信号测试</string>
     <string name="signalRsult">信号测试结果</string>
     <string name="signalTestError">信号测试失败</string>
+    <string name="temp_data_get_text">采集温度数据</string>
     <string name="emergencyCall">拨打112</string>
     <string name="chinaMoveCall">拨打10086</string>
     <string name="emergencyCallSuccess">拨打紧急电话成功</string>
index e11160d..52f056e 100644 (file)
     <string name="beiguang_new">Back Light</string>
     <string name="gps">GPS</string>
     <string name="tempAdjust">Temperature Adjust</string>
+    <string name="temp_data_get_text">get temperature data</string>
     <string name="temperature">Temperature</string>
     <string name="no_temperature">No Temperature device found!</string>
     <string name="anti_check">AntiCheck</string>
index 8058236..c8029ce 100644 (file)
@@ -1,2 +1,2 @@
-#Fri May 21 20:33:05 CST 2021
-VERSION_CODE=96
+#Thu Jun 03 17:10:28 CST 2021
+VERSION_CODE=101