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

Commit f43df341 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Improve BalVerdict.toString

Show extra information only if debugging is enabled.
Fix string representation for BAL_BLOCK.

Test: atest BackgroundActivityLaunchTest
Bug: 306059525
Change-Id: I8bfc73764f5d113f499d914c146e710651b8913a
parent 3a687e93
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -356,16 +356,24 @@ public class BackgroundActivityStartController {

        public String toString() {
            StringBuilder builder = new StringBuilder();
            builder.append(". BAL Code: ");
            builder.append(balCodeToString(mCode));
            if (DEBUG_ACTIVITY_STARTS) {
                builder.append(" ");
                if (mBackground) {
                    builder.append("Background ");
                }
            builder.append("Activity start allowed: " + mMessage + ".");
            builder.append("BAL Code: ");
            builder.append(balCodeToString(mCode));
                builder.append("Activity start ");
                if (mCode == BAL_BLOCK) {
                    builder.append("denied");
                } else {
                    builder.append("allowed: ").append(mMessage);
                }
                if (mProcessInfo != null) {
                    builder.append(" ");
                    builder.append(mProcessInfo);
                }
            }
            return builder.toString();
        }