diff options
author | Tyler Dewey <deweytyl@google.com> | 2023-09-27 15:17:36 +0000 |
---|---|---|
committer | Tyler Dewey <deweytyl@google.com> | 2023-09-27 15:42:21 +0000 |
commit | a2ce8143b660403d9cdc1b42cb832435a1cec378 (patch) | |
tree | 6cd7ebf485bad283315853859134bdcc675eeb3c /PermissionController/src/com | |
parent | 3e5ee81f35ca03b1f01a9597bab5ccb5e48d929c (diff) | |
download | Permission-a2ce8143b660403d9cdc1b42cb832435a1cec378.tar.gz |
Add debug logging for status rendering.
Bug: 301234118
Bug: 292470327
Test: ran locally, no crashes, treehugger
Relnote: N/a
Change-Id: I8f1b94743697e27f765054dbe359c7a0e75cf5a4
Diffstat (limited to 'PermissionController/src/com')
-rw-r--r-- | PermissionController/src/com/android/permissioncontroller/safetycenter/ui/SafetyStatusPreference.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/safetycenter/ui/SafetyStatusPreference.java b/PermissionController/src/com/android/permissioncontroller/safetycenter/ui/SafetyStatusPreference.java index 0b8706a38..3242ea84b 100644 --- a/PermissionController/src/com/android/permissioncontroller/safetycenter/ui/SafetyStatusPreference.java +++ b/PermissionController/src/com/android/permissioncontroller/safetycenter/ui/SafetyStatusPreference.java @@ -27,6 +27,7 @@ import android.os.Looper; import android.safetycenter.SafetyCenterStatus; import android.text.TextUtils; import android.util.AttributeSet; +import android.util.Log; import android.widget.ImageView; import android.widget.TextView; @@ -49,6 +50,8 @@ import java.util.Objects; @RequiresApi(TIRAMISU) public class SafetyStatusPreference extends Preference implements ComparablePreference { + private static final String TAG = "SafetyStatusPreference"; + @Nullable private StatusUiData mStatus; @Nullable private SafetyCenterViewModel mViewModel; @@ -72,6 +75,7 @@ public class SafetyStatusPreference extends Preference implements ComparablePref @Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); + Log.d(TAG, String.format("onBindViewHolder called for status %s", mStatus)); if (mStatus == null) { return; @@ -335,6 +339,7 @@ public class SafetyStatusPreference extends Preference implements ComparablePref void setData(StatusUiData statusUiData) { mStatus = statusUiData; + Log.d(TAG, String.format("setData called for status %s", mStatus)); safeNotifyChanged(); } @@ -349,7 +354,14 @@ public class SafetyStatusPreference extends Preference implements ComparablePref // Calling notifyChanged while recyclerview is scrolling or computing layout will result in an // IllegalStateException. Post to handler to wait for UI to settle. private void safeNotifyChanged() { - new Handler(Looper.getMainLooper()).post(this::notifyChanged); + new Handler(Looper.getMainLooper()) + .post( + () -> { + Log.d( + TAG, + String.format("Calling notifyChanged for status %s", mStatus)); + notifyChanged(); + }); } @Override |