resolve merge conflicts of e45b35d186595cccb035a00d6e4c2f4bee23a507 to pi-dev-plus-aosp
Change-Id: Ice8f3c6c64a137391d116f69ba4c32347ffea17b
diff --git a/src/com/android/phone/NetworkSelectListPreference.java b/src/com/android/phone/NetworkSelectListPreference.java
index 4bb03b0..94d2786 100644
--- a/src/com/android/phone/NetworkSelectListPreference.java
+++ b/src/com/android/phone/NetworkSelectListPreference.java
@@ -19,7 +19,6 @@
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
-import android.metrics.LogMaker;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
@@ -90,7 +89,6 @@
@Override
protected void onClick() {
- sendMetricsEvent(null);
// Start the one-time network scan via {@link Phone#getAvailableNetworks()}.
// {@link NetworkQueryService will return a {@link onResults()} callback first with a list
// of CellInfo, and then will return a {@link onComplete} indicating the scan completed.
@@ -393,7 +391,8 @@
mCellInfo = mCellInfoList.get(operatorIndex);
if (DBG) logd("selected network: " + mCellInfo.toString());
- sendMetricsEvent(getNetworkTitle(mCellInfo));
+ MetricsLogger.action(getContext(),
+ MetricsEvent.ACTION_MOBILE_NETWORK_MANUAL_SELECT_NETWORK);
Message msg = mHandler.obtainMessage(EVENT_NETWORK_SELECTION_DONE);
Phone phone = PhoneFactory.getPhone(mPhoneId);
@@ -554,21 +553,6 @@
};
}
- private void sendMetricsEvent(String network) {
- final LogMaker logMaker =
- new LogMaker(MetricsEvent.ACTION_MOBILE_NETWORK_MANUAL_SELECT_NETWORK)
- .setType(MetricsEvent.TYPE_ACTION);
-
- if (network != null) {
- // Since operator list is loaded dynamically from modem, we cannot know which network
- // user chooses if we only record integer index of newValue. So a new tag and a string
- // value (network) is added in this MetricsEvent.
- logMaker.addTaggedData(MetricsEvent.FIELD_MOBILE_NETWORK, network);
- }
-
- MetricsLogger.action(logMaker);
- }
-
private void logd(String msg) {
Log.d(LOG_TAG, "[NetworksList] " + msg);
}
@@ -576,4 +560,4 @@
private void loge(String msg) {
Log.e(LOG_TAG, "[NetworksList] " + msg);
}
-}
\ No newline at end of file
+}
diff --git a/src/com/android/phone/NetworkSelectSetting.java b/src/com/android/phone/NetworkSelectSetting.java
index ff918e2..efa8684 100644
--- a/src/com/android/phone/NetworkSelectSetting.java
+++ b/src/com/android/phone/NetworkSelectSetting.java
@@ -21,7 +21,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
-import android.metrics.LogMaker;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
@@ -45,7 +44,7 @@
import android.view.ViewGroup;
import com.android.internal.logging.MetricsLogger;
-import com.android.internal.logging.nano.MetricsProto;
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.OperatorInfo;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
@@ -184,17 +183,8 @@
if (DBG) logd("User click a NetworkOperatorPreference: " + cellInfo.toString());
// Send metrics event
- final LogMaker logMaker = new LogMaker(
- MetricsProto.MetricsEvent.ACTION_MOBILE_NETWORK_MANUAL_SELECT_NETWORK)
- .setType(MetricsProto.MetricsEvent.TYPE_ACTION);
- if (CellInfoUtil.getNetworkTitle(cellInfo) != null) {
- // Since operator list is loaded dynamically from modem, we cannot know which
- // network user chooses if we only record integer index of newValue. So a new tag
- // and a string value (network) is added in this MetricsEvent.
- logMaker.addTaggedData(MetricsProto.MetricsEvent.FIELD_MOBILE_NETWORK,
- CellInfoUtil.getNetworkTitle(cellInfo));
- }
- MetricsLogger.action(logMaker);
+ MetricsLogger.action(getContext(),
+ MetricsEvent.ACTION_MOBILE_NETWORK_MANUAL_SELECT_NETWORK);
// Connect to the network
Message msg = mHandler.obtainMessage(EVENT_NETWORK_SELECTION_DONE);