diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-09-25 01:27:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-09-25 01:27:05 +0000 |
commit | ad26dc5f15d6ac13741ad8724c25ef8c58e73e81 (patch) | |
tree | a9de38e81cee9adf835c517ea638140321d8f634 /services | |
parent | cb13da9772b41c3466c3ed514e6321c2cfb85c2a (diff) | |
parent | 40aa8811bc817293d7400c14fa60350d2350d29f (diff) | |
download | frameworks_base-ad26dc5f15d6ac13741ad8724c25ef8c58e73e81.zip frameworks_base-ad26dc5f15d6ac13741ad8724c25ef8c58e73e81.tar.gz frameworks_base-ad26dc5f15d6ac13741ad8724c25ef8c58e73e81.tar.bz2 |
Merge "Deliver camera launch source for analytics" into mnc-dr-dev
Diffstat (limited to 'services')
3 files changed, 10 insertions, 7 deletions
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) { } } |