summaryrefslogtreecommitdiffstats
path: root/src/com/android/packageinstaller/InstallAppProgress.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/packageinstaller/InstallAppProgress.java')
-rwxr-xr-xsrc/com/android/packageinstaller/InstallAppProgress.java46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/com/android/packageinstaller/InstallAppProgress.java b/src/com/android/packageinstaller/InstallAppProgress.java
index 1ecc1f1e..96fe7a7a 100755
--- a/src/com/android/packageinstaller/InstallAppProgress.java
+++ b/src/com/android/packageinstaller/InstallAppProgress.java
@@ -66,8 +66,6 @@ public class InstallAppProgress extends Activity implements View.OnClickListener
final static int FAILED = 0;
private final int INSTALL_COMPLETE = 1;
private Intent mLaunchIntent;
- private File mTmpFile;
- private final String TMP_FILE_NAME="tmpCopy.apk";
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
@@ -157,15 +155,6 @@ public class InstallAppProgress extends Activity implements View.OnClickListener
mLaunchButton = (Button)findViewById(R.id.launch_button);
mOkPanel.setVisibility(View.INVISIBLE);
- // Create temp file before invoking install api
- mTmpFile = createTempPackageFile(mPackageURI.getPath());
- if (mTmpFile == null) {
- Message msg = mHandler.obtainMessage(INSTALL_COMPLETE);
- msg.arg1 = PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE;
- mHandler.sendMessage(msg);
- return;
- }
- mPackageURI = Uri.parse("file://" + mTmpFile.getPath());
String installerPackageName = getIntent().getStringExtra(
Intent.EXTRA_INSTALLER_PACKAGE_NAME);
@@ -176,9 +165,6 @@ public class InstallAppProgress extends Activity implements View.OnClickListener
@Override
protected void onDestroy() {
super.onDestroy();
- if (mTmpFile != null && mTmpFile.exists()) {
- mTmpFile.delete();
- }
}
public void onClick(View v) {
@@ -192,36 +178,4 @@ public class InstallAppProgress extends Activity implements View.OnClickListener
finish();
}
}
-
- private File createTempPackageFile(String filePath) {
- File tmpPackageFile = getFileStreamPath(TMP_FILE_NAME);
- if (tmpPackageFile == null) {
- Log.w(TAG, "Failed to create temp file");
- return null;
- }
- if (tmpPackageFile.exists()) {
- tmpPackageFile.delete();
- }
- // Open file to make it world readable
- FileOutputStream fos;
- try {
- fos = openFileOutput(TMP_FILE_NAME, MODE_WORLD_READABLE);
- } catch (FileNotFoundException e1) {
- Log.e(TAG, "Error opening file " + TMP_FILE_NAME);
- return null;
- }
- try {
- fos.close();
- } catch (IOException e) {
- Log.e(TAG, "Error opening file " + TMP_FILE_NAME);
- return null;
- }
-
- File srcPackageFile = new File(filePath);
- if (!FileUtils.copyFile(srcPackageFile, tmpPackageFile)) {
- Log.w(TAG, "Failed to make copy of file: " + srcPackageFile);
- return null;
- }
- return tmpPackageFile;
- }
}