Add more annotations

Bug: 209459024
Test: m SystemUI-core
Change-Id: Ic3ac681a1cbf744d3592f1fa9dd164b60c0bfdc4
This commit is contained in:
Fedor Kudasov
2022-01-11 11:16:02 +00:00
parent 780a694516
commit 85a7a4c3cf
8 changed files with 34 additions and 7 deletions

View File

@@ -16,6 +16,7 @@
package com.android.systemui.qs;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
@@ -73,7 +74,7 @@ public class AlphaControlledSignalTileView extends SignalTileView {
}
@Override
protected void setDrawableTintList(ColorStateList tint) {
protected void setDrawableTintList(@Nullable ColorStateList tint) {
}
/**

View File

@@ -27,6 +27,8 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.android.systemui.R;
import java.util.Objects;
@@ -48,6 +50,7 @@ public class QSDualTileLabel extends LinearLayout {
private final TextView mSecondLine;
private final int mHorizontalPaddingPx;
@Nullable
private String mText;
public QSDualTileLabel(Context context) {
@@ -122,6 +125,7 @@ public class QSDualTileLabel extends LinearLayout {
rescheduleUpdateText();
}
@Nullable
public String getText() {
return mText;
}

View File

@@ -48,6 +48,7 @@ import com.android.systemui.tuner.TunerService.Tunable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/** View that represents the quick settings tile panel (when expanded/pulled down). **/
public class QSPanel extends LinearLayout implements Tunable {
@@ -78,7 +79,7 @@ public class QSPanel extends LinearLayout implements Tunable {
protected boolean mExpanded;
protected boolean mListening;
protected QSTileHost mHost;
@Nullable protected QSTileHost mHost;
private final List<OnConfigurationChangedListener> mOnConfigurationChangedListeners =
new ArrayList<>();
@@ -92,14 +93,18 @@ public class QSPanel extends LinearLayout implements Tunable {
@Nullable
private ViewGroup mHeaderContainer;
@Nullable
private PageIndicator mFooterPageIndicator;
private int mContentMarginStart;
private int mContentMarginEnd;
private boolean mUsingHorizontalLayout;
@Nullable
private LinearLayout mHorizontalLinearLayout;
@Nullable
protected LinearLayout mHorizontalContentContainer;
@Nullable
protected QSTileLayout mTileLayout;
private float mSquishinessFraction = 1f;
private final ArrayMap<View, Integer> mChildrenLayoutTop = new ArrayMap<>();
@@ -284,7 +289,7 @@ public class QSPanel extends LinearLayout implements Tunable {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (move) {
int top = mChildrenLayoutTop.get(child);
int top = Objects.requireNonNull(mChildrenLayoutTop.get(child));
child.setLeftTopRightBottom(child.getLeft(), top + tileHeightOffset,
child.getRight(), top + tileHeightOffset + child.getHeight());
}
@@ -337,6 +342,7 @@ public class QSPanel extends LinearLayout implements Tunable {
}
}
@Nullable
public QSTileHost getHost() {
return mHost;
}
@@ -501,7 +507,6 @@ public class QSPanel extends LinearLayout implements Tunable {
mListening = listening;
}
protected void drawTile(QSPanelControllerBase.TileRecord r, QSTile.State state) {
r.tileView.onStateChanged(state);
}
@@ -548,6 +553,7 @@ public class QSPanel extends LinearLayout implements Tunable {
return getMeasuredHeight();
}
@Nullable
QSTileLayout getTileLayout() {
return mTileLayout;
}

View File

@@ -76,6 +76,7 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
private Consumer<Boolean> mMediaVisibilityChangedListener;
private int mLastOrientation;
private String mCachedSpecs = "";
@Nullable
private QSTileRevealController mQsTileRevealController;
private float mRevealExpansion;
@@ -185,6 +186,7 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
mDumpManager.unregisterDumpable(mView.getDumpableTag());
}
@Nullable
protected QSTileRevealController createTileRevealController() {
return null;
}
@@ -250,6 +252,7 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
return !mRecords.isEmpty();
}
@Nullable
QSTileView getTileView(QSTile tile) {
for (QSPanelControllerBase.TileRecord r : mRecords) {
if (r.tile == tile) {
@@ -411,6 +414,7 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
mUsingHorizontalLayoutChangedListener = listener;
}
@Nullable
public View getBrightnessView() {
return mView.getBrightnessView();
}
@@ -425,6 +429,7 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
public QSTile tile;
public com.android.systemui.plugins.qs.QSTileView tileView;
public boolean scanState;
@Nullable
public QSTile.Callback callback;
}
}

View File

@@ -20,6 +20,7 @@ import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
import android.annotation.MainThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
@@ -81,6 +82,7 @@ public class QSCarrierGroupController {
private final CarrierConfigTracker mCarrierConfigTracker;
private boolean mIsSingleCarrier;
@Nullable
private OnSingleCarrierChangedListener mOnSingleCarrierChangedListener;
private final SlotIndexResolver mSlotIndexResolver;
@@ -294,7 +296,8 @@ public class QSCarrierGroupController {
* This will get notified when the number of carriers changes between 1 and "not one".
* @param listener
*/
public void setOnSingleCarrierChangedListener(OnSingleCarrierChangedListener listener) {
public void setOnSingleCarrierChangedListener(
@Nullable OnSingleCarrierChangedListener listener) {
mOnSingleCarrierChangedListener = listener;
}

View File

@@ -96,15 +96,20 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
private int mFocusIndex;
private boolean mNeedsFocus;
@Nullable
private List<String> mCurrentSpecs;
@Nullable
private List<TileInfo> mOtherTiles;
@Nullable
private List<TileInfo> mAllTiles;
@Nullable
private Holder mCurrentDrag;
private int mAccessibilityAction = ACTION_NONE;
private int mAccessibilityFromIndex;
private final UiEventLogger mUiEventLogger;
private final AccessibilityDelegateCompat mAccessibilityDelegate;
@Nullable
private RecyclerView mRecyclerView;
private int mNumColumns;
@@ -240,6 +245,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
notifyDataSetChanged();
}
@Nullable
private TileInfo getAndRemoveOther(String s) {
for (int i = 0; i < mOtherTiles.size(); i++) {
if (mOtherTiles.get(i).spec.equals(s)) {
@@ -555,7 +561,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
}
public class Holder extends ViewHolder {
private QSTileViewImpl mTileView;
@Nullable private QSTileViewImpl mTileView;
public Holder(View itemView) {
super(itemView);

View File

@@ -17,6 +17,7 @@ package com.android.systemui.qs.tileimpl;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
@@ -49,6 +50,7 @@ public class QSIconViewImpl extends QSIconView {
private boolean mAnimationEnabled = true;
private int mState = -1;
private int mTint;
@Nullable
private QSTile.Icon mLastIcon;
public QSIconViewImpl(Context context) {

View File

@@ -316,5 +316,5 @@ public class CastTile extends QSTileImpl<BooleanState> {
public void onKeyguardShowingChanged() {
refreshState();
}
};
}
}