summaryrefslogtreecommitdiffstats
path: root/core/java/android/os
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-06-26 18:07:43 -0700
committerDianne Hackborn <hackbod@google.com>2013-06-26 19:17:15 -0700
commit053f61d6a6e23825e680dc49982e55c5b4299d61 (patch)
treef9ef87d68f6aa1e5210e6f65ea0c66805d8c8fcc /core/java/android/os
parent9feab843ac8139f4e971d93fd767470d0d727e41 (diff)
downloadframeworks_base-053f61d6a6e23825e680dc49982e55c5b4299d61.zip
frameworks_base-053f61d6a6e23825e680dc49982e55c5b4299d61.tar.gz
frameworks_base-053f61d6a6e23825e680dc49982e55c5b4299d61.tar.bz2
Work on issue #9586838: Crash after waking up Hammerhead device
I made the power manager more rigid, not allowing different uids to use the same wake lock. This never should happen. I would guess there is somewhere that the activity manager is acquiring the wake lock without clearing the calling identity... but it is hard to follow all the paths this may happen in. So here we add some checks when acquiring/releasing the wake lock to make sure it is being done as the system uid. Also: - Protect the new activity stack calls with a permission, and make sure to clear the calling uid once past that. - Collect uid data from process stats so we can correctly associate CPU use with a uid even if we don't know about the pid for some reason. - Fix battery stats dump commands to clear calling uid before executing so they aren't broken. Change-Id: I0030d4f7b614e3270d794ecfc3669139a5703ce9
Diffstat (limited to 'core/java/android/os')
-rw-r--r--core/java/android/os/FileUtils.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java
index 9666d9a..97ea99d 100644
--- a/core/java/android/os/FileUtils.java
+++ b/core/java/android/os/FileUtils.java
@@ -60,6 +60,8 @@ public class FileUtils {
public static native int setPermissions(String file, int mode, int uid, int gid);
+ public static native int getUid(String file);
+
/** returns the FAT file system volume ID for the volume mounted
* at the given mount point, or -1 for failure
* @param mountPoint point for FAT volume