Merge "Deprecate ActivityManager#getRunningServices" into oc-dev am: 25b7687771
am: 178fe0d0f3
Change-Id: Id6c0c4f36d29071497d43f36bdc8a87ade9a2e43
diff --git a/api/current.txt b/api/current.txt
index 24277eb..608beb9 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -3848,7 +3848,7 @@
method public deprecated java.util.List<android.app.ActivityManager.RecentTaskInfo> getRecentTasks(int, int) throws java.lang.SecurityException;
method public java.util.List<android.app.ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException;
- method public java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
+ method public deprecated java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
method public deprecated java.util.List<android.app.ActivityManager.RunningTaskInfo> getRunningTasks(int) throws java.lang.SecurityException;
method public deprecated boolean isInLockTaskMode();
method public boolean isLowRamDevice();
diff --git a/api/system-current.txt b/api/system-current.txt
index 531543e..16c02ca 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -3989,7 +3989,7 @@
method public deprecated java.util.List<android.app.ActivityManager.RecentTaskInfo> getRecentTasks(int, int) throws java.lang.SecurityException;
method public java.util.List<android.app.ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException;
- method public java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
+ method public deprecated java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
method public deprecated java.util.List<android.app.ActivityManager.RunningTaskInfo> getRunningTasks(int) throws java.lang.SecurityException;
method public int getUidImportance(int);
method public deprecated boolean isInLockTaskMode();
diff --git a/api/test-current.txt b/api/test-current.txt
index 7c35cf4..be59eac 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -3852,7 +3852,7 @@
method public deprecated java.util.List<android.app.ActivityManager.RecentTaskInfo> getRecentTasks(int, int) throws java.lang.SecurityException;
method public java.util.List<android.app.ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException;
- method public java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
+ method public deprecated java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
method public deprecated java.util.List<android.app.ActivityManager.RunningTaskInfo> getRunningTasks(int) throws java.lang.SecurityException;
method public int getUidImportance(int);
method public deprecated boolean isInLockTaskMode();
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 8422023..35615ed 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -2580,6 +2580,10 @@
* <p><b>Note: this method is only intended for debugging or implementing
* service management type user interfaces.</b></p>
*
+ * @deprecated As of {@link android.os.Build.VERSION_CODES#O}, this method
+ * is no longer available to third party applications. For backwards compatibility,
+ * it will still return the caller's own services.
+ *
* @param maxNum The maximum number of entries to return in the list. The
* actual number returned may be smaller, depending on how many services
* are running.
@@ -2587,6 +2591,7 @@
* @return Returns a list of RunningServiceInfo records describing each of
* the running tasks.
*/
+ @Deprecated
public List<RunningServiceInfo> getRunningServices(int maxNum)
throws SecurityException {
try {