Loading services/core/java/com/android/server/pm/ShortcutService.java +5 −0 Original line number Diff line number Diff line Loading @@ -3421,6 +3421,11 @@ public class ShortcutService extends IShortcutService.Stub { @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw)) return; dumpNoCheck(fd, pw, args); } @VisibleForTesting void dumpNoCheck(FileDescriptor fd, PrintWriter pw, String[] args) { boolean checkin = false; boolean clear = false; if (args != null) { Loading services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -1275,7 +1275,7 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { try { final ByteArrayOutputStream out = new ByteArrayOutputStream(); final PrintWriter pw = new PrintWriter(out); mService.dump(/* fd */ null, pw, args); mService.dumpNoCheck(/* fd */ null, pw, args); pw.close(); return out.toString(); Loading services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java +0 −10 Original line number Diff line number Diff line Loading @@ -2040,16 +2040,6 @@ public class ShortcutManagerTest2 extends BaseShortcutManagerTest { assertEquals(expected, dumpCheckin()); } public void testDumpsysNoPermission() { assertExpectException(SecurityException.class, "android.permission.DUMP", () -> mService.dump(null, new PrintWriter(new StringWriter()), null)); // System can call it without the permission. runWithSystemUid(() -> { mService.dump(null, new PrintWriter(new StringWriter()), null); }); } /** * Make sure the legacy file format that only supported a single intent per shortcut * can still be read. Loading Loading
services/core/java/com/android/server/pm/ShortcutService.java +5 −0 Original line number Diff line number Diff line Loading @@ -3421,6 +3421,11 @@ public class ShortcutService extends IShortcutService.Stub { @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw)) return; dumpNoCheck(fd, pw, args); } @VisibleForTesting void dumpNoCheck(FileDescriptor fd, PrintWriter pw, String[] args) { boolean checkin = false; boolean clear = false; if (args != null) { Loading
services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -1275,7 +1275,7 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { try { final ByteArrayOutputStream out = new ByteArrayOutputStream(); final PrintWriter pw = new PrintWriter(out); mService.dump(/* fd */ null, pw, args); mService.dumpNoCheck(/* fd */ null, pw, args); pw.close(); return out.toString(); Loading
services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java +0 −10 Original line number Diff line number Diff line Loading @@ -2040,16 +2040,6 @@ public class ShortcutManagerTest2 extends BaseShortcutManagerTest { assertEquals(expected, dumpCheckin()); } public void testDumpsysNoPermission() { assertExpectException(SecurityException.class, "android.permission.DUMP", () -> mService.dump(null, new PrintWriter(new StringWriter()), null)); // System can call it without the permission. runWithSystemUid(() -> { mService.dump(null, new PrintWriter(new StringWriter()), null); }); } /** * Make sure the legacy file format that only supported a single intent per shortcut * can still be read. Loading