summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2018-03-01 00:50:45 -0800
committerCopybara-Service <copybara-piper@google.com>2018-03-01 08:28:30 -0800
commitf127d3caf505af76738e1f9c58695b4529ef023f (patch)
tree096b99d0847f821b8a6b3d892e5dd04e02af1905 /java
parent4865a35f4b6eb3c0f987ac0917ee2a775429e447 (diff)
Added same primes metrics that existed in Dialtacts to NUI.
Test: n/a PiperOrigin-RevId: 187442952 Change-Id: I9463e2c976102276ebc5886531397ad0cf160b78
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/main/impl/OldMainActivityPeer.java11
-rw-r--r--java/com/android/dialer/metrics/Metrics.java2
2 files changed, 13 insertions, 0 deletions
diff --git a/java/com/android/dialer/main/impl/OldMainActivityPeer.java b/java/com/android/dialer/main/impl/OldMainActivityPeer.java
index 293ec9563..8af41a8a6 100644
--- a/java/com/android/dialer/main/impl/OldMainActivityPeer.java
+++ b/java/com/android/dialer/main/impl/OldMainActivityPeer.java
@@ -65,6 +65,7 @@ import com.android.dialer.callintent.CallSpecificAppData;
import com.android.dialer.common.FragmentUtils.FragmentUtilListener;
import com.android.dialer.common.LogUtil;
import com.android.dialer.common.concurrent.DialerExecutorComponent;
+import com.android.dialer.common.concurrent.ThreadUtil;
import com.android.dialer.common.concurrent.UiListener;
import com.android.dialer.compat.CompatUtils;
import com.android.dialer.configprovider.ConfigProviderBindings;
@@ -87,6 +88,8 @@ import com.android.dialer.main.impl.bottomnav.BottomNavBar;
import com.android.dialer.main.impl.bottomnav.BottomNavBar.OnBottomNavTabSelectedListener;
import com.android.dialer.main.impl.bottomnav.BottomNavBar.TabIndex;
import com.android.dialer.main.impl.toolbar.MainToolbar;
+import com.android.dialer.metrics.Metrics;
+import com.android.dialer.metrics.MetricsComponent;
import com.android.dialer.postcall.PostCall;
import com.android.dialer.precall.PreCall;
import com.android.dialer.searchfragment.list.NewSearchFragment.SearchFragmentListener;
@@ -404,6 +407,14 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
} else {
bottomNav.setVisibility(View.VISIBLE);
}
+
+ // add 1 sec delay to get memory snapshot so that dialer wont react slowly on resume.
+ ThreadUtil.postDelayedOnUiThread(
+ () ->
+ MetricsComponent.get(mainActivity)
+ .metrics()
+ .recordMemory(Metrics.OLD_MAIN_ACTIVITY_PEER_ON_RESUME_MEMORY_EVENT_NAME),
+ 1000);
}
@Override
diff --git a/java/com/android/dialer/metrics/Metrics.java b/java/com/android/dialer/metrics/Metrics.java
index 383b3a3f3..b460f3ecf 100644
--- a/java/com/android/dialer/metrics/Metrics.java
+++ b/java/com/android/dialer/metrics/Metrics.java
@@ -23,11 +23,13 @@ public interface Metrics {
String APPLICATION_ON_CREATE_EVENT_NAME = "Application.onCreate";
String DIALTACTS_ON_CREATE_EVENT_NAME = "GoogleDialtactsActivity.onCreate";
+ String MAIN_ACTIVITY_ON_CREATE_EVENT_NAME = "GoogleMainActivity.onCreate";
String ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING =
"CallList.onCallAdded_To_InCallActivity.onCreate_Incoming";
String ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING =
"CallList.onCallAdded_To_InCallActivity.onCreate_Outgoing";
String DIALTACTS_ON_RESUME_MEMORY_EVENT_NAME = "GoogleDialtactsActivity.onResume";
+ String OLD_MAIN_ACTIVITY_PEER_ON_RESUME_MEMORY_EVENT_NAME = "OldMainActivityPeer.onResume";
String INCALL_ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME = "IncallActivity.OnResume";
String INCALL_ACTIVITY_ON_STOP_MEMORY_EVENT_NAME = "IncallActivity.OnStop";
String OLD_CALL_LOG_JANK_EVENT_NAME = "OldCallLog.Jank";