package com.jwipc.nodka_reboot_under;
|
|
|
import com.jwipc.nodka_reboot_under.utils.Utils;
|
|
import android.app.Service;
|
import android.content.Intent;
|
import android.content.IntentFilter;
|
import android.os.Handler;
|
import android.os.IBinder;
|
import android.os.Message;
|
|
public class The_Service extends Service{
|
|
|
Utils mUtils = null;
|
public static Handler handler;
|
|
public static final int apk_feed_dog = 1;
|
|
|
|
|
@Override
|
public IBinder onBind(Intent arg0) {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
|
@Override
|
public void onCreate() {
|
// TODO Auto-generated method stub
|
super.onCreate();
|
|
mUtils = new Utils(this);
|
handler();
|
|
receive_BroadcastReceiver_byService();
|
mUtils.stop_watch_dog_apk_feed();
|
|
}
|
|
|
private void receive_BroadcastReceiver_byService()
|
{
|
IntentFilter filter = new IntentFilter();
|
filter.addAction("android.intent.action.auto_power_shut");
|
filter.addAction("android.intent.action.NDJ_APP_ALIVE");
|
registerReceiver(new BroadcastReceiver_Power(), filter);
|
}
|
|
|
private void handler()
|
{
|
handler = new Handler()
|
{
|
@Override
|
public void handleMessage(Message msg) {
|
// TODO Auto-generated method stub
|
super.handleMessage(msg);
|
|
switch (msg.what) {
|
case apk_feed_dog:
|
mUtils.stop_watch_dog_apk_feed();
|
break;
|
}
|
}
|
};
|
}
|
|
|
|
|
|
|
}
|