Merge "Add tracepoint for gesture navigation launching the camera" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c543913a79
@@ -35,6 +35,7 @@ import android.os.PowerManager;
|
||||
import android.os.PowerManager.WakeLock;
|
||||
import android.os.SystemClock;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.Trace;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.util.MutableBoolean;
|
||||
@@ -404,26 +405,35 @@ public class GestureLauncherService extends SystemService {
|
||||
*/
|
||||
@VisibleForTesting
|
||||
boolean handleCameraGesture(boolean useWakelock, int source) {
|
||||
boolean userSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||
Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
|
||||
if (!userSetupComplete) {
|
||||
if (DBG) Slog.d(TAG, String.format(
|
||||
"userSetupComplete = %s, ignoring camera gesture.",
|
||||
userSetupComplete));
|
||||
return false;
|
||||
}
|
||||
if (DBG) Slog.d(TAG, String.format(
|
||||
"userSetupComplete = %s, performing camera gesture.",
|
||||
userSetupComplete));
|
||||
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "GestureLauncher:handleCameraGesture");
|
||||
try {
|
||||
boolean userSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||
Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
|
||||
if (!userSetupComplete) {
|
||||
if (DBG) {
|
||||
Slog.d(TAG, String.format(
|
||||
"userSetupComplete = %s, ignoring camera gesture.",
|
||||
userSetupComplete));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (DBG) {
|
||||
Slog.d(TAG, String.format(
|
||||
"userSetupComplete = %s, performing camera gesture.",
|
||||
userSetupComplete));
|
||||
}
|
||||
|
||||
if (useWakelock) {
|
||||
// Make sure we don't sleep too early
|
||||
mWakeLock.acquire(500L);
|
||||
if (useWakelock) {
|
||||
// Make sure we don't sleep too early
|
||||
mWakeLock.acquire(500L);
|
||||
}
|
||||
StatusBarManagerInternal service = LocalServices.getService(
|
||||
StatusBarManagerInternal.class);
|
||||
service.onCameraLaunchGestureDetected(source);
|
||||
return true;
|
||||
} finally {
|
||||
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
|
||||
}
|
||||
StatusBarManagerInternal service = LocalServices.getService(
|
||||
StatusBarManagerInternal.class);
|
||||
service.onCameraLaunchGestureDetected(source);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final BroadcastReceiver mUserReceiver = new BroadcastReceiver() {
|
||||
|
||||
Reference in New Issue
Block a user