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

Commit 47689869 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Fixing Telecom state dumping.

When migration to system service was performed, the dump method was
put in the outer "service" class, where it belongs in the stub
implementation.

Bug: 18792141
Change-Id: I38a1c1b79160f296d65641151b93c91adf46b37e
parent 386b5f9c
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();
        }
    }
}