am aaf68f21: Merge "instrument emergency call button" into mnc-dev

* commit 'aaf68f216327a8a2adaf72032904b50796b4aea7':
  instrument emergency call button
This commit is contained in:
Chris Wren
2015-06-08 16:44:04 +00:00
committed by Android Git Automerger
2 changed files with 3 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ import android.view.View;
*/
public class MetricsLogger implements MetricsConstants {
// Temporary constants go here, to await migration to MetricsConstants.
public static final int ACTION_EMERGENCY_CALL = 200;
public static void visible(Context context, int category) throws IllegalArgumentException {
if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {

View File

@@ -28,6 +28,7 @@ import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.telephony.IccCardConstants.State;
import com.android.internal.widget.LockPatternUtils;
@@ -116,6 +117,7 @@ public class EmergencyButton extends Button {
* Shows the emergency dialer or returns the user to the existing call.
*/
public void takeEmergencyCallAction() {
MetricsLogger.action(mContext, MetricsLogger.ACTION_EMERGENCY_CALL);
// TODO: implement a shorter timeout once new PowerManager API is ready.
// should be the equivalent to the old userActivity(EMERGENCY_CALL_TIMEOUT)
mPowerManager.userActivity(SystemClock.uptimeMillis(), true);