summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-07-26 02:40:22 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-07-26 02:40:22 +0000
commitfe841f1c63516a621fb14284c856fa4bd8634c2e (patch)
tree4fdc8f5287056ebef2e5314dbfa1a45a68585024 /services
parent6469c41f09844fbcb7f6509e9b41493d04671324 (diff)
parentc87382a8605a172f0abcb760def4cd60be5d4e7b (diff)
downloadframeworks_base-fe841f1c63516a621fb14284c856fa4bd8634c2e.zip
frameworks_base-fe841f1c63516a621fb14284c856fa4bd8634c2e.tar.gz
frameworks_base-fe841f1c63516a621fb14284c856fa4bd8634c2e.tar.bz2
am 32019e7e: am dab2b29b: Merge "Don\'t suppress haptic feedback on keyguard anymore." into lmp-dev
* commit '32019e7e463565977bd29715e4a9e357c61d8a29': Don't suppress haptic feedback on keyguard anymore.
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/VibratorService.java23
1 files changed, 21 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java
index 248a303..20f6f1c 100644
--- a/services/core/java/com/android/server/VibratorService.java
+++ b/services/core/java/com/android/server/VibratorService.java
@@ -55,6 +55,7 @@ import java.util.ListIterator;
public class VibratorService extends IVibratorService.Stub
implements InputManager.InputDeviceListener {
private static final String TAG = "VibratorService";
+ private static final boolean DEBUG = false;
private final LinkedList<Vibration> mVibrations;
private Vibration mCurrentVibration;
@@ -205,6 +206,7 @@ public class VibratorService extends IVibratorService.Stub
}
}
+ @Override // Binder call
public boolean hasVibrator() {
return doVibratorExists();
}
@@ -220,6 +222,7 @@ public class VibratorService extends IVibratorService.Stub
Binder.getCallingPid(), Binder.getCallingUid(), null);
}
+ @Override // Binder call
public void vibrate(int uid, String opPkg, long milliseconds, int usageHint,
IBinder token) {
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.VIBRATE)
@@ -237,6 +240,10 @@ public class VibratorService extends IVibratorService.Stub
return;
}
+ if (DEBUG) {
+ Slog.d(TAG, "Vibrating for " + milliseconds + " ms.");
+ }
+
Vibration vib = new Vibration(token, milliseconds, usageHint, uid, opPkg);
final long ident = Binder.clearCallingIdentity();
@@ -262,6 +269,7 @@ public class VibratorService extends IVibratorService.Stub
return true;
}
+ @Override // Binder call
public void vibratePattern(int uid, String packageName, long[] pattern, int repeat,
int usageHint, IBinder token) {
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.VIBRATE)
@@ -272,13 +280,13 @@ public class VibratorService extends IVibratorService.Stub
// so wakelock calls will succeed
long identity = Binder.clearCallingIdentity();
try {
- if (false) {
+ if (DEBUG) {
String s = "";
int N = pattern.length;
for (int i=0; i<N; i++) {
s += " " + pattern[i];
}
- Slog.i(TAG, "vibrating with pattern: " + s);
+ Slog.d(TAG, "Vibrating with pattern:" + s);
}
// we're running in the server so we can't fail
@@ -314,6 +322,7 @@ public class VibratorService extends IVibratorService.Stub
}
}
+ @Override // Binder call
public void cancelVibrate(IBinder token) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.VIBRATE,
@@ -325,6 +334,9 @@ public class VibratorService extends IVibratorService.Stub
synchronized (mVibrations) {
final Vibration vib = removeVibrationLocked(token);
if (vib == mCurrentVibration) {
+ if (DEBUG) {
+ Slog.d(TAG, "Canceling vibration.");
+ }
doCancelVibrateLocked();
startNextVibrationLocked();
}
@@ -336,6 +348,7 @@ public class VibratorService extends IVibratorService.Stub
}
private final Runnable mVibrationRunnable = new Runnable() {
+ @Override
public void run() {
synchronized (mVibrations) {
doCancelVibrateLocked();
@@ -516,6 +529,9 @@ public class VibratorService extends IVibratorService.Stub
private void doVibratorOn(long millis, int uid, int usageHint) {
synchronized (mInputDeviceVibrators) {
+ if (DEBUG) {
+ Slog.d(TAG, "Turning vibrator on for " + millis + " ms.");
+ }
try {
mBatteryStatsService.noteVibratorOn(uid, millis);
mCurVibUid = uid;
@@ -536,6 +552,9 @@ public class VibratorService extends IVibratorService.Stub
private void doVibratorOff() {
synchronized (mInputDeviceVibrators) {
+ if (DEBUG) {
+ Slog.d(TAG, "Turning vibrator off.");
+ }
if (mCurVibUid >= 0) {
try {
mBatteryStatsService.noteVibratorOff(mCurVibUid);