??????????android???????????package/apps/????????????????????????????????eclipse???治????á?
?????????????????android?????????????????????У???????Щ???????????????????????????????????????????????????????????
??????AndroidManifest.xml?м??????  android:sharedUserId="android.uid.system"  ?????????uid????apk??????????
????????????汾???
?????????д??????????<uses-permission android:name="android.permission.SHUTDOWN"/>
????????????????apk????????????eclipse????????
?????????xml??д????button??????????????????????????xml???
???????????????????android.intent.action.REBOOT?? ?y????????????????????
????case R.id.reboot_btn:
????Intent intent=new Intent(Intent.ACTION_REBOOT);
????intent.putExtra("nowait"?? 1);
????intent.putExtra("interval"?? 1);
????intent.putExtra("window"?? 0);
????sendBroadcast(intent);
????break;
??????sendBroadcast???????apk?????????
??????????????????android.intent.action.ACTION_REQUEST_SHUTDOWN?????????????????eclipse??????????????????????????е????????????б???apk???????
????public static final String ACTION_REQUEST_SHUTDOWN="android.intent.action.ACTION_REQUEST_SHUTDOWN"
????public static final String EXTRA_KEY_CONFIRM="android.intent.extra.KEY_CONFIRM"
????Intent i=new Intent(ACTION_REQUEST_SHUTDOWN);
????i.putExtra(EXTRA_KEY_CONFIRM?? false);
????i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
????startActivity(i);
??????????????????д?? Intent i=new Intent(Intent.ACTION_REQUEST_SHUTDOWN);
????????????????linux???????????????????????????????????????????????????????????????????Intent???????
????EXTRA_KEY_CONFIRM?????????????壬??????????
???????????linux?±??????????д??Android.mk??????????????????apk???????????????
????LOCAL_PATH:= $(call my-dir)
????include $(CLEAR_VARS)
????LOCAL_MODULE_TAGS := optional
????# Only compile source java files in this apk.
????LOCAL_SRC_FILES := $(call all-java-files-under?? src)
????LOCAL_SDK_VERSION := current
????LOCAL_PACKAGE_NAME := Reboot
????LOCAL_CERTIFICATE := platform
????LOCAL_DEX_PREOPT :=false
????include $(BUILD_PACKAGE)
????# Use the following include to make our test apk.
????include $(call all-makefiles-under??$(LOCAL_PATH))
???????mk??????????????1????????
????LOCAL_PACKAGE_NAME:= ?????
????4.0???????apk??????? LOCAL_DEX_PREOPT := false ???????????APK????????true??????????????????
????????????t? LOCAL_CERTIFICATE := platform  ????????
??????????????????bin???????????ò?????????????????
?????????android?????? . build/envsetup.sh
??????lunch ????汾
?????????????mk??????? ???mm
???????????apk·????:out/target/product/anzhen4_mrd7/system/app/Reboot.apk
????????????????
???????????? Activity ?? ShutDownActiviy????????? ShutdownThread.shutdown??
????????????????? WatchDog.java?????????????????? ??????? RebootRequestReceiver ?????????