瀏覽代碼

新增一款asr品牌型号腕表兼容

weizhengliang 10 月之前
父節點
當前提交
e285a8b822

+ 1 - 1
android_mobile/build.gradle

@@ -27,7 +27,7 @@ android {
         }
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
         buildConfigField "String", "BUILD_TIME", getDate()
-        buildConfigField "String", "PLATFORM_KEY", "\""+platform_key+"\""
+        buildConfigField "String", "WATCH_TYPE", "\""+watch_type+"\""
     }
 
 

+ 7 - 0
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/activity/BaseActivity.kt

@@ -4,6 +4,7 @@ import android.content.Context
 import android.content.Intent
 import android.os.Bundle
 import android.view.View
+import android.view.WindowManager
 import android.view.inputmethod.InputMethodManager
 import androidx.databinding.DataBindingUtil
 import androidx.databinding.ViewDataBinding
@@ -78,6 +79,12 @@ abstract class BaseActivity<PresenterType : BaseContract.BasePresenter, DataBind
         }
         /**父类初始化*/
         super.onCreate(savedInstanceState)
+
+        //全屏显示
+        window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN or
+                WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
+                WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON)
+
         /**执行生命周期监听*/
         lifeCycleDo(LIFE_CYCLE_CREATE)
         /**创建根视图*/

+ 55 - 9
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/activity/WatchHome2Activity.kt

@@ -66,7 +66,6 @@ import kotlinx.android.synthetic.main.watch_activity_register.*
 import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
-import org.linphone.core.AccountCreator
 import org.linphone.core.Call
 import org.linphone.core.TransportType
 import java.util.*
@@ -97,6 +96,11 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
     private var linphoneManager: LinphoneManager? = null
     private var sipReg: Boolean = false
 
+    //com.asr.fileexplorer/.activities.FileExploreActivity
+    //com.sgtc.settings/.ShutdownActivity
+    //com.sgtc.settings/.RebootActivity
+    //com.sgtc.launcher/.Launcher
+
     override fun onCreate(savedInstanceState: Bundle?) {
         if (!isTaskRoot) {
             finish()
@@ -233,7 +237,7 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
         Log.e(TAG, "is admin: $isAdmin")
 
         //g6s腕表使用系统签名才开启
-        if (BuildConfig.PLATFORM_KEY.toBoolean()) {
+        if (BuildConfig.WATCH_TYPE == "g6s" || BuildConfig.WATCH_TYPE == "asr") {
             if (isAdmin) {
                 requestPermissions()
             } else {
@@ -247,6 +251,7 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
             tv_cancel_admin.visibility = View.GONE
             tv_power_off.visibility = View.GONE
             tv_file_manager.visibility = View.GONE
+            tv_reboot.visibility = View.GONE
 
             requestPermissions()
         }
@@ -764,8 +769,18 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
         }
 
         tv_system_settings.setOnClickListener {
-            val intent = Intent(Settings.ACTION_SETTINGS)
-            startActivity(intent)
+            try {
+                if (BuildConfig.WATCH_TYPE == "asr") {
+                    val intent = Intent()
+                    intent.setClassName("com.android.settings", "com.android.settings.Settings")
+                    startActivity(intent)
+                } else {
+                    val intent = Intent(Settings.ACTION_SETTINGS)
+                    startActivity(intent)
+                }
+            } catch (ex: Exception) {
+                ex.printStackTrace()
+            }
         }
 
         tv_restart_app.setOnClickListener {
@@ -777,13 +792,23 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
         }
 
         tv_cancel_admin.setOnClickListener {
-            devicePolicyManager.removeActiveAdmin(screenReceiver)
+            try {
+                devicePolicyManager.removeActiveAdmin(screenReceiver)
+            } catch (ex: Exception) {
+                //
+            }
         }
 
         tv_file_manager.setOnClickListener {
             try {
                 val intent = Intent()
-                intent.setClassName("com.sprd.fileexplorer", "com.sprd.fileexplorer.activities.FileManagerActivity")
+                if (BuildConfig.WATCH_TYPE == "g6s") {
+                    intent.setClassName("com.sprd.fileexplorer", "com.sprd.fileexplorer.activities.FileManagerActivity")
+                    startActivity(intent)
+                } else if (BuildConfig.WATCH_TYPE == "asr") {
+                    intent.setClassName("com.asr.fileexplorer", "com.asr.fileexplorer.activities.FileExploreActivity")
+                    startActivity(intent)
+                }
                 startActivity(intent)
             } catch (ex: Exception) {
                 //
@@ -793,12 +818,32 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
         tv_power_off.setOnClickListener {
             try {
                 val intent = Intent()
-                intent.setClassName("com.android.settings", "com.sgtc.sgtcsettings.GznbShutdown")
-                startActivity(intent)
+                if (BuildConfig.WATCH_TYPE == "g6s") {
+                    intent.setClassName("com.android.settings", "com.sgtc.sgtcsettings.GznbShutdown")
+                    startActivity(intent)
+                } else if (BuildConfig.WATCH_TYPE == "asr") {
+                    intent.setClassName("com.sgtc.settings", "com.sgtc.settings.ShutdownActivity")
+                    startActivity(intent)
+                }
             } catch (ex: Exception) {
                 showMessage("不支持关机")
             }
         }
+
+        tv_reboot.setOnClickListener {
+            try {
+                val intent = Intent()
+                if (BuildConfig.WATCH_TYPE == "g6s") {
+                    intent.setClassName("com.android.settings", "com.sgtc.sgtcsettings.GznbReboot")
+                    startActivity(intent)
+                } else if (BuildConfig.WATCH_TYPE == "asr") {
+                    intent.setClassName("com.sgtc.settings", "com.sgtc.settings.RebootActivity")
+                    startActivity(intent)
+                }
+            } catch (ex: Exception) {
+                showMessage("不支持重启")
+            }
+        }
     }
 
     override fun enableHeadsetVoiceMsg(): Boolean {
@@ -948,7 +993,7 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
         //熄屏
         //AppUtils.goToSleep(BaseApplication.appContext)
 
-        if (BuildConfig.PLATFORM_KEY.toBoolean()) {
+        if (BuildConfig.WATCH_TYPE == "g6s" || BuildConfig.WATCH_TYPE == "asr") {
             try {
                 devicePolicyManager.lockNow()
             } catch (ex: Exception) {
@@ -981,6 +1026,7 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
             battery_warning_tv.setTextColor(Color.parseColor("#FF3030"))
             battery_warning_tv.visibility = View.VISIBLE
             battery_warning_tv.text = "电量低"
+            SoundPoolManager.getInstance().playSound(10)
         } else {
             battery_warning_tv.visibility = View.GONE
             electric_quantity_tv.text = "" + power + "%"

+ 37 - 22
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/activity/WatchUserSettingActivity.java

@@ -7,6 +7,7 @@ import android.os.Bundle;
 import android.provider.Settings;
 import android.util.Log;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.Button;
 import android.widget.RadioButton;
 import android.widget.RadioGroup;
@@ -47,6 +48,11 @@ public class WatchUserSettingActivity extends Activity {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.user_setting_layout);
 
+        //全屏显示
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN |
+                WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
+                WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
+
         tvAppVersion = findViewById(R.id.tv_app_version);
         tvDeviceId = findViewById(R.id.tv_device_id);
         tvDeviceImei = findViewById(R.id.tv_device_imei);
@@ -87,7 +93,7 @@ public class WatchUserSettingActivity extends Activity {
         tvTtsStatus.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                SpeechUtil.getInstance().startSpeak("这是一个语音示例");
+                SpeechUtil.getInstance().speakSingleText("这是一个语音示例");
             }
         });
 
@@ -109,17 +115,6 @@ public class WatchUserSettingActivity extends Activity {
                     }
                 };
                 TcpClient.getInstance().sendTcp(userChangeModel, false, transaction);
-
-                /*NettyClient.Companion.getInstance().sendMsg(userChangeModel.toJson()).subscribe(it->{
-                    if (it) {
-                        Log.d(TAG, "TCP.发送消息完成");
-                        ExtendMethodsKt.showMessage("换班通知发送成功,请等待处理...");
-                        WatchUserSettingActivity.this.finish();
-                    } else {
-                        Log.e(TAG, "TCP.发送消息失败");
-                        ExtendMethodsKt.showMessage("换班通知发送失败,请重试");
-                    }
-                });*/
             }
         });
 
@@ -144,16 +139,31 @@ public class WatchUserSettingActivity extends Activity {
             }
         });
         btnSystemSetting.setOnClickListener(view -> {
-            Intent intent = new Intent(Settings.ACTION_SETTINGS);
-            startActivity(intent);
+            try {
+                if (BuildConfig.WATCH_TYPE == "asr") {
+                    Intent intent = new Intent();
+                    intent.setClassName("com.android.settings", "com.android.settings.Settings");
+                    startActivity(intent);
+                } else {
+                    Intent intent = new Intent(Settings.ACTION_SETTINGS);
+                    startActivity(intent);
+                }
+            } catch (Exception ex) {
+                //
+            }
         });
 
         btnReboot.setOnClickListener(v -> {
             try {
                 Intent intent = new Intent();
-                intent.setClassName("com.android.settings", "com.sgtc.sgtcsettings.GznbReboot");
-                //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-                startActivity(intent);
+                if (BuildConfig.WATCH_TYPE.equals("g6s")) {
+                    intent.setClassName("com.android.settings", "com.sgtc.sgtcsettings.GznbReboot");
+                    //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                    startActivity(intent);
+                } else if (BuildConfig.WATCH_TYPE.equals("asr")) {
+                    intent.setClassName("com.sgtc.settings", "com.sgtc.settings.RebootActivity");
+                    startActivity(intent);
+                }
             } catch (Exception ex) {
                 Toast.makeText(_this, "不支持重启", Toast.LENGTH_SHORT).show();
             }
@@ -162,8 +172,13 @@ public class WatchUserSettingActivity extends Activity {
         btnShutdown.setOnClickListener(v -> {
             try {
                 Intent intent = new Intent();
-                intent.setClassName("com.android.settings", "com.sgtc.sgtcsettings.GznbShutdown");
-                startActivity(intent);
+                if (BuildConfig.WATCH_TYPE.equals("g6s")) {
+                    intent.setClassName("com.android.settings", "com.sgtc.sgtcsettings.GznbShutdown");
+                    startActivity(intent);
+                } else if (BuildConfig.WATCH_TYPE.equals("asr")) {
+                    intent.setClassName("com.sgtc.settings", "com.sgtc.settings.ShutdownActivity");
+                    startActivity(intent);
+                }
             } catch (Exception ex) {
                 Toast.makeText(_this, "不支持关机", Toast.LENGTH_SHORT).show();
             }
@@ -177,9 +192,9 @@ public class WatchUserSettingActivity extends Activity {
             }
         });
 
-        if (!Boolean.parseBoolean(BuildConfig.PLATFORM_KEY)) {
-            btnReboot.setVisibility(View.GONE);
-            btnShutdown.setVisibility(View.GONE);
+        if (BuildConfig.WATCH_TYPE.equals("g6s") || BuildConfig.WATCH_TYPE.equals("asr")) {
+            btnReboot.setVisibility(View.VISIBLE);
+            btnShutdown.setVisibility(View.VISIBLE);
         }
     }
 

+ 2 - 2
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/broadcast/BatteryBroadcastReceiver.java

@@ -31,7 +31,7 @@ public class BatteryBroadcastReceiver extends BroadcastReceiver {
             int level = intent.getIntExtra("level", 0);
             int scale = intent.getIntExtra("scale", 100);
             int power = level * 100 / scale;
-            if (power<15){
+            /*if (power<15){
                 if (Constants.Companion.getEVENT_BATTERY_ALARM()) {
                     Util.INSTANCE.wakeUpAndUnlock();
                     //SpeechUtil.getInstance().startSpeak("电池电量低,请注意!电池电量低,请注意!电池电量低,请注意!");
@@ -40,7 +40,7 @@ public class BatteryBroadcastReceiver extends BroadcastReceiver {
                 }
             } else {
                 Constants.Companion.setEVENT_BATTERY_ALARM(true);
-            }
+            }*/
             EventBus.getDefault().post(new MessageEvent(power, Constants.EVENT_BATTERY_PERCENT));
         }
     }

+ 21 - 38
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/service/WdKeepAliveService.kt

@@ -15,6 +15,7 @@ import com.google.gson.FieldNamingPolicy
 import com.google.gson.Gson
 import com.google.gson.GsonBuilder
 import com.google.gson.reflect.TypeToken
+import com.wdkl.ncs.android.component.home.BuildConfig
 import com.wdkl.ncs.android.component.home.R
 import com.wdkl.ncs.android.component.home.activity.AppUpdateActivity
 import com.wdkl.ncs.android.component.home.activity.NewCallListActivity
@@ -197,7 +198,6 @@ class WdKeepAliveService : AbsWorkService() {
 
                 val tcpModel = messageEvent.getMessage() as TcpModel
                 if (tcpModel.type == TcpType.VOICE) {
-//                var gson = GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create()
                     val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
 
                     if (tcpModel.action == TcpAction.VoiceAction.CALL) {  //有来电
@@ -825,43 +825,32 @@ class WdKeepAliveService : AbsWorkService() {
         val interactionVO = Gson().fromJson(model.data.toString(), InteractionVO::class.java)
         if (model.type == TcpType.EVENT && model.action == TcpAction.EventAction.KEY_CLICK) {
             /*val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ", " + interactionVO.data
-
             if (Constants.ttsState == 2) {
-                SpeechUtil.getInstance().startSpeak("您有新的事件待处理, " + eventStr)
+                SpeechUtil.getInstance().speakSingleText("您有新的事件待处理, " + eventStr)
             } else {
-                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.new_event, false)
+                SoundPoolManager.getInstance().playSound(8)
             }*/
 
             SoundPoolManager.getInstance().playSound(8)
         } else if (model.type == TcpType.SOS) {
             AppTool.Time.delay(500) {
-                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.sos, true)
+                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.sos, false)
             }
-        } else if (model.type == TcpType.EVENT && model.action == TcpAction.EventAction.CANCEL) { // 事件取消
-            /*val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ",已取消 " + interactionVO.data + "事件"
-
+        } /*else if (model.type == TcpType.EVENT && model.action == TcpAction.EventAction.CANCEL) { // 事件取消
+            val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ",已取消 " + interactionVO.data + "事件"
             if (Constants.ttsState == 2) {
-                SpeechUtil.getInstance().startSpeak(eventStr)
+                SpeechUtil.getInstance().speakSingleText(eventStr)
             } else {
-                AppTool.Time.delay(500) {
-                    RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
-                }
-            }*/
-
-            SoundPoolManager.getInstance().playSound(9)
+                SoundPoolManager.getInstance().playSound(9)
+            }
         } else if (model.type == TcpType.EVENT && model.action == TcpAction.EventAction.COMPLETED) { //事件完成
-            /*val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ", " + interactionVO.data + "事件已完成"
-
+            val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ", " + interactionVO.data + "事件已完成"
             if (Constants.ttsState == 2) {
-                SpeechUtil.getInstance().startSpeak(eventStr)
+                SpeechUtil.getInstance().speakSingleText(eventStr)
             } else {
-                AppTool.Time.delay(500) {
-                    RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
-                }
-            }*/
-
-            SoundPoolManager.getInstance().playSound(9)
-        }
+                SoundPoolManager.getInstance().playSound(9)
+            }
+        }*/
     }
 
     private fun handleVibrator() {
@@ -916,15 +905,6 @@ class WdKeepAliveService : AbsWorkService() {
     private fun sendChannelImRead(channelIm: ChannelImDO) {
         val imTcpModel = ChannelImUtil.channelImRead(Constants.deviceId, channelIm)
         TcpClient.getInstance().sendTcp(imTcpModel, false, null)
-
-        /*NettyClient.instance.sendMsg(imTcpModel.toJson()).subscribe {
-            if (it) {
-                Log.d(TAG, "TCP.发送消息完成")
-            } else {
-                Log.e(TAG, "TCP.发送消息失败")
-                HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-            }
-        }*/
     }
 
     private fun initSpeech() {
@@ -971,10 +951,13 @@ class WdKeepAliveService : AbsWorkService() {
                         EventBus.getDefault().register(this@WdKeepAliveService)
                     }
                     //腕表定期亮屏防止休眠被系统杀掉
-                    /*if (System.currentTimeMillis() - wakeTime >= 9*60*1000) {
-                        //wakeup
-                        Util.wakeUpAndUnlock()
-                        wakeTime = System.currentTimeMillis()
+                    /*if (BuildConfig.WATCH_TYPE.equals("asr")) {
+                        if (System.currentTimeMillis() - wakeTime >= 5 * 60 * 1000) {
+                            //wakeup
+                            Log.e(TAG, "device wake up...")
+                            Util.wakeUpAndUnlock()
+                            wakeTime = System.currentTimeMillis()
+                        }
                     }*/
                     Util.getCpuWakeLock(this@WdKeepAliveService)?.acquire(Constants.heartBeat * 1000L)
                     reConnect()

+ 21 - 0
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/util/SpeechUtil.java

@@ -164,6 +164,27 @@ public class SpeechUtil {
         });
     }
 
+    public synchronized void speakSingleText(final String text) {
+        Log.d(TAG, "tts speak single text: " + text);
+        textToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, null, "uniqueId");
+        textToSpeech.setOnUtteranceProgressListener(new UtteranceProgressListener() {
+            @Override
+            public void onStart(String utteranceId) {
+                //LogUtil.d(TAG, "speak onStart..." + utteranceId);
+            }
+
+            @Override
+            public void onDone(String utteranceId) {
+                //语音播报完毕
+            }
+
+            @Override
+            public void onError(String utteranceId) {
+
+            }
+        });
+    }
+
     public void stopSpeak() {
         if (textToSpeech==null){
             return;

+ 25 - 23
android_mobile/src/main/yd_watch_2/res/layout/user_setting_layout.xml

@@ -9,7 +9,7 @@
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
+            android:layout_height="wrap_content"
             android:orientation="vertical">
 
             <TextView
@@ -32,7 +32,7 @@
                     android:orientation="horizontal">
                     <TextView
                         android:text="版本"
-                        android:textSize="14dp"
+                        android:textSize="14sp"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"/>
@@ -43,7 +43,7 @@
                         android:gravity="right">
                         <TextView
                             android:id="@+id/tv_app_version"
-                            android:textSize="14dp"
+                            android:textSize="14sp"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"/>
                     </LinearLayout>
@@ -55,7 +55,7 @@
                     android:orientation="horizontal">
                     <TextView
                         android:text="设备ID"
-                        android:textSize="14dp"
+                        android:textSize="14sp"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"/>
@@ -66,7 +66,7 @@
                         android:gravity="right">
                         <TextView
                             android:id="@+id/tv_device_id"
-                            android:textSize="14dp"
+                            android:textSize="14sp"
                             android:textColor="@color/javashop_color_searcher_tv_gray"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"/>
@@ -79,7 +79,7 @@
                     android:orientation="horizontal">
                     <TextView
                         android:text="设备标识码"
-                        android:textSize="14dp"
+                        android:textSize="14sp"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"/>
@@ -90,7 +90,7 @@
                         android:gravity="right">
                         <TextView
                             android:id="@+id/tv_device_imei"
-                            android:textSize="14dp"
+                            android:textSize="14sp"
                             android:textColor="@color/javashop_color_searcher_tv_gray"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"/>
@@ -103,7 +103,7 @@
                     android:orientation="horizontal">
                     <TextView
                         android:text="服务器"
-                        android:textSize="14dp"
+                        android:textSize="14sp"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"/>
@@ -114,7 +114,7 @@
                         android:gravity="right">
                         <TextView
                             android:id="@+id/tv_server_ip"
-                            android:textSize="14dp"
+                            android:textSize="14sp"
                             android:textColor="@color/javashop_color_searcher_tv_gray"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"/>
@@ -127,7 +127,7 @@
                     android:orientation="horizontal">
                     <TextView
                         android:text="设备IP"
-                        android:textSize="14dp"
+                        android:textSize="14sp"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"/>
@@ -138,7 +138,7 @@
                         android:gravity="right">
                         <TextView
                             android:id="@+id/tv_device_ip"
-                            android:textSize="14dp"
+                            android:textSize="14sp"
                             android:textColor="@color/javashop_color_searcher_tv_gray"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"/>
@@ -156,7 +156,7 @@
                         android:layout_height="wrap_content"
                         android:text="TTS状态"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
-                        android:textSize="14dp" />
+                        android:textSize="14sp" />
 
                     <TextView
                         android:id="@+id/tv_tts_status"
@@ -165,7 +165,7 @@
                         android:layout_weight="1"
                         android:gravity="right"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
-                        android:textSize="14dp" />
+                        android:textSize="14sp" />
                 </LinearLayout>
 
                 <LinearLayout
@@ -178,7 +178,7 @@
                         android:layout_height="wrap_content"
                         android:text="通话方式"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
-                        android:textSize="14dp" />
+                        android:textSize="14sp" />
 
                     <TextView
                         android:id="@+id/tv_phone_type"
@@ -187,7 +187,7 @@
                         android:layout_weight="1"
                         android:gravity="right"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
-                        android:textSize="14dp" />
+                        android:textSize="14sp" />
                 </LinearLayout>
 
                 <LinearLayout
@@ -200,7 +200,7 @@
                         android:layout_height="wrap_content"
                         android:text="@string/voice_type"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
-                        android:textSize="14dp" />
+                        android:textSize="14sp" />
 
                     <TextView
                         android:id="@+id/tv_voice_type"
@@ -209,7 +209,7 @@
                         android:layout_weight="1"
                         android:gravity="right"
                         android:textColor="@color/javashop_color_searcher_tv_gray"
-                        android:textSize="14dp" />
+                        android:textSize="14sp" />
                 </LinearLayout>
 
             </LinearLayout>
@@ -227,7 +227,7 @@
                     android:layout_gravity="center_horizontal"
                     android:background="@drawable/javashop_btn_balck_line_bg"
                     android:text="PC关联"
-                    android:textSize="14dp" />
+                    android:textSize="14sp" />
 
                 <Button
                     android:id="@+id/btn_app_restart"
@@ -238,7 +238,7 @@
                     android:layout_toRightOf="@id/btn_user_change"
                     android:background="@drawable/javashop_btn_balck_line_bg"
                     android:text="APP重启"
-                    android:textSize="14dp" />
+                    android:textSize="14sp" />
 
                 <Button
                     android:id="@+id/btn_check_update"
@@ -249,7 +249,7 @@
                     android:layout_below="@id/btn_user_change"
                     android:background="@drawable/javashop_btn_balck_line_bg"
                     android:text="检查升级"
-                    android:textSize="14dp" />
+                    android:textSize="14sp" />
 
                 <Button
                     android:id="@+id/btn_system_setting"
@@ -262,7 +262,7 @@
                     android:layout_toRightOf="@id/btn_check_update"
                     android:background="@drawable/javashop_btn_balck_line_bg"
                     android:text="系统设置"
-                    android:textSize="14dp" />
+                    android:textSize="14sp" />
 
                 <Button
                     android:id="@+id/btn_reboot"
@@ -273,7 +273,8 @@
                     android:layout_below="@id/btn_check_update"
                     android:background="@drawable/javashop_btn_balck_line_bg"
                     android:text="设备重启"
-                    android:textSize="14dp" />
+                    android:textSize="14sp"
+                    android:visibility="gone"/>
 
                 <Button
                     android:id="@+id/btn_shutdown"
@@ -286,7 +287,8 @@
                     android:layout_toRightOf="@id/btn_reboot"
                     android:background="@drawable/javashop_btn_balck_line_bg"
                     android:text="设备关机"
-                    android:textSize="14dp" />
+                    android:textSize="14sp"
+                    android:visibility="gone"/>
 
                 <TextView
                     android:id="@+id/tv_call_title"

+ 13 - 0
android_mobile/src/main/yd_watch_2/res/layout/watch_activity_register.xml

@@ -147,6 +147,19 @@
                 android:gravity="center"
                 android:text="关机"
                 android:textSize="18sp" />
+
+            <TextView
+                android:id="@+id/tv_reboot"
+                android:layout_width="match_parent"
+                android:layout_height="40dp"
+                android:layout_marginLeft="30dp"
+                android:layout_marginTop="20dp"
+                android:layout_marginRight="30dp"
+                android:layout_marginBottom="20dp"
+                android:background="#ffffff"
+                android:gravity="center"
+                android:text="重启"
+                android:textSize="18sp" />
         </LinearLayout>
     </ScrollView>
 </LinearLayout>

+ 10 - 5
app/build.gradle

@@ -24,13 +24,18 @@ android {
     aaptOptions.noCompress("mp3","wav")
 
     defaultConfig {
-        if (rootProject.ext.platform_key) {
+        if (rootProject.ext.watch_type == "g6s") {
             //g6s腕表
             applicationId "com.health.watch"
+        } else if (rootProject.ext.watch_type == "asr"){
+            //asr腕表
+            applicationId "com.wdkl.app.ncs"
+            //applicationId "com.sgtc.launcher"
         } else {
-            //腕表
+            //通用腕表
             applicationId "com.wdkl.app.ncs"
         }
+
         minSdkVersion min_sdk_version
         targetSdkVersion target_sdk_version
         versionCode app_version_code
@@ -55,7 +60,7 @@ android {
 
     buildTypes {
         release {
-            if (rootProject.ext.platform_key) {
+            if (rootProject.ext.watch_type == "g6s" || rootProject.ext.watch_type == "asr") {
                 signingConfig signingConfigs.debug_g6s
             } else {
                 signingConfig signingConfigs.debug
@@ -65,7 +70,7 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
         debug {
-            if (rootProject.ext.platform_key) {
+            if (rootProject.ext.watch_type == "g6s" || rootProject.ext.watch_type == "asr") {
                 signingConfig signingConfigs.debug_g6s
             } else {
                 signingConfig signingConfigs.debug
@@ -79,7 +84,7 @@ android {
     sourceSets {
         main.java.srcDirs += 'src/main/code'
 
-        if (rootProject.ext.platform_key) {
+        if (rootProject.ext.watch_type == "g6s" || rootProject.ext.watch_type == "asr") {
             main.manifest.srcFile 'src/main/sharedUserId/AndroidManifest.xml'
         } else {
             main.manifest.srcFile 'src/main/AndroidManifest.xml'

+ 16 - 13
build.gradle

@@ -35,10 +35,6 @@ buildscript {
      */
     ext.target_sdk_version = 30
 
-
-    /*是否使用系统签名:默认false,g6s腕表使用系统签名*/
-    ext.platform_key = false
-
     /**
      * APP类型版本,参考: https://inxsfc.notion.site/APP-4d9b6bfee5c24b91b8f4337ca0830423
      * YD-S5-W_QIN2PRO-2: 多亲手机
@@ -46,6 +42,9 @@ buildscript {
      */
     ext.app_device_type = "yd_watch_2"
 
+    //腕表类型:g6s,asr
+    ext.watch_type = "asr"
+
     if (app_device_type == "yd_s5_w_qin2_2") {
         ext.build_tools_version = "26.0.2"
         ext.support_library_version = "26.1.0"
@@ -78,15 +77,19 @@ buildscript {
         ext.build_tools_version = "26.0.2"
         ext.support_library_version = "26.1.0"
 
-        //其他腕表
-        //ext.app_version_code = 11
-        //ext.app_version = "1.4.2_watch"
-
-        //g6s腕表
-        ext.app_version_code = 10005
-        ext.app_version = "1.10.5_watch"
-        /*是否使用系统签名:g6s腕表使用系统签名*/
-        ext.platform_key = true
+        if (watch_type == "g6s") {
+            //g6s腕表
+            ext.app_version_code = 10005
+            ext.app_version = "1.10.5_g6s"
+        } else if (watch_type == "asr") {
+            //新款asr H07腕表
+            ext.app_version_code = 1
+            ext.app_version = "1.1.1_asr"
+        } else {
+            //其他腕表
+            ext.app_version_code = 11
+            ext.app_version = "1.4.2_watch"
+        }
     }
     else {
         /**

+ 1 - 0
middleware/build.gradle

@@ -24,6 +24,7 @@ android {
         }
 
         buildConfigField "String", "APP_DEVICE_TYPE", "\""+app_device_type+"\""
+        buildConfigField "String", "WATCH_TYPE", "\""+watch_type+"\""
     }
 
     lintOptions {