diff --git a/api/current.txt b/api/current.txt index 143e3d87870bb..5b55fdc4b9666 100644 --- a/api/current.txt +++ b/api/current.txt @@ -3848,7 +3848,7 @@ package android.app { method public deprecated java.util.List getRecentTasks(int, int) throws java.lang.SecurityException; method public java.util.List getRunningAppProcesses(); method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException; - method public java.util.List getRunningServices(int) throws java.lang.SecurityException; + method public deprecated java.util.List getRunningServices(int) throws java.lang.SecurityException; method public deprecated java.util.List 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 e0148092c3b34..23a8cad152daf 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -3989,7 +3989,7 @@ package android.app { method public deprecated java.util.List getRecentTasks(int, int) throws java.lang.SecurityException; method public java.util.List getRunningAppProcesses(); method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException; - method public java.util.List getRunningServices(int) throws java.lang.SecurityException; + method public deprecated java.util.List getRunningServices(int) throws java.lang.SecurityException; method public deprecated java.util.List 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 543fcc60fb11d..3373ab735a364 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -3852,7 +3852,7 @@ package android.app { method public deprecated java.util.List getRecentTasks(int, int) throws java.lang.SecurityException; method public java.util.List getRunningAppProcesses(); method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException; - method public java.util.List getRunningServices(int) throws java.lang.SecurityException; + method public deprecated java.util.List getRunningServices(int) throws java.lang.SecurityException; method public deprecated java.util.List 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 66167a3c986a5..a4dcf630bc3e2 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -2564,6 +2564,10 @@ public class ActivityManager { *

Note: this method is only intended for debugging or implementing * service management type user interfaces.

* + * @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. @@ -2571,6 +2575,7 @@ public class ActivityManager { * @return Returns a list of RunningServiceInfo records describing each of * the running tasks. */ + @Deprecated public List getRunningServices(int maxNum) throws SecurityException { try {