blob: c0a91adcc57149da4261e7030709691d8b35bfc7 [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();
Jeff Davidson43610292010-07-16 16:03:58 -070068
kaiyizbb2db872013-08-01 22:24:07 -040069 private UiController mUiController;
70 private Handler mHandlerEx = new Handler();
71 private Runnable runnable = new Runnable() {
72 @Override
73 public void run() {
74 if (mUiController != null) {
75 WebView current = mUiController.getCurrentWebView();
76 if (current != null) {
77 current.postInvalidate();
78 }
79 }
80 }
81 };
82
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -070083 private Bundle mSavedInstanceState;
84 private EngineInitializer mEngineInitializer;
Bijan Amirzada9b1e9882014-02-26 17:15:46 -080085
Grace Kloba22ac16e2009-10-07 18:00:23 -070086 @Override
87 public void onCreate(Bundle icicle) {
Dave Bort31a6d1c2009-04-13 15:56:49 -070088 if (LOGV_ENABLED) {
John Reck6c2e2f32011-08-22 13:41:23 -070089 Log.v(LOGTAG, this + " onStart, has state: "
90 + (icicle == null ? "false" : "true"));
The Android Open Source Project0c908882009-03-03 19:32:16 -080091 }
92 super.onCreate(icicle);
Derek Sollenbergerffa561e2010-11-16 14:19:01 -050093
John Reck7878f222012-04-18 16:23:14 -070094 if (shouldIgnoreIntents()) {
95 finish();
96 return;
97 }
98
John Reckf57c0292011-07-21 18:15:39 -070099 // If this was a web search request, pass it on to the default web
100 // search provider and finish this activity.
Bijan Amirzada41242f22014-03-21 12:12:18 -0700101 /*
kaiyiza2368f12013-09-02 10:43:31 +0800102 SearchEngine searchEngine = BrowserSettings.getInstance().getSearchEngine();
103 boolean result = IntentHandler.handleWebSearchIntent(this, null, getIntent());
104 if (result && (searchEngine instanceof DefaultSearchEngine)) {
John Reckf57c0292011-07-21 18:15:39 -0700105 finish();
106 return;
107 }
Bijan Amirzada41242f22014-03-21 12:12:18 -0700108 */
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700109
110 mEngineInitializer = EngineInitializer.getInstance();
111 mEngineInitializer.onActivityCreate(BrowserActivity.this);
112
113 Thread.setDefaultUncaughtExceptionHandler(new CrashLogExceptionHandler(this));
114
115 mSavedInstanceState = icicle;
116 // Create the initial UI views
John Reck9c35b9c2012-05-30 10:08:50 -0700117 mController = createController();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800118
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700119 // Workaround for the black screen flicker on SurfaceView creation
120 ViewGroup topLayout = (ViewGroup) findViewById(R.id.main_content);
121 topLayout.requestTransparentRegion(topLayout);
122
123 // Add pre-draw listener to start the controller after engine initialization.
124 final ViewTreeObserver observer = getWindow().getDecorView().getViewTreeObserver();
125 observer.addOnPreDrawListener(this);
126
127 mEngineInitializer.initializeResourceExtractor(this);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800128 }
129
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700130 @Override
131 public boolean onPreDraw()
132 {
133 final ViewTreeObserver observer = getWindow().getDecorView().getViewTreeObserver();
134 observer.removeOnPreDrawListener(this);
135 mEngineInitializer.onPreDraw();
136 return true;
137 }
138
139
John Recka5176f32011-05-17 12:35:37 -0700140 public static boolean isTablet(Context context) {
141 return context.getResources().getBoolean(R.bool.isTablet);
John Reck9d27ff52011-02-11 17:47:54 -0800142 }
143
John Reck9c35b9c2012-05-30 10:08:50 -0700144 private Controller createController() {
145 Controller controller = new Controller(this);
146 boolean xlarge = isTablet(this);
147 UI ui = null;
148 if (xlarge) {
kaiyizbb2db872013-08-01 22:24:07 -0400149 XLargeUi tablet = new XLargeUi(this, controller);
150 ui = tablet;
151 mUiController = tablet.getUiController();
John Reck9c35b9c2012-05-30 10:08:50 -0700152 } else {
kaiyizbb2db872013-08-01 22:24:07 -0400153 PhoneUi phone = new PhoneUi(this, controller);
154 ui = phone;
155 mUiController = phone.getUiController();
John Reck9c35b9c2012-05-30 10:08:50 -0700156 }
157 controller.setUi(ui);
158 return controller;
159 }
160
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700161 public void onEngineInitializationComplete() {
162 Intent intent = (mSavedInstanceState == null) ? getIntent() : null;
163 mController.start(intent);
164 }
165
John Reck41554852010-12-01 12:53:37 -0800166 @VisibleForTesting
Tarun Nainani436b8732014-06-10 13:58:41 -0700167 //public to facilitate testing
168 public Controller getController() {
John Reck9c35b9c2012-05-30 10:08:50 -0700169 return (Controller) mController;
Michael Kolba2b2ba82010-08-04 17:54:03 -0700170 }
171
The Android Open Source Project0c908882009-03-03 19:32:16 -0800172 @Override
173 protected void onNewIntent(Intent intent) {
John Reck7878f222012-04-18 16:23:14 -0700174 if (shouldIgnoreIntents()) return;
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700175 mEngineInitializer.onNewIntent(intent);
176 // Note: Do not add any more application logic in this method.
177 // Move any additional app logic into handleOnNewIntent().
178 }
179
180 protected void handleOnNewIntent(Intent intent) {
John Reck63bb6872010-12-01 19:29:32 -0800181 if (ACTION_RESTART.equals(intent.getAction())) {
182 Bundle outState = new Bundle();
John Reck1cf4b792011-07-26 10:22:22 -0700183 mController.onSaveInstanceState(outState);
John Reck63bb6872010-12-01 19:29:32 -0800184 finish();
185 getApplicationContext().startActivity(
186 new Intent(getApplicationContext(), BrowserActivity.class)
187 .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
188 .putExtra(EXTRA_STATE, outState));
189 return;
190 }
Michael Kolb8233fac2010-10-26 16:08:53 -0700191 mController.handleNewIntent(intent);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800192 }
193
John Reck7878f222012-04-18 16:23:14 -0700194 private KeyguardManager mKeyguardManager;
195 private PowerManager mPowerManager;
196 private boolean shouldIgnoreIntents() {
197 // Only process intents if the screen is on and the device is unlocked
198 // aka, if we will be user-visible
199 if (mKeyguardManager == null) {
200 mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
201 }
202 if (mPowerManager == null) {
203 mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
204 }
205 boolean ignore = !mPowerManager.isScreenOn();
206 ignore |= mKeyguardManager.inKeyguardRestrictedInputMode();
207 if (LOGV_ENABLED) {
208 Log.v(LOGTAG, "ignore intents: " + ignore);
209 }
210 return ignore;
211 }
212
Grace Kloba22ac16e2009-10-07 18:00:23 -0700213 @Override
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700214 protected void onStart() {
215 super.onStart();
216 mEngineInitializer.onActivityStart();
217 }
218
219 @Override
Grace Kloba22ac16e2009-10-07 18:00:23 -0700220 protected void onResume() {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800221 super.onResume();
Dave Bort31a6d1c2009-04-13 15:56:49 -0700222 if (LOGV_ENABLED) {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800223 Log.v(LOGTAG, "BrowserActivity.onResume: this=" + this);
224 }
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700225 mEngineInitializer.onActivityResume();
226 // Note: Do not add any more application logic in this method.
227 // Move any additional app logic into handleOnResume().
228 }
Tarun Nainanief749cb2014-05-19 18:16:53 -0700229
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700230 protected void handleOnResume() {
Tarun Nainanib4a173f2015-01-05 09:23:08 -0800231 // Note: Intentionally left blank.
232 }
233
234 protected void handleOnStart() {
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700235 mController.onResume();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800236 }
237
Leon Scrogginsa81a7642009-08-31 17:05:41 -0400238 @Override
Tarun Nainanib4a173f2015-01-05 09:23:08 -0800239 protected void onStop() {
240 mEngineInitializer.onActivityStop();
241 super.onStop();
242 // Note: Do not add any more application logic in this method.
243 // Move any additional app logic into handleOnStop().
244 }
245
246 @Override
Leon Scrogginsa81a7642009-08-31 17:05:41 -0400247 public boolean onMenuOpened(int featureId, Menu menu) {
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -0400248 if (Window.FEATURE_OPTIONS_PANEL == featureId) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700249 mController.onMenuOpened(featureId, menu);
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -0400250 }
Leon Scrogginsa81a7642009-08-31 17:05:41 -0400251 return true;
252 }
253
Leon Scroggins3bbb6ca2009-09-09 12:51:10 -0400254 @Override
255 public void onOptionsMenuClosed(Menu menu) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700256 mController.onOptionsMenuClosed(menu);
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400257 }
258
Leon Scrogginsb2b19f52009-10-09 16:10:00 -0400259 @Override
260 public void onContextMenuClosed(Menu menu) {
261 super.onContextMenuClosed(menu);
Michael Kolb8233fac2010-10-26 16:08:53 -0700262 mController.onContextMenuClosed(menu);
Leon Scrogginsb2b19f52009-10-09 16:10:00 -0400263 }
264
Leon Scrogginsc6fa1102009-09-21 10:40:01 -0400265 /**
The Android Open Source Project0c908882009-03-03 19:32:16 -0800266 * onSaveInstanceState(Bundle map)
267 * onSaveInstanceState is called right before onStop(). The map contains
268 * the saved state.
269 */
Grace Kloba22ac16e2009-10-07 18:00:23 -0700270 @Override
271 protected void onSaveInstanceState(Bundle outState) {
Dave Bort31a6d1c2009-04-13 15:56:49 -0700272 if (LOGV_ENABLED) {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800273 Log.v(LOGTAG, "BrowserActivity.onSaveInstanceState: this=" + this);
274 }
John Reck9c35b9c2012-05-30 10:08:50 -0700275 mController.onSaveInstanceState(outState);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800276 }
277
Grace Kloba22ac16e2009-10-07 18:00:23 -0700278 @Override
279 protected void onPause() {
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700280 mEngineInitializer.onActivityPause();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800281 super.onPause();
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700282 // Note: Do not add any more application logic in this method.
283 // Move any additional app logic into handleOnPause().
284 }
285
286 protected void handleOnPause() {
Tarun Nainanib4a173f2015-01-05 09:23:08 -0800287 // Note: Intentionally left blank
288 }
289
290 protected void handleOnStop() {
Dany Rybnikovc912c552015-01-19 15:40:13 +0200291 CookieManager.getInstance().flushCookieStore();
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700292 mController.onPause();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800293 }
294
Grace Kloba22ac16e2009-10-07 18:00:23 -0700295 @Override
296 protected void onDestroy() {
Dave Bort31a6d1c2009-04-13 15:56:49 -0700297 if (LOGV_ENABLED) {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800298 Log.v(LOGTAG, "BrowserActivity.onDestroy: this=" + this);
299 }
300 super.onDestroy();
Enrico Rosd6efa972014-12-02 19:49:59 -0800301 // mEngineInitializer can be null if onCreate is not called before onDestroy
302 // it happens when starting the activity with an intent while the screen is locked.
303 if (mEngineInitializer != null)
304 mEngineInitializer.onActivityDestroy();
John Reck9c35b9c2012-05-30 10:08:50 -0700305 mController.onDestroy();
306 mController = NullController.INSTANCE;
Axesh R. Ajmeracc280282015-03-25 16:31:03 -0700307 if (!Locale.getDefault().equals(mCurrentLocale)) {
308 Log.e(LOGTAG,"Force Killing Browser on locale change");
309 Process.killProcess(Process.myPid());
310 }
311
The Android Open Source Project0c908882009-03-03 19:32:16 -0800312 }
313
314 @Override
315 public void onConfigurationChanged(Configuration newConfig) {
316 super.onConfigurationChanged(newConfig);
John Reck9c35b9c2012-05-30 10:08:50 -0700317 mController.onConfgurationChanged(newConfig);
kaiyizbb2db872013-08-01 22:24:07 -0400318
319 //For avoiding bug CR520353 temporarily, delay 300ms to refresh WebView.
320 mHandlerEx.postDelayed(runnable, 300);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800321 }
322
Grace Kloba22ac16e2009-10-07 18:00:23 -0700323 @Override
324 public void onLowMemory() {
The Android Open Source Project0c908882009-03-03 19:32:16 -0800325 super.onLowMemory();
Michael Kolb8233fac2010-10-26 16:08:53 -0700326 mController.onLowMemory();
Grace Kloba22ac16e2009-10-07 18:00:23 -0700327 }
328
The Android Open Source Project0c908882009-03-03 19:32:16 -0800329 @Override
Pankaj Garg49b79252014-11-07 17:33:41 -0800330 public void invalidateOptionsMenu() {
331 super.invalidateOptionsMenu();
332 mController.invalidateOptionsMenu();
The Android Open Source Project0c908882009-03-03 19:32:16 -0800333 }
334
335 @Override
Michael Kolb8233fac2010-10-26 16:08:53 -0700336 public boolean onPrepareOptionsMenu(Menu menu) {
337 super.onPrepareOptionsMenu(menu);
Enrico Ros1f5a0952014-11-18 20:15:48 -0800338 return false;
Cary Clark01cfcdd2010-06-04 16:36:45 -0400339 }
340
The Android Open Source Project0c908882009-03-03 19:32:16 -0800341 @Override
342 public boolean onOptionsItemSelected(MenuItem item) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700343 if (!mController.onOptionsItemSelected(item)) {
344 return super.onOptionsItemSelected(item);
Michael Kolb370a4f32010-10-06 10:45:32 -0700345 }
The Android Open Source Project0c908882009-03-03 19:32:16 -0800346 return true;
347 }
348
349 @Override
350 public void onCreateContextMenu(ContextMenu menu, View v,
351 ContextMenuInfo menuInfo) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700352 mController.onCreateContextMenu(menu, v, menuInfo);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800353 }
354
Michael Kolb8233fac2010-10-26 16:08:53 -0700355 @Override
356 public boolean onContextItemSelected(MenuItem item) {
357 return mController.onContextItemSelected(item);
Grace Kloba22ac16e2009-10-07 18:00:23 -0700358 }
359
Grace Kloba5942df02009-09-18 11:48:29 -0700360 @Override
361 public boolean onKeyDown(int keyCode, KeyEvent event) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700362 return mController.onKeyDown(keyCode, event) ||
363 super.onKeyDown(keyCode, event);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800364 }
365
Grace Kloba5942df02009-09-18 11:48:29 -0700366 @Override
John Recke6bf4ab2011-02-24 15:48:05 -0800367 public boolean onKeyLongPress(int keyCode, KeyEvent event) {
368 return mController.onKeyLongPress(keyCode, event) ||
369 super.onKeyLongPress(keyCode, event);
370 }
371
372 @Override
Grace Kloba5942df02009-09-18 11:48:29 -0700373 public boolean onKeyUp(int keyCode, KeyEvent event) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700374 return mController.onKeyUp(keyCode, event) ||
375 super.onKeyUp(keyCode, event);
The Android Open Source Project0c908882009-03-03 19:32:16 -0800376 }
377
Michael Kolbe421c242010-10-04 19:29:01 -0700378 @Override
Michael Kolb8233fac2010-10-26 16:08:53 -0700379 public void onActionModeStarted(ActionMode mode) {
380 super.onActionModeStarted(mode);
381 mController.onActionModeStarted(mode);
Michael Kolbe421c242010-10-04 19:29:01 -0700382 }
383
Michael Kolbe421c242010-10-04 19:29:01 -0700384 @Override
Michael Kolb8233fac2010-10-26 16:08:53 -0700385 public void onActionModeFinished(ActionMode mode) {
386 super.onActionModeFinished(mode);
387 mController.onActionModeFinished(mode);
Michael Kolbe421c242010-10-04 19:29:01 -0700388 }
389
The Android Open Source Project0c908882009-03-03 19:32:16 -0800390 @Override
Kulanthaivel Palanichamy77942682014-10-28 11:52:06 -0700391 protected void onActivityResult (int requestCode, int resultCode,
392 Intent intent) {
393 mEngineInitializer.onActivityResult(requestCode, resultCode, intent);
394 }
395
396 protected void handleOnActivityResult (int requestCode, int resultCode, Intent intent) {
Michael Kolb8233fac2010-10-26 16:08:53 -0700397 mController.onActivityResult(requestCode, resultCode, intent);
Andrei Popescu163ab742009-10-20 17:58:23 +0100398 }
399
Michael Kolbfbc579a2011-07-07 15:59:33 -0700400 @Override
401 public boolean onSearchRequested() {
402 return mController.onSearchRequested();
403 }
404
Michael Kolbc3af0672011-08-09 10:24:41 -0700405 @Override
406 public boolean dispatchKeyEvent(KeyEvent event) {
407 return mController.dispatchKeyEvent(event)
408 || super.dispatchKeyEvent(event);
409 }
410
411 @Override
412 public boolean dispatchKeyShortcutEvent(KeyEvent event) {
413 return mController.dispatchKeyShortcutEvent(event)
414 || super.dispatchKeyShortcutEvent(event);
415 }
416
417 @Override
418 public boolean dispatchTouchEvent(MotionEvent ev) {
419 return mController.dispatchTouchEvent(ev)
420 || super.dispatchTouchEvent(ev);
421 }
422
423 @Override
424 public boolean dispatchTrackballEvent(MotionEvent ev) {
425 return mController.dispatchTrackballEvent(ev)
426 || super.dispatchTrackballEvent(ev);
427 }
428
429 @Override
430 public boolean dispatchGenericMotionEvent(MotionEvent ev) {
431 return mController.dispatchGenericMotionEvent(ev) ||
432 super.dispatchGenericMotionEvent(ev);
433 }
434
The Android Open Source Project0c908882009-03-03 19:32:16 -0800435}