am cd38c32d: Merge "Catch exception of nonfound activities" into jb-mr1-aah-dev

* commit 'cd38c32d85c13fde87ca7bee501cbe35230078b6':
  Catch exception of nonfound activities
This commit is contained in:
Justin Koh
2012-11-08 15:43:34 -08:00
committed by Android Git Automerger

View File

@@ -16,12 +16,14 @@
package android.view;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Handler;
import android.os.Handler.Callback;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.util.Log;
/**
* This class creates trackball events from touchpad events.
@@ -30,6 +32,8 @@ import android.os.SystemProperties;
*/
class SimulatedTrackball {
private static final String TAG = "SimulatedTrackball";
// Maximum difference in milliseconds between the down and up of a touch
// event for it to be considered a tap
// TODO:Read this value from a configuration file
@@ -159,7 +163,11 @@ class SimulatedTrackball {
mEdgeSwipePossible = false;
Intent intent = new Intent("android.search.action.GLOBAL_SEARCH");
intent.addCategory("android.intent.category.DEFAULT");
viewroot.mView.getContext().startActivity(intent);
try {
viewroot.mView.getContext().startActivity(intent);
} catch (ActivityNotFoundException e) {
Log.e(TAG,"Search activity not found.");
}
}
// Find the difference in position between the two most recent
// touchpad events