Merge "Fix Vibrator permission CTS test broken earlier." into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
987e8d7f97
@@ -50,7 +50,7 @@ public class Vibrator
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
mService.vibrate(milliseconds, mToken);
|
mService.vibrate(milliseconds, mToken);
|
||||||
} catch (Exception e) {
|
} catch (RemoteException e) {
|
||||||
Log.w(TAG, "Failed to vibrate.", e);
|
Log.w(TAG, "Failed to vibrate.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,7 @@ public class Vibrator
|
|||||||
if (repeat < pattern.length) {
|
if (repeat < pattern.length) {
|
||||||
try {
|
try {
|
||||||
mService.vibratePattern(pattern, repeat, mToken);
|
mService.vibratePattern(pattern, repeat, mToken);
|
||||||
} catch (Exception e) {
|
} catch (RemoteException e) {
|
||||||
Log.w(TAG, "Failed to vibrate.", e);
|
Log.w(TAG, "Failed to vibrate.", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -360,7 +360,13 @@ public final class ShutdownThread extends Thread {
|
|||||||
} else if (SHUTDOWN_VIBRATE_MS > 0) {
|
} else if (SHUTDOWN_VIBRATE_MS > 0) {
|
||||||
// vibrate before shutting down
|
// vibrate before shutting down
|
||||||
Vibrator vibrator = new Vibrator();
|
Vibrator vibrator = new Vibrator();
|
||||||
vibrator.vibrate(SHUTDOWN_VIBRATE_MS);
|
try {
|
||||||
|
vibrator.vibrate(SHUTDOWN_VIBRATE_MS);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Failure to vibrate shouldn't interrupt shutdown. Just log it.
|
||||||
|
Log.w(TAG, "Failed to vibrate during shutdown.", e);
|
||||||
|
}
|
||||||
|
|
||||||
// vibrator is asynchronous so we need to wait to avoid shutting down too soon.
|
// vibrator is asynchronous so we need to wait to avoid shutting down too soon.
|
||||||
try {
|
try {
|
||||||
Thread.sleep(SHUTDOWN_VIBRATE_MS);
|
Thread.sleep(SHUTDOWN_VIBRATE_MS);
|
||||||
|
|||||||
Reference in New Issue
Block a user