From 40aa8811bc817293d7400c14fa60350d2350d29f Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Wed, 23 Sep 2015 12:59:22 -0700 Subject: Deliver camera launch source for analytics Bug: 24304031 Change-Id: I606bccf4b62b651e17c6e6d9472648deeab703da --- .../core/java/com/android/server/GestureLauncherService.java | 11 +++++++---- .../android/server/statusbar/StatusBarManagerInternal.java | 2 +- .../com/android/server/statusbar/StatusBarManagerService.java | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/GestureLauncherService.java b/services/core/java/com/android/server/GestureLauncherService.java index 7c85001..f245985 100644 --- a/services/core/java/com/android/server/GestureLauncherService.java +++ b/services/core/java/com/android/server/GestureLauncherService.java @@ -17,6 +17,7 @@ package com.android.server; import android.app.ActivityManager; +import android.app.StatusBarManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -263,7 +264,8 @@ public class GestureLauncherService extends SystemService { } if (launched) { Slog.i(TAG, "Power button double tap gesture detected, launching camera."); - launched = handleCameraLaunchGesture(false /* useWakelock */); + launched = handleCameraLaunchGesture(false /* useWakelock */, + StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP); if (launched) { MetricsLogger.action(mContext, MetricsLogger.ACTION_DOUBLE_TAP_POWER_CAMERA_GESTURE, (int) doubleTapInterval); @@ -276,7 +278,7 @@ public class GestureLauncherService extends SystemService { /** * @return true if camera was launched, false otherwise. */ - private boolean handleCameraLaunchGesture(boolean useWakelock) { + private boolean handleCameraLaunchGesture(boolean useWakelock, int source) { boolean userSetupComplete = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0) != 0; if (!userSetupComplete) { @@ -295,7 +297,7 @@ public class GestureLauncherService extends SystemService { } StatusBarManagerInternal service = LocalServices.getService( StatusBarManagerInternal.class); - service.onCameraLaunchGestureDetected(); + service.onCameraLaunchGestureDetected(source); return true; } @@ -334,7 +336,8 @@ public class GestureLauncherService extends SystemService { Slog.d(TAG, String.format("Received a camera launch event: " + "values=[%.4f, %.4f, %.4f].", values[0], values[1], values[2])); } - if (handleCameraLaunchGesture(true /* useWakelock */)) { + if (handleCameraLaunchGesture(true /* useWakelock */, + StatusBarManager.CAMERA_LAUNCH_SOURCE_WIGGLE)) { MetricsLogger.action(mContext, MetricsLogger.ACTION_WIGGLE_CAMERA_GESTURE); trackCameraLaunchEvent(event); } diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java index 5d01931..25d646d 100644 --- a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java +++ b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java @@ -28,5 +28,5 @@ public interface StatusBarManagerInternal { void showScreenPinningRequest(); void showAssistDisclosure(); void startAssist(Bundle args); - void onCameraLaunchGestureDetected(); + void onCameraLaunchGestureDetected(int source); } diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java index 0fb1169..e9ace29 100644 --- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java +++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java @@ -178,10 +178,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub { } @Override - public void onCameraLaunchGestureDetected() { + public void onCameraLaunchGestureDetected(int source) { if (mBar != null) { try { - mBar.onCameraLaunchGestureDetected(); + mBar.onCameraLaunchGestureDetected(source); } catch (RemoteException e) { } } -- cgit v1.1