blob: 531a1c7c69dce2b76156c070288bf677b6793a33 [file] [log] [blame]
The Android Open Source Project0c908882009-03-03 19:32:16 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Bijan Amirzada41242f22014-03-21 12:12:18 -070017package com.android.browser;
The Android Open Source Project0c908882009-03-03 19:32:16 -080018
The Android Open Source Project0c908882009-03-03 19:32:16 -080019import android.app.Activity;
John Reck7878f222012-04-18 16:23:14 -070020import android.app.KeyguardManager;
John Reck9d27ff52011-02-11 17:47:54 -080021import android.content.Context;
The Android Open Source Project0c908882009-03-03 19:32:16 -080022import android.content.Intent;
The Android Open Source Project0c908882009-03-03 19:32:16 -080023import android.content.res.Configuration;
The Android Open Source Project0c908882009-03-03 19:32:16 -080024import android.os.Bundle;
qqzhou8c5b0a32013-07-22 15:31:03 +080025import android.os.Handler;
John Reck7878f222012-04-18 16:23:14 -070026import android.os.PowerManager;
Axesh R. Ajmeracc280282015-03-25 16:31:03 -070027import android.os.Process;
The Android Open Source Project0c908882009-03-03 19:32:16 -080028import android.util.Log;
Leon Scroggins III8e4fbf12010-08-17 16:58:15 -040029import android.view.ActionMode;
The Android Open Source Project0c908882009-03-03 19:32:16 -080030import android.view.ContextMenu;
Michael Kolba2b2ba82010-08-04 17:54:03 -070031import android.view.ContextMenu.ContextMenuInfo;
The Android Open Source Project0c908882009-03-03 19:32:16 -080032import android.view.KeyEvent;
The Android Open Source Project0c908882009-03-03 19:32:16 -080033import android.view.Menu;
The Android Open Source Project0c908882009-03-03 19:32:16 -080034import android.view.MenuItem;
Michael Kolbc3af0672011-08-09 10:24:41 -070035import android.view.MotionEvent;
The Android Open Source Project0c908882009-03-03 19:32:16 -080036import android.view.View;
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -070037import android.view.ViewGroup;
38import android.view.ViewTreeObserver;
The Android Open Source Project0c908882009-03-03 19:32:16 -080039import android.view.Window;
The Android Open Source Project0c908882009-03-03 19:32:16 -080040
Vivek Sekhared791da2015-02-22 12:39:05 -080041import org.chromium.base.VisibleForTesting;
Bijan Amirzada41242f22014-03-21 12:12:18 -070042import com.android.browser.R;
Bijan Amirzada41242f22014-03-21 12:12:18 -070043import com.android.browser.search.DefaultSearchEngine;
44import com.android.browser.search.SearchEngine;
45import com.android.browser.stub.NullController;
Bijan Amirzada9b1e9882014-02-26 17:15:46 -080046
Axesh R. Ajmeracc280282015-03-25 16:31:03 -070047import java.util.Locale;
48
Dany Rybnikovc912c552015-01-19 15:40:13 +020049import org.codeaurora.swe.CookieManager;
Bijan Amirzada9b1e9882014-02-26 17:15:46 -080050import org.codeaurora.swe.WebView;
John Reckd3e4d5b2011-07-13 15:48:43 -070051
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -070052public class BrowserActivity extends Activity implements ViewTreeObserver.OnPreDrawListener {
The Android Open Source Project0c908882009-03-03 19:32:16 -080053
John Reck439c9a52010-12-14 10:04:39 -080054 public static final String ACTION_SHOW_BOOKMARKS = "show_bookmarks";
55 public static final String ACTION_SHOW_BROWSER = "show_browser";
John Reck63bb6872010-12-01 19:29:32 -080056 public static final String ACTION_RESTART = "--restart--";
57 private static final String EXTRA_STATE = "state";
John Reck38b39652012-06-05 09:22:59 -070058 public static final String EXTRA_DISABLE_URL_OVERRIDE = "disable_url_override";
John Reck63bb6872010-12-01 19:29:32 -080059
Michael Kolb8233fac2010-10-26 16:08:53 -070060 private final static String LOGTAG = "browser";
The Android Open Source Project0c908882009-03-03 19:32:16 -080061
John Reck6c2e2f32011-08-22 13:41:23 -070062 private final static boolean LOGV_ENABLED = Browser.LOGV_ENABLED;
Dave Bort31a6d1c2009-04-13 15:56:49 -070063
John Reck9c35b9c2012-05-30 10:08:50 -070064 private ActivityController mController = NullController.INSTANCE;
Bijan Amirzada9b1e9882014-02-26 17:15:46 -080065
qqzhou8c5b0a32013-07-22 15:31:03 +080066 private Handler mHandler = new Handler();
Axesh R. Ajmeracc280282015-03-25 16:31:03 -070067 private final Locale mCurrentLocale = Locale.getDefault();
Axesh R. Ajmera32558762015-04-23 13:21:56 -070068 public static boolean killOnExitDialog = false;
69
Jeff Davidson43610292010-07-16 16:03:58 -070070
kaiyizbb2db872013-08-01 22:24:07 -040071 private UiController mUiController;
72 private Handler mHandlerEx = new Handler();
73 private Runnable runnable = new Runnable() {
74 @Override
75 public void run() {
76 if (mUiController != null) {
77 WebView current = mUiController.getCurrentWebView();
78 if (current != null) {
79 current.postInvalidate();
80 }
81 }
82 }
83 };
84
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -070085 private Bundle mSavedInstanceState;
86 private EngineInitializer mEngineInitializer;
Bijan Amirzada9b1e9882014-02-26 17:15:46 -080087
Grace Kloba22ac16e2009-10-07 18:00:23 -070088 @Override
89 public void onCreate(Bundle icicle) {
Dave Bort31a6d1c2009-04-13 15:56:49 -070090 if (LOGV_ENABLED) {
John Reck6c2e2f32011-08-22 13:41:23 -070091 Log.v(LOGTAG, this + " onStart, has state: "
92 + (icicle == null ? "false" : "true"));
The Android Open Source Project0c908882009-03-03 19:32:16 -080093 }
94 super.onCreate(icicle);
Derek Sollenbergerffa561e2010-11-16 14:19:01 -050095
John Reck7878f222012-04-18 16:23:14 -070096 if (shouldIgnoreIntents()) {
97 finish();
98 return;
99 }
100
John Reckf57c0292011-07-21 18:15:39 -0700101 // If this was a web search request, pass it on to the default web
102 // search provider and finish this activity.
Bijan Amirzada41242f22014-03-21 12:12:18 -0700103 /*
kaiyiza2368f12013-09-02 10:43:31 +0800104 SearchEngine searchEngine = BrowserSettings.getInstance().getSearchEngine();
105 boolean result = IntentHandler.handleWebSearchIntent(this, null, getIntent());
106 if (result && (searchEngine instanceof DefaultSearchEngine)) {
John Reckf57c0292011-07-21 18:15:39 -0700107 finish();
108 return;
109 }
Bijan Amirzada41242f22014-03-21 12:12:18 -0700110 */
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700111
112 mEngineInitializer = EngineInitializer.getInstance();
113 mEngineInitializer.onActivityCreate(BrowserActivity.this);
114
115 Thread.setDefaultUncaughtExceptionHandler(new CrashLogExceptionHandler(this));
116
117 mSavedInstanceState = icicle;
118 // Create the initial UI views
John Reck9c35b9c2012-05-30 10:08:50 -0700119 mController = createController();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800120
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700121 // Workaround for the black screen flicker on SurfaceView creation
122 ViewGroup topLayout = (ViewGroup) findViewById(R.id.main_content);
123 topLayout.requestTransparentRegion(topLayout);
124
125 // Add pre-draw listener to start the controller after engine initialization.
126 final ViewTreeObserver observer = getWindow().getDecorView().getViewTreeObserver();
127 observer.addOnPreDrawListener(this);
128
129 mEngineInitializer.initializeResourceExtractor(this);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800130 }
131
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700132 @Override
133 public boolean onPreDraw()
134 {
135 final ViewTreeObserver observer = getWindow().getDecorView().getViewTreeObserver();
136 observer.removeOnPreDrawListener(this);
137 mEngineInitializer.onPreDraw();
138 return true;
139 }
140
141
John Recka5176f32011-05-17 12:35:37 -0700142 public static boolean isTablet(Context context) {
143 return context.getResources().getBoolean(R.bool.isTablet);
John Reck9d27ff52011-02-11 17:47:54 -0800144 }
145
John Reck9c35b9c2012-05-30 10:08:50 -0700146 private Controller createController() {
147 Controller controller = new Controller(this);
148 boolean xlarge = isTablet(this);
149 UI ui = null;
150 if (xlarge) {
kaiyizbb2db872013-08-01 22:24:07 -0400151 XLargeUi tablet = new XLargeUi(this, controller);
152 ui = tablet;
153 mUiController = tablet.getUiController();
John Reck9c35b9c2012-05-30 10:08:50 -0700154 } else {
kaiyizbb2db872013-08-01 22:24:07 -0400155 PhoneUi phone = new PhoneUi(this, controller);
156 ui = phone;
157 mUiController = phone.getUiController();
John Reck9c35b9c2012-05-30 10:08:50 -0700158 }
159 controller.setUi(ui);
160 return controller;
161 }
162
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700163 public void onEngineInitializationComplete() {
164 Intent intent = (mSavedInstanceState == null) ? getIntent() : null;
165 mController.start(intent);
166 }
167
John Reck41554852010-12-01 12:53:37 -0800168 @VisibleForTesting
Tarun Nainani436b8732014-06-10 13:58:41 -0700169 //public to facilitate testing
170 public Controller getController() {
John Reck9c35b9c2012-05-30 10:08:50 -0700171 return (Controller) mController;
Michael Kolba2b2ba82010-08-04 17:54:03 -0700172 }
173
The Android Open Source Project0c908882009-03-03 19:32:16 -0800174 @Override
175 protected void onNewIntent(Intent intent) {
John Reck7878f222012-04-18 16:23:14 -0700176 if (shouldIgnoreIntents()) return;
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700177 mEngineInitializer.onNewIntent(intent);
178 // Note: Do not add any more application logic in this method.
179 // Move any additional app logic into handleOnNewIntent().
180 }
181
182 protected void handleOnNewIntent(Intent intent) {
John Reck63bb6872010-12-01 19:29:32 -0800183 if (ACTION_RESTART.equals(intent.getAction())) {
184 Bundle outState = new Bundle();
John Reck1cf4b792011-07-26 10:22:22 -0700185 mController.onSaveInstanceState(outState);
John Reck63bb6872010-12-01 19:29:32 -0800186 finish();
187 getApplicationContext().startActivity(
188 new Intent(getApplicationContext(), BrowserActivity.class)
189 .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
190 .putExtra(EXTRA_STATE, outState));
191 return;
192 }
Michael Kolb8233fac2010-10-26 16:08:53 -0700193 mController.handleNewIntent(intent);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800194 }
195
John Reck7878f222012-04-18 16:23:14 -0700196 private KeyguardManager mKeyguardManager;
197 private PowerManager mPowerManager;
198 private boolean shouldIgnoreIntents() {
199 // Only process intents if the screen is on and the device is unlocked
200 // aka, if we will be user-visible
201 if (mKeyguardManager == null) {
202 mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
203 }
204 if (mPowerManager == null) {
205 mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
206 }
207 boolean ignore = !mPowerManager.isScreenOn();
208 ignore |= mKeyguardManager.inKeyguardRestrictedInputMode();
209 if (LOGV_ENABLED) {
210 Log.v(LOGTAG, "ignore intents: " + ignore);
211 }
212 return ignore;
213 }
214
Grace Kloba22ac16e2009-10-07 18:00:23 -0700215 @Override
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700216 protected void onStart() {
217 super.onStart();
218 mEngineInitializer.onActivityStart();
219 }
220
221 @Override
Grace Kloba22ac16e2009-10-07 18:00:23 -0700222 protected void onResume() {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800223 super.onResume();
Dave Bort31a6d1c2009-04-13 15:56:49 -0700224 if (LOGV_ENABLED) {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800225 Log.v(LOGTAG, "BrowserActivity.onResume: this=" + this);
226 }
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700227 mEngineInitializer.onActivityResume();
228 // Note: Do not add any more application logic in this method.
229 // Move any additional app logic into handleOnResume().
230 }
Tarun Nainanief749cb2014-05-19 18:16:53 -0700231
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700232 protected void handleOnResume() {
Tarun Nainanib4a173f2015-01-05 09:23:08 -0800233 // Note: Intentionally left blank.
234 }
235
236 protected void handleOnStart() {
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700237 mController.onResume();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800238 }
239
Leon Scrogginsa81a7642009-08-31 17:05:41 -0400240 @Override
Tarun Nainanib4a173f2015-01-05 09:23:08 -0800241 protected void onStop() {
242 mEngineInitializer.onActivityStop();
243 super.onStop();
244 // Note: Do not add any more application logic in this method.
245 // Move any additional app logic into handleOnStop().
246 }
247
248 @Override
Leon Scrogginsa81a7642009-08-31 17:05:41 -0400249 public boolean onMenuOpened(int featureId, Menu menu) {
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -0400250 if (Window.FEATURE_OPTIONS_PANEL == featureId) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700251 mController.onMenuOpened(featureId, menu);
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -0400252 }
Leon Scrogginsa81a7642009-08-31 17:05:41 -0400253 return true;
254 }
255
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -0400256 @Override
257 public void onOptionsMenuClosed(Menu menu) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700258 mController.onOptionsMenuClosed(menu);
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400259 }
260
Leon Scrogginsb2b19f52009-10-09 16:10:00 -0400261 @Override
262 public void onContextMenuClosed(Menu menu) {
263 super.onContextMenuClosed(menu);
Michael Kolb8233fac2010-10-26 16:08:53 -0700264 mController.onContextMenuClosed(menu);
Leon Scrogginsb2b19f52009-10-09 16:10:00 -0400265 }
266
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400267 /**
The Android Open Source Project0c908882009-03-03 19:32:16 -0800268 * onSaveInstanceState(Bundle map)
269 * onSaveInstanceState is called right before onStop(). The map contains
270 * the saved state.
271 */
Grace Kloba22ac16e2009-10-07 18:00:23 -0700272 @Override
273 protected void onSaveInstanceState(Bundle outState) {
Dave Bort31a6d1c2009-04-13 15:56:49 -0700274 if (LOGV_ENABLED) {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800275 Log.v(LOGTAG, "BrowserActivity.onSaveInstanceState: this=" + this);
276 }
John Reck9c35b9c2012-05-30 10:08:50 -0700277 mController.onSaveInstanceState(outState);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800278 }
279
Grace Kloba22ac16e2009-10-07 18:00:23 -0700280 @Override
281 protected void onPause() {
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700282 mEngineInitializer.onActivityPause();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800283 super.onPause();
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700284 // Note: Do not add any more application logic in this method.
285 // Move any additional app logic into handleOnPause().
286 }
287
288 protected void handleOnPause() {
Tarun Nainanib4a173f2015-01-05 09:23:08 -0800289 // Note: Intentionally left blank
290 }
291
292 protected void handleOnStop() {
Dany Rybnikovc912c552015-01-19 15:40:13 +0200293 CookieManager.getInstance().flushCookieStore();
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700294 mController.onPause();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800295 }
296
Grace Kloba22ac16e2009-10-07 18:00:23 -0700297 @Override
298 protected void onDestroy() {
Dave Bort31a6d1c2009-04-13 15:56:49 -0700299 if (LOGV_ENABLED) {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800300 Log.v(LOGTAG, "BrowserActivity.onDestroy: this=" + this);
301 }
302 super.onDestroy();
Enrico Rosd6efa972014-12-02 19:49:59 -0800303 // mEngineInitializer can be null if onCreate is not called before onDestroy
304 // it happens when starting the activity with an intent while the screen is locked.
305 if (mEngineInitializer != null)
306 mEngineInitializer.onActivityDestroy();
John Reck9c35b9c2012-05-30 10:08:50 -0700307 mController.onDestroy();
308 mController = NullController.INSTANCE;
Axesh R. Ajmera32558762015-04-23 13:21:56 -0700309 if (!Locale.getDefault().equals(mCurrentLocale) || killOnExitDialog) {
310 Log.i(LOGTAG,"Force Killing Browser");
Axesh R. Ajmeracc280282015-03-25 16:31:03 -0700311 Process.killProcess(Process.myPid());
312 }
313
The Android Open Source Project0c908882009-03-03 19:32:16 -0800314 }
315
316 @Override
317 public void onConfigurationChanged(Configuration newConfig) {
318 super.onConfigurationChanged(newConfig);
John Reck9c35b9c2012-05-30 10:08:50 -0700319 mController.onConfgurationChanged(newConfig);
kaiyizbb2db872013-08-01 22:24:07 -0400320
321 //For avoiding bug CR520353 temporarily, delay 300ms to refresh WebView.
322 mHandlerEx.postDelayed(runnable, 300);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800323 }
324
Grace Kloba22ac16e2009-10-07 18:00:23 -0700325 @Override
326 public void onLowMemory() {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800327 super.onLowMemory();
Michael Kolb8233fac2010-10-26 16:08:53 -0700328 mController.onLowMemory();
Grace Kloba22ac16e2009-10-07 18:00:23 -0700329 }
330
The Android Open Source Project0c908882009-03-03 19:32:16 -0800331 @Override
Pankaj Garg49b79252014-11-07 17:33:41 -0800332 public void invalidateOptionsMenu() {
333 super.invalidateOptionsMenu();
334 mController.invalidateOptionsMenu();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800335 }
336
337 @Override
Michael Kolb8233fac2010-10-26 16:08:53 -0700338 public boolean onPrepareOptionsMenu(Menu menu) {
339 super.onPrepareOptionsMenu(menu);
Enrico Ros1f5a0952014-11-18 20:15:48 -0800340 return false;
Cary Clark01cfcdd2010-06-04 16:36:45 -0400341 }
342
The Android Open Source Project0c908882009-03-03 19:32:16 -0800343 @Override
344 public boolean onOptionsItemSelected(MenuItem item) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700345 if (!mController.onOptionsItemSelected(item)) {
346 return super.onOptionsItemSelected(item);
Michael Kolb370a4f32010-10-06 10:45:32 -0700347 }
The Android Open Source Project0c908882009-03-03 19:32:16 -0800348 return true;
349 }
350
351 @Override
352 public void onCreateContextMenu(ContextMenu menu, View v,
353 ContextMenuInfo menuInfo) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700354 mController.onCreateContextMenu(menu, v, menuInfo);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800355 }
356
Michael Kolb8233fac2010-10-26 16:08:53 -0700357 @Override
358 public boolean onContextItemSelected(MenuItem item) {
359 return mController.onContextItemSelected(item);
Grace Kloba22ac16e2009-10-07 18:00:23 -0700360 }
361
Grace Kloba5942df02009-09-18 11:48:29 -0700362 @Override
363 public boolean onKeyDown(int keyCode, KeyEvent event) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700364 return mController.onKeyDown(keyCode, event) ||
365 super.onKeyDown(keyCode, event);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800366 }
367
Grace Kloba5942df02009-09-18 11:48:29 -0700368 @Override
John Recke6bf4ab2011-02-24 15:48:05 -0800369 public boolean onKeyLongPress(int keyCode, KeyEvent event) {
370 return mController.onKeyLongPress(keyCode, event) ||
371 super.onKeyLongPress(keyCode, event);
372 }
373
374 @Override
Grace Kloba5942df02009-09-18 11:48:29 -0700375 public boolean onKeyUp(int keyCode, KeyEvent event) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700376 return mController.onKeyUp(keyCode, event) ||
377 super.onKeyUp(keyCode, event);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800378 }
379
Michael Kolbe421c242010-10-04 19:29:01 -0700380 @Override
Michael Kolb8233fac2010-10-26 16:08:53 -0700381 public void onActionModeStarted(ActionMode mode) {
382 super.onActionModeStarted(mode);
383 mController.onActionModeStarted(mode);
Michael Kolbe421c242010-10-04 19:29:01 -0700384 }
385
Michael Kolbe421c242010-10-04 19:29:01 -0700386 @Override
Michael Kolb8233fac2010-10-26 16:08:53 -0700387 public void onActionModeFinished(ActionMode mode) {
388 super.onActionModeFinished(mode);
389 mController.onActionModeFinished(mode);
Michael Kolbe421c242010-10-04 19:29:01 -0700390 }
391
The Android Open Source Project0c908882009-03-03 19:32:16 -0800392 @Override
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700393 protected void onActivityResult (int requestCode, int resultCode,
394 Intent intent) {
395 mEngineInitializer.onActivityResult(requestCode, resultCode, intent);
396 }
397
398 protected void handleOnActivityResult (int requestCode, int resultCode, Intent intent) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700399 mController.onActivityResult(requestCode, resultCode, intent);
Andrei Popescu163ab742009-10-20 17:58:23 +0100400 }
401
Michael Kolbfbc579a2011-07-07 15:59:33 -0700402 @Override
403 public boolean onSearchRequested() {
404 return mController.onSearchRequested();
405 }
406
Michael Kolbc3af0672011-08-09 10:24:41 -0700407 @Override
408 public boolean dispatchKeyEvent(KeyEvent event) {
409 return mController.dispatchKeyEvent(event)
410 || super.dispatchKeyEvent(event);
411 }
412
413 @Override
414 public boolean dispatchKeyShortcutEvent(KeyEvent event) {
415 return mController.dispatchKeyShortcutEvent(event)
416 || super.dispatchKeyShortcutEvent(event);
417 }
418
419 @Override
420 public boolean dispatchTouchEvent(MotionEvent ev) {
421 return mController.dispatchTouchEvent(ev)
422 || super.dispatchTouchEvent(ev);
423 }
424
425 @Override
426 public boolean dispatchTrackballEvent(MotionEvent ev) {
427 return mController.dispatchTrackballEvent(ev)
428 || super.dispatchTrackballEvent(ev);
429 }
430
431 @Override
432 public boolean dispatchGenericMotionEvent(MotionEvent ev) {
433 return mController.dispatchGenericMotionEvent(ev) ||
434 super.dispatchGenericMotionEvent(ev);
435 }
436
The Android Open Source Project0c908882009-03-03 19:32:16 -0800437}