Merge "Add QSlog for the background color change of the Internet Tile" into tm-qpr-dev
This commit is contained in:
@@ -25,6 +25,7 @@ import android.content.ComponentName;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Configuration.Orientation;
|
import android.content.res.Configuration.Orientation;
|
||||||
import android.metrics.LogMaker;
|
import android.metrics.LogMaker;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
@@ -38,6 +39,7 @@ import com.android.systemui.plugins.qs.QSTileView;
|
|||||||
import com.android.systemui.qs.customize.QSCustomizerController;
|
import com.android.systemui.qs.customize.QSCustomizerController;
|
||||||
import com.android.systemui.qs.external.CustomTile;
|
import com.android.systemui.qs.external.CustomTile;
|
||||||
import com.android.systemui.qs.logging.QSLogger;
|
import com.android.systemui.qs.logging.QSLogger;
|
||||||
|
import com.android.systemui.qs.tileimpl.QSTileViewImpl;
|
||||||
import com.android.systemui.util.LargeScreenUtils;
|
import com.android.systemui.util.LargeScreenUtils;
|
||||||
import com.android.systemui.util.ViewController;
|
import com.android.systemui.util.ViewController;
|
||||||
import com.android.systemui.util.animation.DisappearParameters;
|
import com.android.systemui.util.animation.DisappearParameters;
|
||||||
@@ -237,6 +239,16 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
|
|||||||
private void addTile(final QSTile tile, boolean collapsedView) {
|
private void addTile(final QSTile tile, boolean collapsedView) {
|
||||||
final TileRecord r =
|
final TileRecord r =
|
||||||
new TileRecord(tile, mHost.createTileView(getContext(), tile, collapsedView));
|
new TileRecord(tile, mHost.createTileView(getContext(), tile, collapsedView));
|
||||||
|
// TODO(b/250618218): Remove the QSLogger in QSTileViewImpl once we know the root cause of
|
||||||
|
// b/250618218.
|
||||||
|
try {
|
||||||
|
QSTileViewImpl qsTileView = (QSTileViewImpl) (r.tileView);
|
||||||
|
if (qsTileView != null) {
|
||||||
|
qsTileView.setQsLogger(mQSLogger);
|
||||||
|
}
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
Log.e(TAG, "Failed to cast QSTileView to QSTileViewImpl", e);
|
||||||
|
}
|
||||||
mView.addTile(r);
|
mView.addTile(r);
|
||||||
mRecords.add(r);
|
mRecords.add(r);
|
||||||
mCachedSpecs = getTilesSpecs();
|
mCachedSpecs = getTilesSpecs();
|
||||||
|
|||||||
@@ -129,12 +129,36 @@ class QSLogger @Inject constructor(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun logInternetTileUpdate(lastType: Int, callback: String) {
|
fun logInternetTileUpdate(tileSpec: String, lastType: Int, callback: String) {
|
||||||
log(VERBOSE, {
|
log(VERBOSE, {
|
||||||
|
str1 = tileSpec
|
||||||
int1 = lastType
|
int1 = lastType
|
||||||
str1 = callback
|
str2 = callback
|
||||||
}, {
|
}, {
|
||||||
"mLastTileState=$int1, Callback=$str1."
|
"[$str1] mLastTileState=$int1, Callback=$str2."
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(b/250618218): Remove this method once we know the root cause of b/250618218.
|
||||||
|
fun logTileBackgroundColorUpdateIfInternetTile(
|
||||||
|
tileSpec: String,
|
||||||
|
state: Int,
|
||||||
|
disabledByPolicy: Boolean,
|
||||||
|
color: Int
|
||||||
|
) {
|
||||||
|
// This method is added to further debug b/250618218 which has only been observed from the
|
||||||
|
// InternetTile, so we are only logging the background color change for the InternetTile
|
||||||
|
// to avoid spamming the QSLogger.
|
||||||
|
if (tileSpec != "internet") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log(VERBOSE, {
|
||||||
|
str1 = tileSpec
|
||||||
|
int1 = state
|
||||||
|
bool1 = disabledByPolicy
|
||||||
|
int2 = color
|
||||||
|
}, {
|
||||||
|
"[$str1] state=$int1, disabledByPolicy=$bool1, color=$int2."
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import com.android.systemui.plugins.qs.QSIconView
|
|||||||
import com.android.systemui.plugins.qs.QSTile
|
import com.android.systemui.plugins.qs.QSTile
|
||||||
import com.android.systemui.plugins.qs.QSTile.BooleanState
|
import com.android.systemui.plugins.qs.QSTile.BooleanState
|
||||||
import com.android.systemui.plugins.qs.QSTileView
|
import com.android.systemui.plugins.qs.QSTileView
|
||||||
|
import com.android.systemui.qs.logging.QSLogger
|
||||||
import com.android.systemui.qs.tileimpl.QSIconViewImpl.QS_ANIM_LENGTH
|
import com.android.systemui.qs.tileimpl.QSIconViewImpl.QS_ANIM_LENGTH
|
||||||
import java.util.Objects
|
import java.util.Objects
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
protected lateinit var sideView: ViewGroup
|
protected lateinit var sideView: ViewGroup
|
||||||
private lateinit var customDrawableView: ImageView
|
private lateinit var customDrawableView: ImageView
|
||||||
private lateinit var chevronView: ImageView
|
private lateinit var chevronView: ImageView
|
||||||
|
private var mQsLogger: QSLogger? = null
|
||||||
protected var showRippleEffect = true
|
protected var showRippleEffect = true
|
||||||
|
|
||||||
private lateinit var ripple: RippleDrawable
|
private lateinit var ripple: RippleDrawable
|
||||||
@@ -188,6 +189,10 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
updateHeight()
|
updateHeight()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setQsLogger(qsLogger: QSLogger) {
|
||||||
|
mQsLogger = qsLogger
|
||||||
|
}
|
||||||
|
|
||||||
fun updateResources() {
|
fun updateResources() {
|
||||||
FontSizeUtils.updateFontSize(label, R.dimen.qs_tile_text_size)
|
FontSizeUtils.updateFontSize(label, R.dimen.qs_tile_text_size)
|
||||||
FontSizeUtils.updateFontSize(secondaryLabel, R.dimen.qs_tile_text_size)
|
FontSizeUtils.updateFontSize(secondaryLabel, R.dimen.qs_tile_text_size)
|
||||||
@@ -493,6 +498,11 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
// Colors
|
// Colors
|
||||||
if (state.state != lastState || state.disabledByPolicy || lastDisabledByPolicy) {
|
if (state.state != lastState || state.disabledByPolicy || lastDisabledByPolicy) {
|
||||||
singleAnimator.cancel()
|
singleAnimator.cancel()
|
||||||
|
mQsLogger?.logTileBackgroundColorUpdateIfInternetTile(
|
||||||
|
state.spec,
|
||||||
|
state.state,
|
||||||
|
state.disabledByPolicy,
|
||||||
|
getBackgroundColorForState(state.state, state.disabledByPolicy))
|
||||||
if (allowAnimations) {
|
if (allowAnimations) {
|
||||||
singleAnimator.setValues(
|
singleAnimator.setValues(
|
||||||
colorValuesHolder(
|
colorValuesHolder(
|
||||||
|
|||||||
@@ -383,7 +383,8 @@ public class InternetTile extends QSTileImpl<SignalState> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleUpdateState(SignalState state, Object arg) {
|
protected void handleUpdateState(SignalState state, Object arg) {
|
||||||
mQSLogger.logInternetTileUpdate(mLastTileState, arg == null ? "null" : arg.toString());
|
mQSLogger.logInternetTileUpdate(
|
||||||
|
getTileSpec(), mLastTileState, arg == null ? "null" : arg.toString());
|
||||||
if (arg instanceof CellularCallbackInfo) {
|
if (arg instanceof CellularCallbackInfo) {
|
||||||
mLastTileState = 0;
|
mLastTileState = 0;
|
||||||
handleUpdateCellularState(state, arg);
|
handleUpdateCellularState(state, arg);
|
||||||
|
|||||||
Reference in New Issue
Block a user