summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dave Mankoff <mankoff@google.com> 2018-12-11 18:27:05 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-12-11 18:27:05 +0000
commitdc3241f34ad79257c7b6671091debe254e82a301 (patch)
treea6f3f89de161da04805f7b8a23cbb96ad50d16a1
parent9943de9fb9a6c338d2d06d237e0cc9938caa4c63 (diff)
parentc56db333a22b0dfad224211b80fbaa57bad0d464 (diff)
Merge "Initialize ViewState member variable in constructor and make it final."
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
index 20c48163e6b1..b1fa6a531438 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java
@@ -21,7 +21,6 @@ import android.content.Context;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -60,10 +59,11 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable {
private ViewGroup mTransientContainer;
private boolean mInShelf;
private boolean mTransformingInShelf;
- @Nullable private ExpandableViewState mViewState;
+ private final ExpandableViewState mViewState;
public ExpandableView(Context context, AttributeSet attrs) {
super(context, attrs);
+ mViewState = createExpandableViewState();
}
@Override
@@ -536,11 +536,6 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable {
/** Sets {@link ExpandableViewState} to default state. */
public ExpandableViewState resetViewState() {
- // TODO(http://b/119762423): Move the null check to getViewState().
- if (mViewState == null) {
- mViewState = createExpandableViewState();
- }
-
// initialize with the default values of the view
mViewState.height = getIntrinsicHeight();
mViewState.gone = getVisibility() == View.GONE;
@@ -573,9 +568,7 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable {
/** Applies internal {@link ExpandableViewState} to this view. */
public void applyViewState() {
- if (mViewState == null) {
- Log.wtf(TAG, "No child state was found when applying this state to the hostView");
- } else if (!mViewState.gone) {
+ if (!mViewState.gone) {
mViewState.applyToView(this);
}
}