Merge "Dump the system UI components config, so we can check if OEM redefines them." into qt-qpr1-dev
am: 305a6bd1d9
Change-Id: I56ccc9822826f183faf141b4c487caff5e0f1745
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.systemui;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
@@ -66,7 +67,13 @@ public class SystemUIService extends Service {
|
||||
|
||||
@Override
|
||||
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||
if (args != null && args.length > 0 && args[0].equals("--config")) {
|
||||
dumpConfig(pw);
|
||||
return;
|
||||
}
|
||||
|
||||
dumpServices(((SystemUIApplication) getApplication()).getServices(), fd, pw, args);
|
||||
dumpConfig(pw);
|
||||
}
|
||||
|
||||
static void dumpServices(
|
||||
@@ -95,5 +102,29 @@ public class SystemUIService extends Service {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dumpConfig(@NonNull PrintWriter pw) {
|
||||
pw.println("SystemUiServiceComponents configuration:");
|
||||
|
||||
pw.print("vendor component: ");
|
||||
pw.println(getResources().getString(R.string.config_systemUIVendorServiceComponent));
|
||||
|
||||
dumpConfig(pw, "global", R.array.config_systemUIServiceComponents);
|
||||
dumpConfig(pw, "per-user", R.array.config_systemUIServiceComponentsPerUser);
|
||||
}
|
||||
|
||||
private void dumpConfig(@NonNull PrintWriter pw, @NonNull String type, int resId) {
|
||||
final String[] services = getResources().getStringArray(resId);
|
||||
pw.print(type); pw.print(": ");
|
||||
if (services == null) {
|
||||
pw.println("N/A");
|
||||
return;
|
||||
}
|
||||
pw.print(services.length);
|
||||
pw.println(" services");
|
||||
for (int i = 0; i < services.length; i++) {
|
||||
pw.print(" "); pw.print(i); pw.print(": "); pw.println(services[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user