package com.ic.launcher;
-import androidx.annotation.NonNull;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.core.view.GestureDetectorCompat;
-import androidx.databinding.DataBindingUtil;
-
-import android.animation.AnimatorSet;
-import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
-import android.os.PowerManager;
import android.os.RemoteException;
-import android.system.Os;
import android.text.TextUtils;
-import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
-import android.view.View;
import android.view.WindowManager;
-import android.widget.TextView;
-import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.view.GestureDetectorCompat;
+import androidx.databinding.DataBindingUtil;
import com.ic.aidl.temp.ITempAidlInterface;
import com.ic.aidl.temp.ITempRemoteService;
import com.ic.launcher.util.SystemUtils;
import java.lang.ref.WeakReference;
-import java.text.DecimalFormat;
import butterknife.BindString;
import butterknife.ButterKnife;
public static final String ACTION_REMOTE_WORK_SERVICE = "com.ic.action.WORK_SERVICE";
public static final String PACKAGE_REMOTE_WORK_SERVICE = "com.ic.temp";
-
@BindString(R.string.activity_temp_tips_check)
String tipsCheck;
//读取佩戴值,如果没有佩戴显提示佩戴
//接收到了佩戴的广播去获取数据
//true表示没佩戴了,false表示有佩戴
- boolean isAntiOff = SystemUtils.getSystemPropertiesBoolean("persist.sys.ic_antioff", true);
+ boolean isAntiOff = SystemUtils.getSystemPropertiesBoolean("persist.sys.ic_antioff", false);
this.mHasWear = !isAntiOff;
IcLog.i(TAG, "isAntiOff == > " + isAntiOff);
//如果已经佩戴了,就去获取数据
@Override
public void onServiceDisconnected(ComponentName name) {
+
}
};
}
private void registerBroadcast() {
- //
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
registerReceiver(mIntentReceiver, filter);
import android.content.Context;
import android.graphics.Color;
-import com.ic.jni.ICJniUtils;
-import com.ic.launcher.BuildConfig;
import com.ic.launcher.R;
import com.ic.launcher.entity.AppInfoEntity;
import com.ic.launcher.fragment.LowPowerModeFragment;
private static final int BACK_COLOUR = Color.parseColor("#000000");
- public static boolean ppg_ecg_sensor_available=false;
- public static boolean temperature_sensor_available=false;
+ public static boolean ppg_ecg_sensor_available = false;
+ public static boolean temperature_sensor_available = false;
- static{
+ static {
//动态监测有没有心率
- ppg_ecg_sensor_available= SystemUtils.getSystemPropertiesBoolean("persist.sys.havePPGSensor",false);//(ICJniUtils.isPPGavailable()>0);
+ ppg_ecg_sensor_available = SystemUtils.getSystemPropertiesBoolean("persist.sys.havePPGSensor", false);//(ICJniUtils.isPPGavailable()>0);
//动态监测有没有体温
- temperature_sensor_available=SystemUtils.getSystemPropertiesBoolean("persist.sys.haveTempSensor",false);//(ICJniUtils.isTemperatureDevAvailable()>0);
+ temperature_sensor_available = SystemUtils.getSystemPropertiesBoolean("persist.sys.haveTempSensor", false);//(ICJniUtils.isTemperatureDevAvailable()>0);
}
- public static List<AppInfoEntity> getAppList(Context context){
+ public static List<AppInfoEntity> getAppList(Context context) {
Locale locale = context.getResources().getConfiguration().locale;
String language = locale.getLanguage();
if (SystemUtils.isH88()) {
return mH88AppList;
- }else if (SystemUtils.h88tinyMode()) {
+ } else if (SystemUtils.h88tinyMode()) {
return mH88TinyAppList;
- }else if (SystemUtils.isS123()) {
+ } else if (SystemUtils.isS123()) {
return mS123DefaultAppList;
- }else if (SystemUtils.isYT()){
+ } else if (SystemUtils.isYT()) {
return mq3fytDefaultAppList;
- }else if (SystemUtils.isDC001()){
+ } else if (SystemUtils.isDC001()) {
return mDC001AppList;
- }else{
+ } else {
if (language.contains("zh")) {
return mL02DefaultAppList;
} else {
}
}
- public static AppInfoEntity getDialer(Context context){
+ public static AppInfoEntity getDialer(Context context) {
- for (AppInfoEntity aie : getAppList(context) ) {
- if (aie.getAppTitleResId() ==R.string.app_dialer){
- return aie;
- }
+ for (AppInfoEntity aie : getAppList(context)) {
+ if (aie.getAppTitleResId() == R.string.app_dialer) {
+ return aie;
+ }
}
return null;
}
+
/**
* 拨号的顺序不能变 在低电量模式下会查找这个列表,然后查找索引为1的拨号,
* 如果要修改 请到 {@link LowPowerModeFragment} 中一并修改
"com.zmapp.sms", "com.zmapp.sms.MainActivity"));
//心率
- if(ppg_ecg_sensor_available) {
+ if (ppg_ecg_sensor_available) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_heartrate_l02, R.string.app_name_heart,
"com.ic.blood", "com.ic.blood.BloodActivity"));
// "com.ic.ak.hardware", "com.ic.ak.hardware.ui.BloodActivity"));
"com.ic.ak.hardware", "com.ic.ak.hardware.ui.PedometerActivity"));
// //天气
// add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_weather_l02, R.string.app_Weather,
- // "com.ic.weather", "com.ic.weather.WeatherActivity"));
+ // "com.ic.weather", "com.ic.weather.WeatherActivity"));
//微聊
"com.enqualcomm.imessage", "com.enqualcomm.imessage.ui.MicroChatActivity"));
-
// //支付包
// add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_alipay_l02, R.string.app_AliPay,
// "com.eg.android.AlipayGphone", "com.alipay.watch.ui.MainActivity"));
{
//体温
- if(temperature_sensor_available) {
+ if (temperature_sensor_available) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_temperature_h88, R.string.app_h88_temperature,
"com.ic.launcher", "com.ic.launcher.AnimalHeatActivity"));
}
//心率
- if(ppg_ecg_sensor_available) {
+ if (ppg_ecg_sensor_available) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_heartrate_l02, R.string.app_name_heart,
"com.ic.blood", "com.ic.blood.BloodActivity"));
}
// "com.enqualcomm.imessage", "com.enqualcomm.imessage.ui.MicroChatActivity"));
-
// //支付包
// add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_alipay_l02, R.string.app_AliPay,
// "com.eg.android.AlipayGphone", "com.alipay.watch.ui.MainActivity"));
// "com.ic.weather", "com.ic.weather.WeatherActivity"));
//心率
- if(ppg_ecg_sensor_available) {
+ if (ppg_ecg_sensor_available) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_heartrate_l02, R.string.app_name_heart,
"com.ic.blood", "com.ic.blood.BloodActivity"));
}
- if(temperature_sensor_available) {
+ if (temperature_sensor_available) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_temperature_h88, R.string.app_h88_temperature,
"com.ic.launcher", "com.ic.launcher.AnimalHeatActivity"));
}
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_pedometer_l02, R.string.app_Sport,
"com.ic.hardware", "com.ic.hardware.PedometerActivity"));
//心率
- if(ppg_ecg_sensor_available) {
+ if (ppg_ecg_sensor_available) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_heartrate_l02, R.string.app_name_heartRate,
"com.ic.blood", "com.ic.blood.BloodActivity"));
}
- if(temperature_sensor_available) {
+ if (temperature_sensor_available) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_temperature_h88, R.string.app_h88_temperature,
"com.ic.launcher", "com.ic.launcher.AnimalHeatActivity"));
}
//运动
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_pedometer_l02, R.string.app_Sport,
"com.ic.hardware", "com.ic.hardware.PedometerActivity"));
- //相机
+ //相机
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_camera_l02, R.string.app_Camera,
"com.eqc.camera", "com.eqc.camera.TakePictureActivity"));
//相册
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_qr_code_h88, R.string.app_h88_qrcode,
"com.ic.launcher", "com.ic.launcher.QrCodeActivity"));
- if(temperature_sensor_available) {
+ if (temperature_sensor_available) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_temperature_h88, R.string.app_h88_temperature,
"com.ic.launcher", "com.ic.launcher.AnimalHeatActivity"));
}
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_pedometer_l02, R.string.app_Sport,
"com.ic.hardware", "com.ic.hardware.PedometerActivity"));
//自由锻炼
- if(SystemUtils.getSystemPropertiesString("persist.sys.enablePractice","false").equals("true")) {
+ if (SystemUtils.getSystemPropertiesString("persist.sys.enablePractice", "false").equals("true")) {
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.practice_logo, R.string.app_practise,
"com.ic.launcher", "com.ic.launcher.PractiseActivity"));
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_sms_l02, R.string.app_Sms,
"com.zmapp.sms", "com.zmapp.sms.MainActivity"));
- add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_camera_l02,R.string.app_Camera_h88,
+ add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_camera_l02, R.string.app_Camera_h88,
"com.ic.camera", "com.ic.camera.MainActivity"));
- add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_albumn_l02,R.string.app_Album,
+ add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_albumn_l02, R.string.app_Album,
"com.ic.album", "com.ic.album.MainActivity"));
add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_language_h88, R.string.app_h88_language,