Fix wrong dump output of *Info#flags

This CL follows up to a previous CL [1] that introduced an ability to
control filtering level of
 - ActivityInfo#dump()
 - ApplicationInfo#dump()
 - ComponentInfo#dump()
 - ProviderInfo#dump()
 - ResolveInfo#dump()
 - ServiceInfo#dump()
but also masked following outputs as an unexpected side effect.
 - ActivityInfo#flags
 - ApplicationInfo#flags
 - ProviderInfo#flags
 - ServiceInfo#flags

With this CL, above *Info#flags are correctly dumped again.

 [1]: I0d01565babb87e68b840c9756a2ea730d699efc7
      6ac42aeed9

Test: Manually tested as follows.
 1. make -j SoftKeyboard
 2. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
 3. adb shell dumpsys input_method
    -> Check 'com.example.android.softkeyboard' section
      -> make sure ServiceInfo#flags=0x0
      -> make sure ApplicationInfo#flags=0x38a8be44
           FLAG_HAS_CODE (1<<2)
           FLAG_ALLOW_CLEAR_USER_DATA (1<<6)
           FLAG_SUPPORTS_SMALL_SCREENS (1<<9)
           FLAG_SUPPORTS_NORMAL_SCREENS (1<<10)
           FLAG_SUPPORTS_LARGE_SCREENS (1<<11)
           FLAG_RESIZEABLE_FOR_SCREENS (1<<12)
           FLAG_SUPPORTS_SCREEN_DENSITIES (1<<13)
           FLAG_ALLOW_BACKUP (1<<15)
           FLAG_SUPPORTS_XLARGE_SCREENS (1<<19)
           FLAG_STOPPED (1<<21)
           FLAG_SUPPORTS_RTL (1<<22)
           FLAG_INSTALLED (1<<23)
           FLAG_FULL_BACKUP_ONLY (1<<26)
           FLAG_EXTRACT_NATIVE_LIBS (1<<28)
           FLAG_HARDWARE_ACCELERATED (1<<29)
Fixes: 65057767
Change-Id: Icd1e18237e873844791ccdea7f424b6fe76137c0
This commit is contained in:
Yohei Yukawa
2017-08-31 00:26:01 -07:00
parent 8d1a86ca0f
commit 8f272178a0
6 changed files with 24 additions and 24 deletions

View File

@@ -1096,12 +1096,12 @@ public class ActivityInfo extends ComponentInfo
}
/** @hide */
public void dump(Printer pw, String prefix, int flags) {
public void dump(Printer pw, String prefix, int dumpFlags) {
super.dumpFront(pw, prefix);
if (permission != null) {
pw.println(prefix + "permission=" + permission);
}
if ((flags&DUMP_FLAG_DETAILS) != 0) {
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
pw.println(prefix + "taskAffinity=" + taskAffinity
+ " targetActivity=" + targetActivity
+ " persistableMode=" + persistableModeToString());
@@ -1120,7 +1120,7 @@ public class ActivityInfo extends ComponentInfo
if (uiOptions != 0) {
pw.println(prefix + " uiOptions=0x" + Integer.toHexString(uiOptions));
}
if ((flags&DUMP_FLAG_DETAILS) != 0) {
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
pw.println(prefix + "lockTaskLaunchMode="
+ lockTaskLaunchModeToString(lockTaskLaunchMode));
}
@@ -1136,7 +1136,7 @@ public class ActivityInfo extends ComponentInfo
if (maxAspectRatio != 0) {
pw.println(prefix + "maxAspectRatio=" + maxAspectRatio);
}
super.dumpBack(pw, prefix, flags);
super.dumpBack(pw, prefix, dumpFlags);
}
public String toString() {

View File

@@ -1046,22 +1046,22 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
}
/** @hide */
public void dump(Printer pw, String prefix, int flags) {
public void dump(Printer pw, String prefix, int dumpFlags) {
super.dumpFront(pw, prefix);
if ((flags&DUMP_FLAG_DETAILS) != 0 && className != null) {
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && className != null) {
pw.println(prefix + "className=" + className);
}
if (permission != null) {
pw.println(prefix + "permission=" + permission);
}
pw.println(prefix + "processName=" + processName);
if ((flags&DUMP_FLAG_DETAILS) != 0) {
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
pw.println(prefix + "taskAffinity=" + taskAffinity);
}
pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
+ " privateFlags=0x" + Integer.toHexString(privateFlags)
+ " theme=0x" + Integer.toHexString(theme));
if ((flags&DUMP_FLAG_DETAILS) != 0) {
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp
+ " compatibleWidthLimitDp=" + compatibleWidthLimitDp
+ " largestWidthLimitDp=" + largestWidthLimitDp);
@@ -1080,12 +1080,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
if (resourceDirs != null) {
pw.println(prefix + "resourceDirs=" + Arrays.toString(resourceDirs));
}
if ((flags&DUMP_FLAG_DETAILS) != 0 && seInfo != null) {
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && seInfo != null) {
pw.println(prefix + "seinfo=" + seInfo);
pw.println(prefix + "seinfoUser=" + seInfoUser);
}
pw.println(prefix + "dataDir=" + dataDir);
if ((flags&DUMP_FLAG_DETAILS) != 0) {
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
pw.println(prefix + "deviceProtectedDataDir=" + deviceProtectedDataDir);
pw.println(prefix + "credentialProtectedDataDir=" + credentialProtectedDataDir);
if (sharedLibraryFiles != null) {
@@ -1104,7 +1104,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
+ " targetSdkVersion=" + targetSdkVersion
+ " versionCode=" + versionCode
+ " targetSandboxVersion=" + targetSandboxVersion);
if ((flags&DUMP_FLAG_DETAILS) != 0) {
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
if (manageSpaceActivityName != null) {
pw.println(prefix + "manageSpaceActivityName=" + manageSpaceActivityName);
}

View File

@@ -183,12 +183,12 @@ public class ComponentInfo extends PackageItemInfo {
protected void dumpBack(Printer pw, String prefix) {
dumpBack(pw, prefix, DUMP_FLAG_ALL);
}
void dumpBack(Printer pw, String prefix, int flags) {
if ((flags&DUMP_FLAG_APPLICATION) != 0) {
void dumpBack(Printer pw, String prefix, int dumpFlags) {
if ((dumpFlags & DUMP_FLAG_APPLICATION) != 0) {
if (applicationInfo != null) {
pw.println(prefix + "ApplicationInfo:");
applicationInfo.dump(pw, prefix + " ", flags);
applicationInfo.dump(pw, prefix + " ", dumpFlags);
} else {
pw.println(prefix + "ApplicationInfo: null");
}

View File

@@ -125,11 +125,11 @@ public final class ProviderInfo extends ComponentInfo
}
/** @hide */
public void dump(Printer pw, String prefix, int flags) {
public void dump(Printer pw, String prefix, int dumpFlags) {
super.dumpFront(pw, prefix);
pw.println(prefix + "authority=" + authority);
pw.println(prefix + "flags=0x" + Integer.toHexString(flags));
super.dumpBack(pw, prefix, flags);
super.dumpBack(pw, prefix, dumpFlags);
}
public int describeContents() {

View File

@@ -282,7 +282,7 @@ public class ResolveInfo implements Parcelable {
}
/** @hide */
public void dump(Printer pw, String prefix, int flags) {
public void dump(Printer pw, String prefix, int dumpFlags) {
if (filter != null) {
pw.println(prefix + "Filter:");
filter.dump(pw, prefix + " ");
@@ -302,13 +302,13 @@ public class ResolveInfo implements Parcelable {
}
if (activityInfo != null) {
pw.println(prefix + "ActivityInfo:");
activityInfo.dump(pw, prefix + " ", flags);
activityInfo.dump(pw, prefix + " ", dumpFlags);
} else if (serviceInfo != null) {
pw.println(prefix + "ServiceInfo:");
serviceInfo.dump(pw, prefix + " ", flags);
serviceInfo.dump(pw, prefix + " ", dumpFlags);
} else if (providerInfo != null) {
pw.println(prefix + "ProviderInfo:");
providerInfo.dump(pw, prefix + " ", flags);
providerInfo.dump(pw, prefix + " ", dumpFlags);
}
}

View File

@@ -91,13 +91,13 @@ public class ServiceInfo extends ComponentInfo
}
/** @hide */
void dump(Printer pw, String prefix, int flags) {
void dump(Printer pw, String prefix, int dumpFlags) {
super.dumpFront(pw, prefix);
pw.println(prefix + "permission=" + permission);
pw.println(prefix + "flags=0x" + Integer.toHexString(flags));
super.dumpBack(pw, prefix, flags);
super.dumpBack(pw, prefix, dumpFlags);
}
public String toString() {
return "ServiceInfo{"
+ Integer.toHexString(System.identityHashCode(this))