Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5d70fd2 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Protect system services with DUMP permission." into jb-dev

parents d52e0c79 eb4cc492
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -588,6 +588,8 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub {

    @Override
    protected synchronized void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);

        if (mAudioDevices.isEmpty()) return;
        pw.println("Cached audio devices:");
        for (BluetoothDevice device : mAudioDevices.keySet()) {
+2 −0
Original line number Diff line number Diff line
@@ -1775,6 +1775,8 @@ public class BluetoothService extends IBluetooth.Stub {

    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);

        if (getBluetoothStateInternal() != BluetoothAdapter.STATE_ON) {
            return;
        }
+2 −0
Original line number Diff line number Diff line
@@ -169,6 +169,8 @@ public class DreamManagerService
    
    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);

        pw.println("Dreamland:");
        pw.print("  component="); pw.println(mCurrentDreamComponent);
        pw.print("  token="); pw.println(mCurrentDreamToken);
+2 −0
Original line number Diff line number Diff line
@@ -4232,6 +4232,8 @@ public class AudioService extends IAudioService.Stub {

    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);

        // TODO probably a lot more to do here than just the audio focus and remote control stacks
        dumpFocusStack(pw);
        dumpRCStack(pw);
+0 −8
Original line number Diff line number Diff line
@@ -111,14 +111,6 @@ public class SystemUIService extends Service {

    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        if (checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
                != PackageManager.PERMISSION_GRANTED) {
            pw.println("Permission Denial: can't dump StatusBar from from pid="
                    + Binder.getCallingPid()
                    + ", uid=" + Binder.getCallingUid());
            return;
        }

        if (args == null || args.length == 0) {
            for (SystemUI ui: mServices) {
                pw.println("dumping service: " + ui.getClass().getName());
Loading