<option name="ALLOW_USER_CONFIGURATION" value="false" />\r
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />\r
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />\r
- <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/build/generated/res/resValues/debug" />\r
+ <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />\r
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />\r
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />\r
</configuration>\r
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />\r
<excludeFolder url="file://$MODULE_DIR$/build" />\r
</content>\r
- <orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />\r
<orderEntry type="sourceFolder" forTests="false" />\r
+ <orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />\r
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup:javawriter:2.1.1@jar" level="project" />\r
<orderEntry type="library" scope="TEST" name="Gradle: junit:junit:4.12@jar" level="project" />\r
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-integration:1.3@jar" level="project" />\r
<orderEntry type="library" name="Gradle: __local_aars__:D.\workspace\icsupport\app\libs\ftp4j-1.7.2.jar:unspecified@jar" level="project" />\r
<orderEntry type="library" name="Gradle: __local_aars__:D.\workspace\icsupport\app\libs\log4j-1.2.17.jar:unspecified@jar" level="project" />\r
<orderEntry type="library" name="Gradle: __local_aars__:D.\workspace\icsupport\app\libs\okio-2.4.3.jar:unspecified@jar" level="project" />\r
+ <orderEntry type="library" name="Gradle: __local_aars__:D.\workspace\icsupport\app\libs\frameworks-full-debug.jar:unspecified@jar" level="project" />\r
<orderEntry type="library" name="Gradle: __local_aars__:D.\workspace\icsupport\app\libs\telephony_common-full-debug.jar:unspecified@jar" level="project" />\r
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-solver:1.1.3@jar" level="project" />\r
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:25.1.0@jar" level="project" />\r
keyAlias "watch_g5"
keyPassword "123456"
}
+ debug {
+ storeFile file('EQC_G5.jks')
+ storePassword '123456'
+ keyAlias = 'watch_g5'
+ keyPassword '123456'
+ }
}
buildTypes {
release {
// }
}
dependencies {
+ compileOnly files ('libs/frameworks-full-debug.jar')
+ provided files ('libs/telephony_common-full-debug.jar')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//compile fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation project(path: ':dNSCache')
implementation 'com.android.support:recyclerview-v7:25.1.0'
compile files ('libs/android-logging-log4j-1.0.3.jar','libs/ftp4j-1.7.2.jar','libs/log4j-1.2.17.jar','libs/okio-2.4.3.jar')
- provided files ('libs/telephony_common-full-debug.jar')
- //provided files ('libs/frameworks-full-debug.jar')
+
// implementation "androidx.recyclerview:recyclerview:1.1.0
}
return new Date().format("yyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
}
+preBuild {
+
+ doLast {
+ def imlFile = file( project.name + ".iml")
+ println 'Change ' + project.name + '.iml order'
+ try {
+ def parsedXml = (new XmlParser()).parse(imlFile)
+ def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
+ parsedXml.component[1].remove(jdkNode)
+ def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
+ println 'what' + sdkString
+ new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
+ groovy.xml.XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
+ } catch (FileNotFoundException e) {
+ // nop, iml not found
+ println "no iml found"
+ }
+ }
+}
\ No newline at end of file
}\r
\r
public static String getProtocolServerHost(Context context){\r
- return SharPreferenceUtil.getPrefString(context,KeyProtocolServerHOST,"watch.jiai.pro");\r
- }\r
+\r
+ String host="watch.jiai.pro";\r
+ switch (protocol_no){\r
+\r
+ case PROTOCOL_BEEHOME:\r
+ host= SharPreferenceUtil.getPrefString(context,KeyProtocolServerHOST,"device.beehome360.com");\r
+ break;\r
+ case PROTOCOL_JIAI:\r
+ default:\r
+ host= SharPreferenceUtil.getPrefString(context,KeyProtocolServerHOST,"watch.jiai.pro");\r
+ break;\r
+ }\r
+ return host;\r
+ }\r
\r
public static void setProtocolServerHost(Context context,String host){\r
SharPreferenceUtil.setPrefString(context,KeyProtocolServerHOST,host);\r
}\r
public static int getProtocolServerPort(Context context){\r
- return SharPreferenceUtil.getPrefInt(context,KeyProtocolServerPort,8090);\r
+\r
+ int port=8090;\r
+ switch (protocol_no){\r
+\r
+ case PROTOCOL_BEEHOME:\r
+ port= SharPreferenceUtil.getPrefInt(context,KeyProtocolServerPort,5111);\r
+ break;\r
+ case PROTOCOL_JIAI:\r
+ default:\r
+ port= SharPreferenceUtil.getPrefInt(context,KeyProtocolServerPort,8090);\r
+ break;\r
+ }\r
+ return port;\r
}\r
\r
public static void setFotaServerIP(Context context,String serverIP,int serverPort){\r
import com.enqualcomm.support.service.Deliver;\r
import com.enqualcomm.support.utils.APNUtil;\r
import com.enqualcomm.support.utils.CellInfoUtil;\r
+import com.enqualcomm.support.utils.ContextProxy;\r
import com.enqualcomm.support.utils.DeviceInfoUtil;\r
import com.enqualcomm.support.utils.ICAudioManager;\r
import com.enqualcomm.support.utils.ICHttpUtil;\r
sendSMS(phonenumber, "start listen !");\r
// CellInfoUtil.dialSilent(runtime.getContextProxy().context,phonenumber);\r
ICAudioManager.needMute=true;\r
- SimSignalUtil.send_at_cmd(runtime,"atd"+phonenumber+";");\r
+\r
+ Observable.timer(2000L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+ public void call(Long param1Long) {\r
+ SimSignalUtil.send_at_cmd(runtime,"atd"+phonenumber+";");\r
+ }\r
+ });\r
+\r
} else if (sms.equals(ENCRYPED_HEADER+"#location#")) {\r
\r
sendSMS(phonenumber, "start location mode "+runtime.getLocationInstance().getWorkingMod()+"!");\r
//长短信会被分拆送来,因此可能会有多个PDU。Protocol Description Unit是短信的工业标准。 \r
Object[] pduArray = (Object[])intent.getExtras().get("pdus");\r
ICLogger.i("pdu number=" + pduArray.length);\r
- String message = "";\r
+ String message = "";\r
String from = null;\r
for(int i = 0 ; i < pduArray.length; i ++){\r
SmsMessage sms = SmsMessage.createFromPdu((byte[])pduArray[i]);//将PDU转换为SmsMessage格式\r
// Toast.makeText(context, "收到" + from + "短信:" + message, Toast.LENGTH_LONG).show();\r
if (handleSMS_CMD(from,message)==false){\r
//说明不是sms命令,提示短信接收。\r
-\r
+ ContextProxy.sendMsgBroadcast(context,message,1);\r
Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
public void call(Long param1Long) {\r
Intent intent = new Intent();\r
private MyPhoneStateListener() {\r
}\r
\r
- @RequiresApi(api = Build.VERSION_CODES.M)\r
+// @RequiresApi(api = Build.VERSION_CODES.M)\r
public void onSignalStrengthsChanged(SignalStrength ss) {\r
super.onSignalStrengthsChanged(ss);\r
TelephonyManager tm=(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\r
// }\r
if(ICAudioManager.needMute==true)\r
{\r
- ICAudioManager.restoreVolumn(mContext); //2秒后恢复音量\r
+// ICAudioManager.restoreVolumn(mContext); //2秒后恢复音量\r
Observable.timer(2000L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
public void call(Long param1Long) {\r
ICAudioManager.restoreVolumn(mContext); //2秒后恢复音量\r
import com.ic.protocols.protocolAPIHelper;\r
import com.enqualcomm.support.bean.Runtime;\r
\r
-import static android.content.Context.BATTERY_SERVICE;\r
+//import static android.content.Context.BATTERY_SERVICE;\r
import static android.os.BatteryManager.BATTERY_STATUS_CHARGING;\r
import static android.os.BatteryManager.BATTERY_STATUS_DISCHARGING;\r
import static android.os.BatteryManager.BATTERY_STATUS_FULL;\r
}\r
\r
public int getBatteryLevel(Context context){\r
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\r
- BatteryManager batteryManager = (BatteryManager)context.getSystemService(BATTERY_SERVICE);\r
- return batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);\r
- } else {\r
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\r
+// BatteryManager batteryManager = (BatteryManager)context.getSystemService(BATTERY_SERVICE);\r
+// return batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);\r
+// } else {\r
Intent intent = new ContextWrapper(context.getApplicationContext()).registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));\r
return (intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1) * 100) /\r
intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);\r
- }\r
+// }\r
}\r
\r
\r
intent.putExtra("isConnected", paramBoolean);\r
this.context.sendBroadcast(intent);\r
}\r
- \r
+\r
+ public void sendMsgBroadcast(String msg, int msgType) {\r
+ sendMsgBroadcast(this.context,msg,msgType);\r
+ }\r
+\r
+ public static void sendMsgBroadcast(Context _context,String msg, int msgType) {\r
+ Intent intent = new Intent("action.ic.srvPushTxt");\r
+ intent.putExtra("msgType", 0); //0 代表 server下发消息,1代表 SMS消息\r
+ intent.putExtra("txtMsg", msg);\r
+ _context.sendBroadcast(intent);\r
+ }\r
public void sendStheartRateBroadcast(String paramString, int paramInt) {\r
Intent intent = new Intent();\r
intent.setAction(paramString);\r
public static void setVolumnMute(Context context) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
ICLogger.i("======setVolumnMute");
- saved_volumn = audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
-
- audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL,0,0);
-
+// saved_volumn = audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
+ audioManager.setMasterMute(true);
+ audioManager.setStreamMute(AudioManager.STREAM_VOICE_CALL,true);
+ audioManager.setSpeakerphoneOn(false);
// SimSignalUtil.SetRingMode(context, AudioManager.RINGER_MODE_SILENT, false);
// CloseSpeaker(context);//
public static void restoreVolumn(Context context) {
ICLogger.i("======restoreVolumn "+saved_volumn);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
-
- audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL,saved_volumn,0);
+ audioManager.setMasterMute(false);
+ audioManager.setStreamMute(AudioManager.STREAM_VOICE_CALL,false);
+ audioManager.setSpeakerphoneOn(true);
// changeToSpeaker(context);
// SimSignalUtil.SetRingMode(context, AudioManager.RINGER_MODE_NORMAL, true);
\r
boolean lisScreenOn;\r
\r
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {\r
-\r
- lisScreenOn = powerManager.isInteractive();\r
-\r
- } else {\r
+// if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {\r
+//\r
+// lisScreenOn = powerManager.isInteractive();\r
+//\r
+// } else {\r
\r
lisScreenOn = powerManager.isScreenOn();\r
\r
- }\r
+// }\r
\r
return lisScreenOn;\r
}\r
String msg=AP40(cmdindex,1);\r
//设定当前工作模式及循环频率\r
connection.send(genStringMessage("AP40",msg));\r
-\r
- Intent intent=new Intent();\r
- intent.putExtra("txtMsg",txtmsg);\r
- runtime.getContextProxy().sendBrodcast("action.ic.srvPushTxt",intent);\r
-\r
ICLogger.i("received Txt Msg "+txtmsg);\r
+ runtime.getContextProxy().sendMsgBroadcast(txtmsg,0);\r
}else{\r
ICLogger.i("BP40 format error!");\r
}\r
name 'Google'
}
}
+ gradle.projectsEvaluated {
+ tasks.withType(JavaCompile) {
+ options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\frameworks-full-debug.jar')
+ }
+ }
}
task clean(type: Delete) {