}
android {
- compileSdkVersion 25
- buildToolsVersion "25.0.1"
+ compileSdkVersion 29
+ buildToolsVersion "29.0.3"
def currentVersionCode = getVersionCode()
def currentVersionName = releaseTime()
defaultConfig {
// }
}
dependencies {
- compileOnly files('libs/telephony-common-full-debug.jar')
- compileOnly files('libs/frameworks-full-debug.jar')
- compileOnly files('libs/frameworks-2-full-debug.jar')
+// compileOnly files('libs/telephony-common-full-debug.jar')
+// compileOnly files('libs/frameworks-full-debug.jar')
+// compileOnly files('libs/frameworks-2-full-debug.jar')
+ compileOnly files('libs/8.1_telephony-common_full_debug.jar')
+ compileOnly files('libs/8.1_framework_full_debug.jar')
+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//compile fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission> -->
<!-- 用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+
+ <uses-permission android:name="android.permission.CONTROL_LOCATION_UPDATES" />
<!-- 用于访问网络,网络定位需要上网 -->
<!-- <uses-permission android:name="android.permission.INTERNET"></uses-permission> -->
<!-- 用于读取手机当前的状态 -->
<uses-permission android:name="android.permission.READ_LOGS"></uses-permission>
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
-
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.database.Cursor;
import android.media.AudioManager;
import android.net.Uri;
+import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
private static final int GRAY_SERVICE_ID = android.os.Process.myPid();
+ public static String CHANNEL_ID_STRING = CoreService.class.getPackage().getName();
private static final String MY_WAKE_LOCKTAG = CoreService.class.getSimpleName();
public static final int interval = 60000;
this.locationClient.init();
//设置本service为前台运行,不被会被清理
- Notification notification = new Notification();
- notification.flags = Notification.FLAG_ONGOING_EVENT;
- notification.flags |= Notification.FLAG_NO_CLEAR;
- notification.flags |= Notification.FLAG_FOREGROUND_SERVICE;
- startForeground(GRAY_SERVICE_ID, notification);
+
+ //适配8.0service
+ NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
+ NotificationChannel mChannel = null;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
+ mChannel = new NotificationChannel(CHANNEL_ID_STRING, " ", NotificationManager.IMPORTANCE_HIGH);
+ notificationManager.createNotificationChannel(mChannel);
+ Notification notification = new Notification.Builder(getApplicationContext(), CHANNEL_ID_STRING).build();
+ notification.flags = Notification.FLAG_ONGOING_EVENT;
+ notification.flags |= Notification.FLAG_NO_CLEAR;
+ notification.flags |= Notification.FLAG_FOREGROUND_SERVICE;
+ startForeground(GRAY_SERVICE_ID, notification);
+ }
+
+
+
//注册接收 时间和tiimezone 变更消息
IntentFilter intentFilter = new IntentFilter();
//有新消息就发送出去
ContentResolver resolver = runtime.getContextProxy().getResolver();
WeTalkMsgObserver weTalkMsgObserver = new WeTalkMsgObserver(mHandler, resolver);
- resolver.registerContentObserver(
- Uri.parse(WeTalkMessageProvider.MESSAGES_SEND), true, weTalkMsgObserver
- );
+ try {
+ resolver.registerContentObserver(
+ Uri.parse(WeTalkMessageProvider.MESSAGES_SEND), true, weTalkMsgObserver
+ );
+ }catch (Exception e){
+ ICLogger.e(e.getMessage(),e);
+ }
+
//启动结束设置标志位,让心率和体温检测可以正常执行。
server_starting = false;
/*给 API >= 18 的平台上用的灰色保活手段*/
public int onStartCommand(Intent param1Intent, int param1Int1, int param1Int2) {
- startForeground(GRAY_SERVICE_ID, new Notification());
- stopForeground(true);
- stopSelf();
+
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+// Notification.Builder builder = new Notification.Builder(this);
+//
+// builder.setSmallIcon(R.mipmap.ic_launcher);
+//
+// builder.setContentTitle("KeepAppAlive");
+//
+// builder.setContentText("DaemonService is runing...");
+//
+// startForeground(GRAY_SERVICE_ID, builder.build());
+
+// 如果觉得常驻通知栏体验不好
+
+// 可以通过启动CancelNoticeService,将通知移除,oom_adj值不变
+
+// Intent intent = new Intent(this, CoreService.class);
+//
+// startService(intent);
+//
+// } else {
+// startForeground(GRAY_SERVICE_ID, new Notification());
+//
+// }
+// startForeground(GRAY_SERVICE_ID, new Notification());
+// stopForeground(true);
+// stopSelf();
return super.onStartCommand(param1Intent, param1Int1, param1Int2);
}
}
import android.graphics.Color;\r
import android.graphics.Rect;\r
import android.os.Bundle;\r
+import android.os.Handler;\r
+import android.os.HandlerThread;\r
+import android.os.Message;\r
import android.os.PowerManager;\r
+import android.support.annotation.NonNull;\r
import android.support.v7.app.AppCompatActivity;\r
import android.support.v7.widget.LinearLayoutManager;\r
import android.support.v7.widget.RecyclerView;\r
private TextView mSearchCount;\r
private boolean showmessage=false;\r
final LocationSnrAdapter adapter = new LocationSnrAdapter(testSnrEntriyDate(null));\r
-\r
+ private Handler mHandler = null;\r
+ ICLocation.GPS_locationStatus g_gps_status=null;\r
@Override\r
protected void onCreate(Bundle savedInstanceState) {\r
super.onCreate(savedInstanceState);\r
mStar.setText("0 in 0/ inMap 0");\r
mHoop.setText("0.0米");\r
mSearchCount.setText("0秒");\r
+ if (mHandler == null) {\r
+ mHandler = new Handler(this.getMainLooper(),new Handler.Callback(){\r
+ @Override\r
+ public boolean handleMessage(@NonNull Message msg) {\r
+ if (g_gps_status !=null) {\r
+ List<ICLocation.GpsSatellitePriv> gpslist = g_gps_status.numSatelliteList;\r
+ adapter.updateLocationValue(testSnrEntriyDate(gpslist));\r
+ String fixed = new StringBuilder().append(g_gps_status.locating_status > 0 ?\r
+ "Fixed " : "notFixed ").append(TimeUtil.getLocalTime2()).toString();\r
+ String satlites = new StringBuilder("used ").append(g_gps_status.used_gps_numbs).append(" in ")\r
+ .append(g_gps_status.numSatelliteList.size()).append("/ inMap ").append(g_gps_status.satlite_numbss).toString();\r
+ String locationTime = new StringBuilder().append(g_gps_status.search_time_cost).append("秒").toString();\r
+ String hdop = new StringBuilder().append(String.valueOf(g_gps_status.hdop)).append("米").toString();\r
+ mFix.setText(fixed);\r
+ if (mFix.getText().toString().contains("notFixed")) {\r
+ mFix.setBackgroundColor(Color.RED);\r
+ mFix.setTextColor(Color.WHITE);\r
+ } else {\r
+ mFix.setBackgroundColor(Color.GREEN);\r
+ mFix.setTextColor(Color.BLACK);\r
+ }\r
+ mStar.setText(satlites);\r
+ mHoop.setText(hdop);\r
+ mSearchCount.setText(locationTime);\r
+ }\r
+ return false;\r
+ }\r
+ }\r
+ );\r
+ }\r
+\r
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\r
}\r
\r
+\r
@Override\r
public void on_locating_changed(ICLocation.GPS_locationStatus gps_status) {\r
\r
- List<ICLocation.GpsSatellitePriv> gpslist =gps_status.numSatelliteList;\r
- adapter.updateLocationValue(testSnrEntriyDate(gpslist));\r
- String fixed=new StringBuilder().append(gps_status.locating_status>0?\r
- "Fixed ":"notFixed ").append(TimeUtil.getLocalTime2()).toString();\r
- String satlites=new StringBuilder("used ").append(gps_status.used_gps_numbs).append(" in ")\r
- .append(gps_status.numSatelliteList.size()).append("/ inMap ").append(gps_status.satlite_numbss).toString();\r
- String locationTime=new StringBuilder().append(gps_status.search_time_cost).append("秒").toString();\r
- String hdop=new StringBuilder().append(String.valueOf(gps_status.hdop)).append("米").toString();\r
- mFix.setText(fixed);\r
- if (mFix.getText().toString().contains("notFixed")){\r
- mFix.setBackgroundColor(Color.RED);\r
- mFix.setTextColor(Color.WHITE);\r
- }else{\r
- mFix.setBackgroundColor(Color.GREEN);\r
- mFix.setTextColor(Color.BLACK);\r
- }\r
- mStar.setText(satlites);\r
- mHoop.setText(hdop);\r
- mSearchCount.setText(locationTime);\r
+ g_gps_status = gps_status;\r
+\r
+ mHandler.sendEmptyMessage(1);\r
+\r
}\r
\r
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {\r
//停止自定义广播
public void stopGattAdvertising() {
- if (mBtAdapter.isEnabled())
- mBtAdapter.stopAdvertising(advcb);
+ //if (mBtAdapter.isEnabled())
+ // mBtAdapter.stopAdvertising(advcb);
}
//开启自定义广播数据,前两字会被丢弃
public void enableGattAdvertising(String serverData) {
byte[] serviceData = serverData.getBytes();
- if (mBtAdapter.isEnabled())
- mBtAdapter.startAdvertising(advcb, serviceData);
+ //if (mBtAdapter.isEnabled())
+ // mBtAdapter.startAdvertising(advcb, serviceData);
}
- public class advcallback implements BluetoothAdapter.AdvertiseCallback {
+ public class advcallback implements BluetoothAdapter.LeScanCallback {
public void onAdvertiseStart(int status) {
ICLogger.i("-- onAdvertiseStop --");
}
+
+ @Override
+ public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
+ ICLogger.i("-- onLeScan --" + rssi);
+
+ }
}
private class BLeScanCallback implements LeScanCallback {
//绑定远程服务
Intent intent = new Intent();
intent.setAction(ACTION_HEART_RATE);
+ intent.setPackage(ICApplication.sContext.getPackageName());
ICApplication.sContext.bindService(intent, mRemoteConnection, Context.BIND_AUTO_CREATE);
}
import android.database.Cursor;
import android.net.Uri;
import android.provider.Telephony;
-import android.sim.Sim;
+//import android.sim.Sim;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.Toast;
import com.android.internal.telephony.Phone;
-import com.android.internal.telephony.PhoneFactory;
+//import com.android.internal.telephony.PhoneFactory;
import com.enqualcomm.support.bean.ApnSetting;
-import android.sim.SimManager;
+//import android.sim.SimManager;
import java.lang.reflect.Method;
\r
private static final long ONE_WEEK = 604800000L;\r
\r
- private static Method setImpl;\r
+// private static Method setImpl;\r
\r
static {\r
- try {\r
- setImpl = AlarmManager.class.getDeclaredMethod("setImpl", new Class[]{int.class, long.class, long.class, long.class, PendingIntent.class, android.os.WorkSource.class});\r
- setImpl.setAccessible(true);\r
-\r
- } catch (Exception e) {\r
- e.printStackTrace();\r
- ICLogger.e(e.getMessage(), e);\r
- }\r
+// try {\r
+// setImpl = AlarmManager.class.getDeclaredMethod("setImpl", new Class[]{int.class, long.class, long.class, long.class, PendingIntent.class, android.os.WorkSource.class});\r
+// setImpl.setAccessible(true);\r
+//\r
+// } catch (Exception e) {\r
+// e.printStackTrace();\r
+// ICLogger.e(e.getMessage(), e);\r
+// }\r
}\r
\r
//设置闹铃\r
import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.provider.Telephony;
-import android.sim.SimManager;
+//import android.sim.SimManager;
import android.telephony.TelephonyManager;
import android.text.Editable;
import android.text.Selection;
mBearerArray = mRes.getStringArray(R.array.bearer_entries);
- mAPNUri = Telephony.Carriers.getContentUri(mPhoneId, null);
+// mAPNUri = Telephony.Carriers.getContentUri(mPhoneId, null);
mUri = mAPNUri;
mTelephonyManager = (TelephonyManager) mContext.getSystemService(TELEPHONY_SERVICE);
// values.put(APN_ID, mSelectedKey);
// resolver.update(PREFERAPN_URI, values, null, null);
values.put("apn_id", key);
- resolver.update(
- Telephony.Carriers.getContentUri(0, Telephony.Carriers.PATH_PREFERAPN),
- values, null, null);
+// resolver.update(
+// Telephony.Carriers.getContentUri(0, Telephony.Carriers.PATH_PREFERAPN),
+// values, null, null);
/* @} */
}
// Cursor cursor = getContentResolver().query(PREFERAPN_URI, new
// String[] {"_id"},
// null, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
- Cursor cursor = mContext.getContentResolver().query(
- Telephony.Carriers.getContentUri(0, Telephony.Carriers.PATH_PREFERAPN),
- new String[] {
- "_id"
- },
- null, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
+// Cursor cursor = mContext.getContentResolver().query(
+// Telephony.Carriers.getContentUri(0, Telephony.Carriers.PATH_PREFERAPN),
+// new String[] {
+// "_id"
+// },
+// null, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
/* @} */
- if (cursor.getCount() > 0) {
- cursor.moveToFirst();
- key = cursor.getString(0);
- }
- cursor.close();
+// if (cursor.getCount() > 0) {
+// cursor.moveToFirst();
+// key = cursor.getString(0);
+// }
+// cursor.close();
ICLogger.d(" get default apnkey "+key);
return key;
}
public String getCurrentAPN(){
- String where;
- String mccmnc;
- if (TelephonyManager.isMultiSim()) {
- mccmnc = android.os.SystemProperties.get(TelephonyManager.getProperty(
- TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, mPhoneId), "");
- // APNs are listed based on the MCC+MNC.
- // Get the value from appropriate Telephony Property based on the
- // subscription.
- where = "numeric=\"" + mccmnc + "\"";
-
- } else {
- mccmnc = android.os.SystemProperties.get(
- TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, "");
- where = "numeric=\"" + mccmnc + "\"";
-
- }
+ String where="";
+ String mccmnc="";
+// if (TelephonyManager.isMultiSim()) {
+// mccmnc = android.os.SystemProperties.get(TelephonyManager.getProperty(
+// TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, mPhoneId), "");
+// // APNs are listed based on the MCC+MNC.
+// // Get the value from appropriate Telephony Property based on the
+// // subscription.
+// where = "numeric=\"" + mccmnc + "\"";
+//
+// } else {
+// mccmnc = android.os.SystemProperties.get(
+// TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, "");
+// where = "numeric=\"" + mccmnc + "\"";
+//
+// }
where += " and name!='CMCC DM'";
Log.d(TAG,"where = " + where + ",mccmnc =" + mccmnc);
public boolean resetAPNtoDefault(){
// resolver.delete(DEFAULTAPN_URI, null, null);
- int rows = mContext.getContentResolver().delete(Telephony.Carriers.getContentUri(mPhoneId,
- Telephony.Carriers.PATH_RESTORE),null,null);
+ int rows = 0;//mContext.getContentResolver().delete(Telephony.Carriers.getContentUri(mPhoneId,Telephony.Carriers.PATH_RESTORE),null,null);
return rows>=0;
}
public boolean addVPN(String apnName, String apn, String mcc, String mnc, String user, String passwd) {
// String numeric =
// SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC);
String numeric;
- if (TelephonyManager.isMultiSim()) {
- // APNs are automatically added with MCC+MNC.
- // Get the value from appropriate Telephony Property based
- // on the mPhoneId.
- numeric = SystemProperties
- .get(TelephonyManager.getProperty(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, mPhoneId));
-
- } else {
+// if (TelephonyManager.isMultiSim()) {
+// // APNs are automatically added with MCC+MNC.
+// // Get the value from appropriate Telephony Property based
+// // on the mPhoneId.
+// numeric = SystemProperties
+// .get(TelephonyManager.getProperty(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, mPhoneId));
+
+// } else {
numeric = SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC);
- }
+// }
/* @} */
// MCC is first 3 chars and then in 2 - 3 chars of MNC
if (numeric != null && numeric.length() > 4) {
int mDDS = 0;
try {
- mDDS = Settings.System.getInt(mContext.getContentResolver(), Settings.System.MULTI_SIM_DATA_CALL);
+// mDDS = Settings.System.getInt(mContext.getContentResolver(), Settings.System.MULTI_SIM_DATA_CALL);
} catch (Exception e) {
ICLogger.e( "Exception Reading Dual Sim Data Subscription Value.", e);
}
package com.enqualcomm.support.utils;
import android.content.Context;
+import android.content.IClipboard;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
-import com.android.internal.telephony.CallManager;
-import com.android.internal.telephony.CallStateException;
-import com.android.internal.telephony.Phone;
-import com.android.internal.telephony.PhoneFactory;
+//import com.android.internal.telephony.CallManager;
+//import com.android.internal.telephony.CallStateException;
+//import com.android.internal.telephony.Phone;
+//import com.android.internal.telephony.PhoneFactory;
import com.enqualcomm.support.Config;
import com.enqualcomm.support.GSensorListener;
import com.enqualcomm.support.adapter.LBSHelper;
import com.enqualcomm.support.bean.Runtime;
-import com.sprd.internal.telephony.SprdCallManager;
+//import com.sprd.internal.telephony.SprdCallManager;
import java.lang.reflect.Method;
import java.util.Collections;
// }
// }
// });
- Single.just(null).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Object>() {
- public void call(Object param1Object) {
-
- PhoneFactory.makeDefaultPhones(context);
-
- Phone p = PhoneFactory.getDefaultPhone();
-
- SprdCallManager cm = (SprdCallManager)SprdCallManager.getInstance();
-
- cm.registerPhone(p);
-
- Phone phone = cm.getDefaultPhone();
-
- try {
- phone.dial(dialnumber);
- } catch (Exception e) {
- ICLogger.PrintExceptionStackTrace(e);
- ICLogger.e(e.getMessage(),e);
- }
- }
- });
+// Single.just(null).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Object>() {
+// public void call(Object param1Object) {
+//
+// PhoneFactory.makeDefaultPhones(context);
+//
+// Phone p = PhoneFactory.getDefaultPhone();
+//
+// SprdCallManager cm = (SprdCallManager)SprdCallManager.getInstance();
+//
+// cm.registerPhone(p);
+//
+// Phone phone = cm.getDefaultPhone();
+//
+// try {
+// phone.dial(dialnumber);
+// } catch (Exception e) {
+// ICLogger.PrintExceptionStackTrace(e);
+// ICLogger.e(e.getMessage(),e);
+// }
+// }
+// });
}
public static int getSignal(TelephonyManager tm , Runtime runtime){
int size=1;
if (neighboringCell_list != null && !neighboringCell_list.isEmpty()) {
sortByRssi(neighboringCell_list);
-
+ ICLogger.i("signal CellInfo size "+neighboringCell_list.size());
Iterator cell = neighboringCell_list.iterator();
-
while(cell.hasNext()) {
- NeighboringCellInfo mNeighboringCellInfo = (NeighboringCellInfo)cell.next();
+ NeighboringCellInfo mNeighboringCellInfo = (NeighboringCellInfo)cell.next();
if (mNeighboringCellInfo.getLac() == -1) {
break;
}
--- /dev/null
+package com.enqualcomm.support.utils;
+
+import android.os.ServiceManager;
+import android.util.Log;
+
+import com.ic.jni.AtCMD;
+
+
+public class IATUtils {
+ private static final String TAG = "IATUtils";
+ private static String strTmp = null;
+ public static String AT_FAIL = "AT FAILED";
+ public static String AT_OK = "OK";
+ public static int mPhoneCount = 0;
+
+
+ public static String sendATCmd(String cmd, String serverName) {
+
+
+ strTmp = "error service can't get";
+ try {
+ String result = sendAtCmd(cmd);
+ Log.d(TAG, "result = " + result);
+ return result;
+ } catch (Exception se) {
+ Log.d("AT Exception", se.toString());
+ strTmp += " 8541 ";
+ }
+ return strTmp;
+
+ }
+
+ private static String sendAtCmd(String cmd){
+ String result="";
+ if(AtCMD.loadlibrary_success) {
+ result = AtCMD.native_sendATCmd(0, cmd);
+ }else{
+ result="library load failed!";
+ }
+ return result;
+ }
+}
ICLogger.i("======setVolumnMute");
// saved_volumn = audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
if (audioManager != null) {
- audioManager.setMasterMute(true);
-
+// audioManager.setMasterMute(true);
audioManager.setStreamMute(AudioManager.STREAM_VOICE_CALL, true);
audioManager.setSpeakerphoneOn(false);
}
ICLogger.i("======restoreVolumn "+saved_volumn);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
if (audioManager != null) {
- audioManager.setMasterMute(false);
+// audioManager.setMasterMute(false);
audioManager.setStreamMute(AudioManager.STREAM_VOICE_CALL, false);
audioManager.setSpeakerphoneOn(true);
ICLogger.i("======setVoiceCallMaxVolumn ");
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
if (audioManager != null) {
- audioManager.setMasterMute(false);
+// audioManager.setMasterMute(false);
int currentvolume=audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
int maxvolume=audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL,maxvolume,0);
//在画布上绘制水印图片
canvas.drawBitmap(watermark, paddingLeft, paddingTop, null);
// 保存
- canvas.save(Canvas.ALL_SAVE_FLAG);
+// canvas.save(Canvas.ALL_SAVE_FLAG);
+ canvas.save();
// 存储
canvas.restore();
return newb;
}
public static void send_at_to_reset_simcard(Runtime runtime) {
-
- Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
- intent.putExtra("command", "AT+SFUN=2"); //重新初始化sim卡
- intent.putExtra("arg2", "");
- (runtime.getContextProxy()).context.sendBroadcast(intent);
- ICLogger.i("send_at_to_reset_simcard ");
+ String ret=IATUtils.sendATCmd("AT+SFUN=2","");
+ ICLogger.i("send_at_to_reset_simcard "+ret);
}
public static void send_at_to_update_lbs(Runtime runtime) {
- Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
- intent.putExtra("command", "AT+CREG=2");
- intent.putExtra("arg2", "");
- (runtime.getContextProxy()).context.sendBroadcast(intent);
- ICLogger.i("send_at_to_update_lbs ");
+ String ret=IATUtils.sendATCmd("AT+CREG=2","");
+ ICLogger.i("send_at_to_update_lbs "+ret);
}
public static void send_at_cmd(Runtime runtime, String cmd) {
- Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
- intent.putExtra("command", cmd);
- intent.putExtra("arg2", "");
- (runtime.getContextProxy()).context.sendBroadcast(intent);
- ICLogger.i("send_at_cmd " + cmd);
+ String ret=IATUtils.sendATCmd(cmd,"");
+ ICLogger.i("send_at_cmd "+cmd+" \r\nreply: "+ret);
}
public static void send_at_setImei0(Runtime runtime, String imei) {
private TemperatureUtil() {
Intent intent = new Intent();
intent.setAction(ACTION_TEMPERATURE);
+ intent.setPackage(ICApplication.sContext.getPackageName());
//绑定远程服务
ICApplication.sContext.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
--- /dev/null
+package com.ic.jni;
+
+import android.util.Log;
+
+public class AtCMD {
+ public static boolean loadlibrary_success=false;
+ static {
+ try {
+ System.loadLibrary("jni_atcmd");
+ loadlibrary_success =true;
+ } catch (UnsatisfiedLinkError e) {
+ Log.d("ValidationToolsNative", " #loadLibrary jni_validationtools failed ");
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * send AT cmd to modem
+ *
+ * @return (String: the return value of send cmd, "OK":sucess, "ERROR":fail)
+ */
+ public static native String native_sendATCmd(int phoneId, String cmd);
+
+ public static native boolean native_hashValueWrited();
+
+ public static native int native_get_rootflag();
+}
\ No newline at end of file
tasks.withType(JavaCompile) {
// options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\telephony-common-full-debug.jar')
// options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\frameworks-full-debug.jar')
- options.compilerArgs << '-Xbootclasspath/p:app\\libs\\frameworks-full-debug.jar;app\\libs\\telephony-common-full-debug.jar'
+// options.compilerArgs << '-Xbootclasspath/p:app\\libs\\frameworks-full-debug.jar;app\\libs\\telephony-common-full-debug.jar'
+ options.compilerArgs << '-Xbootclasspath/p:app\\libs\\8.1_framework_full_debug.jar;app\\libs\\8.1_telephony-common_full_debug.jar'
}
}
}
# Location of the SDK. This is only used by Gradle.\r
# For customization when using a Version Control System, please read the\r
# header note.\r
-#Fri Jul 02 14:52:39 CST 2021\r
-sdk.dir=E\:\\Android\\Sdk\r
+#Thu Jul 22 07:04:36 CST 2021\r
+sdk.dir=C\:\\Users\\incar\\AppData\\Local\\Android\\Sdk\r