packages/apps/Settings/src/com/android/settings/MasterClear.java
MasterClear:mFinalClickListener()函数会发送一个广播出去:
sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"))
2. 这个广播的接收者在收到广播之后会开启一个java服务线程:MasterClearReceiver:RebootThread
frameworks/base/services/java/com/Android/server/MasterClearReceiver.java -- TAG = "MasterClear"
public void onReceive(Context context, Intent intent) {
[cpp] view plaincopy
RebootThread mThread = new RebootThread(context, intent)
mThread.start()
}
在线程的run函数中会调用函数:RecoverySystem.rebootWipeUserData(mContext)这个方法是RecoverySystem类的静态方法。
3. RecoverySystem类定义于文件:frameworks/base/core/java/android/os/RecoverySystem.java -- TAG = "RecoverySystem"
[cpp] view plaincopy
public class RecoverySystem {
/** Used to communicate with recovery. See bootable/recovery/recovery.c. */
private static File RECOVERY_DIR = new File("/cache/recovery")
private static File COMMAND_FILE = new File(RECOVERY_DIR, "command")
private static File LOG_FILE = new File(RECOVERY_DIR, "log")
public static void rebootWipeUserData(Context context)
throws IOException {
bootCommand(context, "--wipe_data")
}
private static void bootCommand(Context context, String arg) throws IOException {
RECOVERY_DIR.mkdirs() // In case we need it
COMMAND_FILE.delete() // In case it's not writable
LOG_FILE.delete()
附上出处链接:http://blog.csdn.net/yf210yf/article/details/18771035
如果你设的是用户的环境变量就会出现你说的情况,一旦你退出再重新启用jdk就要重新配置path和classpath,如果你设置的是系统变量就不会出现你所说的情况了。一般在我的电脑-属性-高级-环境变量设置-系统变量,你新建一个新的系统变量就行了。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)