summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/pm
diff options
context:
space:
mode:
authorSuchi Amalapurapu <asuchitra@google.com>2009-06-12 10:09:58 -0700
committerSuchi Amalapurapu <asuchitra@google.com>2009-06-17 11:31:26 -0700
commit1ccac75e1f1b97eccb916a8de04fc1012b30f6e5 (patch)
tree181c91a427de2ea609eff1f42c3970a441225b45 /core/java/android/content/pm
parentef29f6afb4746eae8263ab901a5d3677bc04574b (diff)
downloadframeworks_base-1ccac75e1f1b97eccb916a8de04fc1012b30f6e5.zip
frameworks_base-1ccac75e1f1b97eccb916a8de04fc1012b30f6e5.tar.gz
frameworks_base-1ccac75e1f1b97eccb916a8de04fc1012b30f6e5.tar.bz2
Remove circular dependency in PackageManager. api freeStorage uses PendingIntent from android.app
Create a new public IntentSender class that can be used by PackageManager instead. This new class uses IIntentSender internally and can only be created by PendingIntent for now. Provide a new getIntentSender api in PendingIntent to create an instance of this class. Move IIntentSender and IIntentReceiver from android.app to android.content Change imports of IIntentSender and IIntentReceiver to reflect the new package name The PackageManager api has been named as freeStorageWithIntent and will be renamed as freeStorage once the older api(which has been deprecated) will be removed shortly.
Diffstat (limited to 'core/java/android/content/pm')
-rw-r--r--core/java/android/content/pm/IPackageManager.aidl25
-rw-r--r--core/java/android/content/pm/PackageManager.java32
2 files changed, 55 insertions, 2 deletions
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 5f62248..1a0f31f 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -35,6 +35,7 @@ import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.net.Uri;
import android.app.PendingIntent;
+import android.content.IntentSender;
/**
* See {@link PackageManager} for documentation on most of the APIs
@@ -243,6 +244,30 @@ interface IPackageManager {
*/
void freeStorage(in long freeStorageSize,
in PendingIntent opFinishedIntent);
+
+ /**
+ * Free storage by deleting LRU sorted list of cache files across
+ * all applications. If the currently available free storage
+ * on the device is greater than or equal to the requested
+ * free storage, no cache files are cleared. If the currently
+ * available storage on the device is less than the requested
+ * free storage, some or all of the cache files across
+ * all applications are deleted (based on last accessed time)
+ * to increase the free storage space on the device to
+ * the requested value. There is no guarantee that clearing all
+ * the cache files from all applications will clear up
+ * enough storage to achieve the desired value.
+ * @param freeStorageSize The number of bytes of storage to be
+ * freed by the system. Say if freeStorageSize is XX,
+ * and the current free storage is YY,
+ * if XX is less than YY, just return. if not free XX-YY number
+ * of bytes if possible.
+ * @param pi IntentSender call back used to
+ * notify when the operation is completed.May be null
+ * to indicate that no call back is desired.
+ */
+ void freeStorageWithIntent(in long freeStorageSize,
+ in IntentSender pi);
/**
* Delete all the cache files in an applications cache directory
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 6578391..f74f3c2 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -22,6 +22,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.IntentSender;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable;
@@ -1522,7 +1523,7 @@ public abstract class PackageManager {
* @hide
*/
public abstract void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer);
-
+
/**
* Free storage by deleting LRU sorted list of cache files across
* all applications. If the currently available free storage
@@ -1543,12 +1544,39 @@ public abstract class PackageManager {
* @param opFinishedIntent PendingIntent call back used to
* notify when the operation is completed.May be null
* to indicate that no call back is desired.
- *
+ *
+ * @deprecated
* @hide
*/
+ @Deprecated
public abstract void freeStorage(long freeStorageSize, PendingIntent opFinishedIntent);
/**
+ * Free storage by deleting LRU sorted list of cache files across
+ * all applications. If the currently available free storage
+ * on the device is greater than or equal to the requested
+ * free storage, no cache files are cleared. If the currently
+ * available storage on the device is less than the requested
+ * free storage, some or all of the cache files across
+ * all applications are deleted (based on last accessed time)
+ * to increase the free storage space on the device to
+ * the requested value. There is no guarantee that clearing all
+ * the cache files from all applications will clear up
+ * enough storage to achieve the desired value.
+ * @param freeStorageSize The number of bytes of storage to be
+ * freed by the system. Say if freeStorageSize is XX,
+ * and the current free storage is YY,
+ * if XX is less than YY, just return. if not free XX-YY number
+ * of bytes if possible.
+ * @param pi IntentSender call back used to
+ * notify when the operation is completed.May be null
+ * to indicate that no call back is desired.
+ *
+ * @hide
+ */
+ public abstract void freeStorageWithIntent(long freeStorageSize, IntentSender pi);
+
+ /**
* Retrieve the size information for a package.
* Since this may take a little while, the result will
* be posted back to the given observer. The calling context