From 22cfef381d437bd26d23909f733ddc537a44530f Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Tue, 17 May 2016 15:29:51 -0700 Subject: [PATCH 1/2] @hide SystemHealthManager.from Bug: 28820055 Change-Id: Idd434c196428178e2c66facea36a7e010246611c --- api/current.txt | 1 - api/system-current.txt | 9 ++++----- api/test-current.txt | 1 - core/java/android/os/health/SystemHealthManager.java | 2 ++ 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/api/current.txt b/api/current.txt index c808e04ff3c25..130aac964cf01 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29368,7 +29368,6 @@ package android.os.health { } public class SystemHealthManager { - method public static android.os.health.SystemHealthManager from(android.content.Context); method public android.os.health.HealthStats takeMyUidSnapshot(); method public android.os.health.HealthStats takeUidSnapshot(int); method public android.os.health.HealthStats[] takeUidSnapshots(int[]); diff --git a/api/system-current.txt b/api/system-current.txt index fa9bdb881aa29..aaee4d1152fee 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -31762,6 +31762,7 @@ package android.os { method public android.os.UserHandle getUserForSerialNumber(long); method public java.lang.String getUserName(); method public java.util.List getUserProfiles(); + method public int getUserRestrictionSource(java.lang.String, android.os.UserHandle); method public android.os.Bundle getUserRestrictions(); method public android.os.Bundle getUserRestrictions(android.os.UserHandle); method public boolean hasUserRestriction(java.lang.String); @@ -31779,7 +31780,6 @@ package android.os { method public deprecated void setUserRestrictions(android.os.Bundle); method public deprecated void setUserRestrictions(android.os.Bundle, android.os.UserHandle); method public static boolean supportsMultipleUsers(); - method public int getUserRestrictionSource(java.lang.String, android.os.UserHandle); field public static final java.lang.String ALLOW_PARENT_PROFILE_APP_LINKING = "allow_parent_profile_app_linking"; field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user"; field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume"; @@ -31815,12 +31815,12 @@ package android.os { field public static final java.lang.String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer"; field public static final java.lang.String ENSURE_VERIFY_APPS = "ensure_verify_apps"; field public static final java.lang.String KEY_RESTRICTIONS_PENDING = "restrictions_pending"; - field public static final int USER_CREATION_FAILED_NOT_PERMITTED = 1; // 0x1 - field public static final int USER_CREATION_FAILED_NO_MORE_USERS = 2; // 0x2 field public static final int RESTRICTION_NOT_SET = 0; // 0x0 - field public static final int RESTRICTION_SOURCE_SYSTEM = 1; // 0x1 field public static final int RESTRICTION_SOURCE_DEVICE_OWNER = 2; // 0x2 field public static final int RESTRICTION_SOURCE_PROFILE_OWNER = 4; // 0x4 + field public static final int RESTRICTION_SOURCE_SYSTEM = 1; // 0x1 + field public static final int USER_CREATION_FAILED_NOT_PERMITTED = 1; // 0x1 + field public static final int USER_CREATION_FAILED_NO_MORE_USERS = 2; // 0x2 } public static abstract class UserManager.UserRestrictionSource implements java.lang.annotation.Annotation { @@ -31904,7 +31904,6 @@ package android.os.health { } public class SystemHealthManager { - method public static android.os.health.SystemHealthManager from(android.content.Context); method public android.os.health.HealthStats takeMyUidSnapshot(); method public android.os.health.HealthStats takeUidSnapshot(int); method public android.os.health.HealthStats[] takeUidSnapshots(int[]); diff --git a/api/test-current.txt b/api/test-current.txt index d572c8dc1422e..e5a1ab6694494 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -29438,7 +29438,6 @@ package android.os.health { } public class SystemHealthManager { - method public static android.os.health.SystemHealthManager from(android.content.Context); method public android.os.health.HealthStats takeMyUidSnapshot(); method public android.os.health.HealthStats takeUidSnapshot(int); method public android.os.health.HealthStats[] takeUidSnapshots(int[]); diff --git a/core/java/android/os/health/SystemHealthManager.java b/core/java/android/os/health/SystemHealthManager.java index 7c37fa40154f3..32e8425cbe07b 100644 --- a/core/java/android/os/health/SystemHealthManager.java +++ b/core/java/android/os/health/SystemHealthManager.java @@ -53,6 +53,8 @@ public class SystemHealthManager { /** * Obtain a SystemHealthManager object for the supplied context. + * + * @hide */ public static SystemHealthManager from(Context context) { return (SystemHealthManager)context.getSystemService(Context.SYSTEM_HEALTH_SERVICE); From 1cc1d13d6efccbaec66b4237b80d6eae81f59108 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Tue, 17 May 2016 15:31:38 -0700 Subject: [PATCH 2/2] Demote the log in ProcessState.ensureNotDead from a wtf to a warning. It's raising alarm bells but there isn't much we can do without a lot of rewriting inside the ActivityManager. The only consequence is stats that are off by a little bit. Bug: 28581070 Change-Id: If51568c3a708a907ceef6452e7d45599a57454f7 --- core/java/com/android/internal/app/procstats/ProcessState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/com/android/internal/app/procstats/ProcessState.java b/core/java/com/android/internal/app/procstats/ProcessState.java index 80d60706e0ea0..8c5df08f54998 100644 --- a/core/java/com/android/internal/app/procstats/ProcessState.java +++ b/core/java/com/android/internal/app/procstats/ProcessState.java @@ -277,7 +277,7 @@ public final class ProcessState { if (!mDead) { return; } - Slog.wtfStack(TAG, "ProcessState dead: name=" + mName + Slog.w(TAG, "ProcessState dead: name=" + mName + " pkg=" + mPackage + " uid=" + mUid + " common.name=" + mCommonProcess.mName); }