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

Commit e27e4225 authored by Felipe Leme's avatar Felipe Leme
Browse files

Improved `dumpsys device_config` so it calls the mainline implementation.

That will allow it to include more information, like the property
change listeners. Example:

$ adb shell dumpsys device_config | grep listeners | head -3
245 listeners for 185 namespaces:
   accessibility: 2 listeners
   activity_manager: 5 listeners

Bug: 364399200
Test: see above
Flag: android.provider.flags.dump_improvements

Change-Id: Ifab219bccededb07de558dced9d6203efe568042
parent 6a7b8d72
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ android_library {
        "aconfig_new_storage_flags_lib",
        "aconfigd_java_utils",
        "aconfig_demo_flags_java_lib",
        "configinfra_framework_flags_java_lib",
        "device_config_service_flags_java",
        "libaconfig_java_proto_lite",
        "SettingsLibDeviceStateRotationLock",
+16 −6
Original line number Diff line number Diff line
@@ -99,13 +99,23 @@ public final class DeviceConfigService extends Binder {

    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        if (android.provider.flags.Flags.dumpImprovements()) {
            pw.print("SyncDisabledForTests: ");
            MyShellCommand.getSyncDisabledForTests(pw, pw);

        pw.print("Is mainline: ");
            pw.print("UpdatableDeviceConfigServiceReadiness.shouldStartUpdatableService(): ");
            pw.println(UpdatableDeviceConfigServiceReadiness.shouldStartUpdatableService());

        final IContentProvider iprovider = mProvider.getIContentProvider();
            pw.println("DeviceConfig provider: ");
            try (ParcelFileDescriptor pfd = ParcelFileDescriptor.dup(fd)) {
                DeviceConfig.dump(pfd, pw, /* prefix= */ "  ", args);
            } catch (IOException e) {
                pw.print("IOException creating ParcelFileDescriptor: ");
                pw.println(e);
            }
        }

        IContentProvider iprovider = mProvider.getIContentProvider();
        pw.println("DeviceConfig flags:");
        for (String line : MyShellCommand.listAll(iprovider)) {
            pw.println(line);