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

Commit 2a50c988 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android Git Automerger
Browse files

am 3dc66997: Merge "Fixing Telecom state dumping." into lmp-mr1-dev

* commit '3dc66997':
  Fixing Telecom state dumping.
parents f22c524d 3dc66997
Loading
Loading
Loading
Loading
+32 −24
Original line number Diff line number Diff line
@@ -684,6 +684,38 @@ public class TelecomService extends Service {
                        + " to add new unknown call.");
            }
        }

        /**
         * Dumps the current state of the TelecomService.  Used when generating problem reports.
         *
         * @param fd The file descriptor.
         * @param writer The print writer to dump the state to.
         * @param args Optional dump arguments.
         */
        @Override
        protected void dump(FileDescriptor fd, final PrintWriter writer, String[] args) {
            if (mContext.checkCallingOrSelfPermission(
                    android.Manifest.permission.DUMP)
                    != PackageManager.PERMISSION_GRANTED) {
                writer.println("Permission Denial: can't dump TelecomService " +
                        "from from pid=" + Binder.getCallingPid() + ", uid=" +
                        Binder.getCallingUid());
                return;
            }

            final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
            if (mCallsManager != null) {
                pw.println("mCallsManager: ");
                pw.increaseIndent();
                mCallsManager.dump(pw);
                pw.decreaseIndent();

                pw.println("mPhoneAccountRegistrar: ");
                pw.increaseIndent();
                mPhoneAccountRegistrar.dump(pw);
                pw.decreaseIndent();
            }
        }
    }

    //
@@ -945,28 +977,4 @@ public class TelecomService extends Service {
            return request.result;
        }
    }

    /**
     * Dumps the current state of the TelecomService.  Used when generating problem reports.
     *
     * @param fd The file descriptor.
     * @param writer The print writer to dump the state to.
     * @param args Optional dump arguments.
     */
    @Override
    protected void dump(FileDescriptor fd, final PrintWriter writer, String[] args) {
        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
        final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
        if (mCallsManager != null) {
            pw.println("mCallsManager: ");
            pw.increaseIndent();
            mCallsManager.dump(pw);
            pw.decreaseIndent();

            pw.println("mPhoneAccountRegistrar: ");
            pw.increaseIndent();
            mPhoneAccountRegistrar.dump(pw);
            pw.decreaseIndent();
        }
    }
}