/*
*
*NTP同步成功,则获取当前系统时间存入RTC
*
*/
private void setRTCTime(){
Log.i(TAG, "setRTCTime start");
long currentTime = System.currentTimeMillis();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd-HHmmss");
Date d = new Date(currentTime);
String t = format.format(d);
int date = Integer.parseInt(t.split("-")[0]) * 10;
int time = Integer.parseInt(t.split("-")[1]);
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try{
int _result;
final int TRANSACTION_setRTCTime = (android.os.IBinder.FIRST_CALL_TRANSACTION + 57);
final String DESCRIPTOR = "net.sunniwell.ISWRootService";
android.os.IBinder rootService = android.os.ServiceManager.getService("SWRootService");
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeInt(date);
_data.writeInt(time);
rootService.transact(TRANSACTION_setRTCTime, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
}catch(Exception e){
e.printStackTrace();
}finally{
_reply.recycle();
_data.recycle();
}
}