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

Commit df6c6e7c authored by Vishnu Nair's avatar Vishnu Nair
Browse files

Add DEFAULT dump priority for services

- Adds a new DEFAULT priority for services which is treated the same as NORMAL priority but dumpsys does not send "--dump-priority" arguments to the service.

Bug: 27429130
Test: Manually generate bugrepot (default version) and check for any issues
Test: Load bugreport on ABT
Test: mmm -j56 frameworks/native/cmds/dumpstate && \
      adb shell /data/nativetest64/dumpstate_smoke_test/dumpstate_smoke_test && \
      printf "\n\n#### ALL TESTS PASSED ####\n"

Change-Id: Ia90ae16d56d0144e679cf39ebfbf4473dd21f167
parent d393f279
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -76,9 +76,15 @@ public interface IServiceManager extends IInterface
    int DUMP_FLAG_PRIORITY_CRITICAL = 1 << 0;
    int DUMP_FLAG_PRIORITY_HIGH = 1 << 1;
    int DUMP_FLAG_PRIORITY_NORMAL = 1 << 2;
    /**
     * Services are by default registered with a DEFAULT dump priority. DEFAULT priority has the
     * same priority as NORMAL priority but the services are not called with dump priority
     * arguments.
     */
    int DUMP_FLAG_PRIORITY_DEFAULT = 1 << 3;
    int DUMP_FLAG_PRIORITY_ALL = DUMP_FLAG_PRIORITY_CRITICAL | DUMP_FLAG_PRIORITY_HIGH
            | DUMP_FLAG_PRIORITY_NORMAL;
            | DUMP_FLAG_PRIORITY_NORMAL | DUMP_FLAG_PRIORITY_DEFAULT;
    /* Allows services to dump sections in protobuf format. */
    int DUMP_FLAG_PROTO = 1 << 3;
    int DUMP_FLAG_PROTO = 1 << 4;

}
+2 −2
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public final class ServiceManager {
     * @param service the service object
     */
    public static void addService(String name, IBinder service) {
        addService(name, service, false, IServiceManager.DUMP_FLAG_PRIORITY_NORMAL);
        addService(name, service, false, IServiceManager.DUMP_FLAG_PRIORITY_DEFAULT);
    }

    /**
@@ -96,7 +96,7 @@ public final class ServiceManager {
     * to access this service
     */
    public static void addService(String name, IBinder service, boolean allowIsolated) {
        addService(name, service, allowIsolated, IServiceManager.DUMP_FLAG_PRIORITY_NORMAL);
        addService(name, service, allowIsolated, IServiceManager.DUMP_FLAG_PRIORITY_DEFAULT);
    }

    /**