rk\frameworks\base\services\core\java\com\android\server\policy\PhoneWindowManager.java
init(){
filter = new IntentFilter();
filter.addAction(ACTION_ZED_SYSTEM_TIME);
context.registerReceiver(mSystemTimeSetReceiver, filter);
}
BroadcastReceiver mSystemTimeSetReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
int [] TimeArray=intent.getIntArrayExtra("SystemTime");
if(TimeArray.length==6){
setSysTime(TimeArray[0],TimeArray[1],TimeArray[2],TimeArray[3],TimeArray[4],TimeArray[5]);
}
}
};
public void setSysTime(int year,int month,int day,int hour,int minute,int second){
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, month-1);
c.set(Calendar.DAY_OF_MONTH, day);
c.set(Calendar.HOUR_OF_DAY, hour);
c.set(Calendar.MINUTE, minute);
c.set(Calendar.SECOND, second);
long when = c.getTimeInMillis();
if(when / 1000 < Integer.MAX_VALUE){
((AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE)).setTime(when);
}
}