make statsd run in its own uid
+ Assign permission android.permission.STATSCOMPANION to statsd + Fixes in StatsCompanionService to allow statsd to get uid mapping Test: manual Change-Id: I3e6ca79eefed7f93a4588578c156321c4c278fd3
This commit is contained in:
@@ -14,5 +14,5 @@
|
||||
|
||||
service statsd /system/bin/statsd
|
||||
class main
|
||||
user system
|
||||
group system
|
||||
user statsd
|
||||
group statsd log
|
||||
|
||||
@@ -168,6 +168,8 @@
|
||||
<assign-permission name="android.permission.ACCESS_LOWPAN_STATE" uid="lowpan" />
|
||||
<assign-permission name="android.permission.MANAGE_LOWPAN_INTERFACES" uid="lowpan" />
|
||||
|
||||
<assign-permission name="android.permission.STATSCOMPANION" uid="statsd" />
|
||||
|
||||
<!-- This is a list of all the libraries available for application
|
||||
code to link against. -->
|
||||
|
||||
|
||||
@@ -743,9 +743,13 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
|
||||
filter.addAction(Intent.ACTION_SHUTDOWN);
|
||||
mContext.registerReceiverAsUser(
|
||||
mShutdownEventReceiver, UserHandle.ALL, filter, null, null);
|
||||
|
||||
// Pull the latest state of UID->app name, version mapping when statsd starts.
|
||||
informAllUidsLocked(mContext);
|
||||
final long token = Binder.clearCallingIdentity();
|
||||
try {
|
||||
// Pull the latest state of UID->app name, version mapping when statsd starts.
|
||||
informAllUidsLocked(mContext);
|
||||
} finally {
|
||||
restoreCallingIdentity(token);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Failed to inform statsd that statscompanion is ready", e);
|
||||
forgetEverything();
|
||||
|
||||
Reference in New Issue
Block a user