summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuchi Amalapurapu <asuchitra@google.com>2009-09-29 13:37:43 -0700
committerSuchi Amalapurapu <asuchitra@google.com>2009-09-29 13:37:43 -0700
commit3c9eac96e6c5f705cb2afae063716882ee5210dc (patch)
tree11e0bc3c47678cb910f21bb00677a68271a811cf
parent2f830ef28c014bff7766e8d82faf3ebf58a8cc14 (diff)
downloadandroid_packages_apps_PackageInstaller-3c9eac96e6c5f705cb2afae063716882ee5210dc.tar.gz
android_packages_apps_PackageInstaller-3c9eac96e6c5f705cb2afae063716882ee5210dc.tar.bz2
android_packages_apps_PackageInstaller-3c9eac96e6c5f705cb2afae063716882ee5210dc.zip
Clear installer's user data before downloading an app so that we get rid of any lingering files from earlier failed installs
or files left behind by earlier buggy builds Add permission to AndroidManifest to clear user data
-rw-r--r--AndroidManifest.xml1
-rw-r--r--src/com/android/packageinstaller/PackageInstallerActivity.java2
2 files changed, 3 insertions, 0 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 5d35b0e2..21131455 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
+ <uses-permission android:name="android.permission.CLEAR_APP_USER_DATA" />
<application android:label="@string/app_name">
<activity android:name=".PackageInstallerActivity">
<intent-filter>
diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java
index d63c98ee..3b429d94 100644
--- a/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -356,6 +356,8 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
showDialogInner(DLG_UNKNOWN_APPS);
return;
}
+ // Clear any other temporary files in data directory
+ mPm.clearApplicationUserData(getPackageName(), null);
//compute the size of the application. just an estimate
long size;
String apkPath = mPackageURI.getPath();