Here you can find the source of rebootInstallPackage(final Context context, final File packageFile)
public static void rebootInstallPackage(final Context context, final File packageFile)
//package com.java2s; import java.io.File; import java.io.IOException; import android.content.Context; import android.os.RecoverySystem; import android.util.Log; public class Main { private final static String TAG = "Upgrade.RebootUtils"; public static void rebootInstallPackage(final Context context, final File packageFile) { Log.w(TAG, "!!! REBOOT INSTALL PACKAGE !!!"); Log.d(TAG, "file path is " + packageFile.getPath()); // The reboot call is blocking, so we need to do it on another thread. Thread thr = new Thread("Reboot") { @Override//from ww w .j a v a2 s . co m public void run() { try { RecoverySystem.installPackage(context, packageFile); } catch (IOException e) { Log.e(TAG, "Can't perform rebootInstallPackage", e); } } }; thr.start(); } }