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

Commit f77f7244 authored by Tim Murray's avatar Tim Murray
Browse files

PinnerService: output total pinned size

Test: dumpsys pinner prints total size
bug 70859548

Change-Id: I9b91c3e7992ad3ade6127ac5343a2e5ab64a132d
parent e2975162
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -372,15 +372,19 @@ public final class PinnerService extends SystemService {
        @Override
        protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
            if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
            long totalSize = 0;
            pw.println("Pinned Files:");
            synchronized(this) {
                for (int i = 0; i < mPinnedFiles.size(); i++) {
                    pw.println(mPinnedFiles.get(i).mFilename);
                    totalSize += mPinnedFiles.get(i).mLength;
                }
                for (int i = 0; i < mPinnedCameraFiles.size(); i++) {
                    pw.println(mPinnedCameraFiles.get(i).mFilename);
                    totalSize += mPinnedCameraFiles.get(i).mLength;
                }
            }
            pw.println("Total size: " + totalSize);
        }
    }