Added logging to pinpoint source of bug

Sometimes the airplane mode banner will show up even
though airplane mode is not on. Logging has been added
to several areas around this condition in addition to
where the actual view is created. This will be used
to try and get a better handle on what the source of
the bug is.

Test: manual
Bug: 30860132
Change-Id: I7213aa7e187c5a8c0e94a5ce7a3269e6667cd61b
This commit is contained in:
Salvador Martinez
2016-11-29 10:36:12 -08:00
parent b305ec6762
commit 179e16445e
5 changed files with 27 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import android.animation.ObjectAnimator;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import android.util.Log;
import android.view.View;
import android.view.View.OnLayoutChangeListener;
import android.view.ViewGroup.LayoutParams;
@@ -31,8 +32,10 @@ import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardAdapter;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.WirelessUtils;
public class ConditionAdapterUtils {
private static final String TAG = "ConditionAdapterUtils";
public static void addDismiss(final RecyclerView recyclerView) {
ItemTouchHelper.SimpleCallback callback = new ItemTouchHelper.SimpleCallback(0,
@@ -65,6 +68,11 @@ public class ConditionAdapterUtils {
public static void bindViews(final Condition condition,
DashboardAdapter.DashboardItemHolder view, boolean isExpanded,
View.OnClickListener onClickListener, View.OnClickListener onExpandListener) {
if (condition instanceof AirplaneModeCondition) {
Log.d(TAG, "Airplane mode condition has been bound with "
+ "isActive=" + condition.isActive() + ". Airplane mode is currently " +
WirelessUtils.isAirplaneModeOn(condition.mManager.getContext()));
}
View card = view.itemView.findViewById(R.id.content);
card.setTag(condition);
card.setOnClickListener(onClickListener);