The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.browser; |
| 18 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 19 | import android.app.Activity; |
John Reck | 7878f22 | 2012-04-18 16:23:14 -0700 | [diff] [blame] | 20 | import android.app.KeyguardManager; |
John Reck | 9d27ff5 | 2011-02-11 17:47:54 -0800 | [diff] [blame] | 21 | import android.content.Context; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 22 | import android.content.Intent; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 23 | import android.content.res.Configuration; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 24 | import android.os.Bundle; |
John Reck | 7878f22 | 2012-04-18 16:23:14 -0700 | [diff] [blame] | 25 | import android.os.PowerManager; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 26 | import android.util.Log; |
Leon Scroggins III | 8e4fbf1 | 2010-08-17 16:58:15 -0400 | [diff] [blame] | 27 | import android.view.ActionMode; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 28 | import android.view.ContextMenu; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 29 | import android.view.ContextMenu.ContextMenuInfo; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 30 | import android.view.KeyEvent; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 31 | import android.view.Menu; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 32 | import android.view.MenuItem; |
Michael Kolb | c3af067 | 2011-08-09 10:24:41 -0700 | [diff] [blame] | 33 | import android.view.MotionEvent; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 34 | import android.view.View; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 35 | import android.view.Window; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 36 | |
John Reck | d3e4d5b | 2011-07-13 15:48:43 -0700 | [diff] [blame] | 37 | import com.google.common.annotations.VisibleForTesting; |
| 38 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 39 | public class BrowserActivity extends Activity { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 40 | |
John Reck | 439c9a5 | 2010-12-14 10:04:39 -0800 | [diff] [blame] | 41 | public static final String ACTION_SHOW_BOOKMARKS = "show_bookmarks"; |
| 42 | public static final String ACTION_SHOW_BROWSER = "show_browser"; |
John Reck | 63bb687 | 2010-12-01 19:29:32 -0800 | [diff] [blame] | 43 | public static final String ACTION_RESTART = "--restart--"; |
| 44 | private static final String EXTRA_STATE = "state"; |
| 45 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 46 | private final static String LOGTAG = "browser"; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 47 | |
John Reck | 6c2e2f3 | 2011-08-22 13:41:23 -0700 | [diff] [blame] | 48 | private final static boolean LOGV_ENABLED = Browser.LOGV_ENABLED; |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 49 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 50 | private Controller mController; |
| 51 | private UI mUi; |
Jeff Davidson | 4361029 | 2010-07-16 16:03:58 -0700 | [diff] [blame] | 52 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 53 | @Override |
| 54 | public void onCreate(Bundle icicle) { |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 55 | if (LOGV_ENABLED) { |
John Reck | 6c2e2f3 | 2011-08-22 13:41:23 -0700 | [diff] [blame] | 56 | Log.v(LOGTAG, this + " onStart, has state: " |
| 57 | + (icicle == null ? "false" : "true")); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 58 | } |
| 59 | super.onCreate(icicle); |
Derek Sollenberger | ffa561e | 2010-11-16 14:19:01 -0500 | [diff] [blame] | 60 | |
John Reck | 7878f22 | 2012-04-18 16:23:14 -0700 | [diff] [blame] | 61 | if (shouldIgnoreIntents()) { |
| 62 | finish(); |
| 63 | return; |
| 64 | } |
| 65 | |
John Reck | f57c029 | 2011-07-21 18:15:39 -0700 | [diff] [blame] | 66 | // If this was a web search request, pass it on to the default web |
| 67 | // search provider and finish this activity. |
| 68 | if (IntentHandler.handleWebSearchIntent(this, null, getIntent())) { |
| 69 | finish(); |
| 70 | return; |
| 71 | } |
George Mount | 3636d0a | 2011-11-21 09:08:21 -0800 | [diff] [blame] | 72 | mController = new Controller(this); |
John Reck | a5176f3 | 2011-05-17 12:35:37 -0700 | [diff] [blame] | 73 | boolean xlarge = isTablet(this); |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 74 | if (xlarge) { |
| 75 | mUi = new XLargeUi(this, mController); |
| 76 | } else { |
| 77 | mUi = new PhoneUi(this, mController); |
| 78 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 79 | mController.setUi(mUi); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 80 | |
George Mount | 3636d0a | 2011-11-21 09:08:21 -0800 | [diff] [blame] | 81 | Intent intent = (icicle == null) ? getIntent() : null; |
| 82 | mController.start(intent); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 83 | } |
| 84 | |
John Reck | a5176f3 | 2011-05-17 12:35:37 -0700 | [diff] [blame] | 85 | public static boolean isTablet(Context context) { |
| 86 | return context.getResources().getBoolean(R.bool.isTablet); |
John Reck | 9d27ff5 | 2011-02-11 17:47:54 -0800 | [diff] [blame] | 87 | } |
| 88 | |
John Reck | 4155485 | 2010-12-01 12:53:37 -0800 | [diff] [blame] | 89 | @VisibleForTesting |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 90 | Controller getController() { |
| 91 | return mController; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 92 | } |
| 93 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 94 | @Override |
| 95 | protected void onNewIntent(Intent intent) { |
John Reck | 7878f22 | 2012-04-18 16:23:14 -0700 | [diff] [blame] | 96 | if (shouldIgnoreIntents()) return; |
John Reck | 63bb687 | 2010-12-01 19:29:32 -0800 | [diff] [blame] | 97 | if (ACTION_RESTART.equals(intent.getAction())) { |
| 98 | Bundle outState = new Bundle(); |
John Reck | 1cf4b79 | 2011-07-26 10:22:22 -0700 | [diff] [blame] | 99 | mController.onSaveInstanceState(outState); |
John Reck | 63bb687 | 2010-12-01 19:29:32 -0800 | [diff] [blame] | 100 | finish(); |
| 101 | getApplicationContext().startActivity( |
| 102 | new Intent(getApplicationContext(), BrowserActivity.class) |
| 103 | .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) |
| 104 | .putExtra(EXTRA_STATE, outState)); |
| 105 | return; |
| 106 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 107 | mController.handleNewIntent(intent); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 108 | } |
| 109 | |
John Reck | 7878f22 | 2012-04-18 16:23:14 -0700 | [diff] [blame] | 110 | private KeyguardManager mKeyguardManager; |
| 111 | private PowerManager mPowerManager; |
| 112 | private boolean shouldIgnoreIntents() { |
| 113 | // Only process intents if the screen is on and the device is unlocked |
| 114 | // aka, if we will be user-visible |
| 115 | if (mKeyguardManager == null) { |
| 116 | mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); |
| 117 | } |
| 118 | if (mPowerManager == null) { |
| 119 | mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); |
| 120 | } |
| 121 | boolean ignore = !mPowerManager.isScreenOn(); |
| 122 | ignore |= mKeyguardManager.inKeyguardRestrictedInputMode(); |
| 123 | if (LOGV_ENABLED) { |
| 124 | Log.v(LOGTAG, "ignore intents: " + ignore); |
| 125 | } |
| 126 | return ignore; |
| 127 | } |
| 128 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 129 | @Override |
| 130 | protected void onResume() { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 131 | super.onResume(); |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 132 | if (LOGV_ENABLED) { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 133 | Log.v(LOGTAG, "BrowserActivity.onResume: this=" + this); |
| 134 | } |
Michael Kolb | 06f03e4 | 2010-12-06 10:18:26 -0800 | [diff] [blame] | 135 | if (mController != null) { |
| 136 | mController.onResume(); |
| 137 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 138 | } |
| 139 | |
Leon Scroggins | a81a764 | 2009-08-31 17:05:41 -0400 | [diff] [blame] | 140 | @Override |
| 141 | public boolean onMenuOpened(int featureId, Menu menu) { |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 142 | if (Window.FEATURE_OPTIONS_PANEL == featureId) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 143 | mController.onMenuOpened(featureId, menu); |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 144 | } |
Leon Scroggins | a81a764 | 2009-08-31 17:05:41 -0400 | [diff] [blame] | 145 | return true; |
| 146 | } |
| 147 | |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 148 | @Override |
| 149 | public void onOptionsMenuClosed(Menu menu) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 150 | mController.onOptionsMenuClosed(menu); |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 151 | } |
| 152 | |
Leon Scroggins | b2b19f5 | 2009-10-09 16:10:00 -0400 | [diff] [blame] | 153 | @Override |
| 154 | public void onContextMenuClosed(Menu menu) { |
| 155 | super.onContextMenuClosed(menu); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 156 | mController.onContextMenuClosed(menu); |
Leon Scroggins | b2b19f5 | 2009-10-09 16:10:00 -0400 | [diff] [blame] | 157 | } |
| 158 | |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 159 | /** |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 160 | * onSaveInstanceState(Bundle map) |
| 161 | * onSaveInstanceState is called right before onStop(). The map contains |
| 162 | * the saved state. |
| 163 | */ |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 164 | @Override |
| 165 | protected void onSaveInstanceState(Bundle outState) { |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 166 | if (LOGV_ENABLED) { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 167 | Log.v(LOGTAG, "BrowserActivity.onSaveInstanceState: this=" + this); |
| 168 | } |
John Reck | 0ec3e9f | 2012-05-16 16:05:37 -0700 | [diff] [blame] | 169 | if (mController != null) { |
| 170 | mController.onSaveInstanceState(outState); |
| 171 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 172 | } |
| 173 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 174 | @Override |
| 175 | protected void onPause() { |
Michael Kolb | 06f03e4 | 2010-12-06 10:18:26 -0800 | [diff] [blame] | 176 | if (mController != null) { |
| 177 | mController.onPause(); |
| 178 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 179 | super.onPause(); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 180 | } |
| 181 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 182 | @Override |
| 183 | protected void onDestroy() { |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 184 | if (LOGV_ENABLED) { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 185 | Log.v(LOGTAG, "BrowserActivity.onDestroy: this=" + this); |
| 186 | } |
| 187 | super.onDestroy(); |
Michael Kolb | 06f03e4 | 2010-12-06 10:18:26 -0800 | [diff] [blame] | 188 | if (mController != null) { |
| 189 | mController.onDestroy(); |
| 190 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 191 | mUi = null; |
| 192 | mController = null; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | @Override |
| 196 | public void onConfigurationChanged(Configuration newConfig) { |
| 197 | super.onConfigurationChanged(newConfig); |
John Reck | 40e7f35 | 2012-05-09 10:49:28 -0700 | [diff] [blame] | 198 | if (mController != null) { |
| 199 | mController.onConfgurationChanged(newConfig); |
| 200 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 201 | } |
| 202 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 203 | @Override |
| 204 | public void onLowMemory() { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 205 | super.onLowMemory(); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 206 | mController.onLowMemory(); |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 207 | } |
| 208 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 209 | @Override |
| 210 | public boolean onCreateOptionsMenu(Menu menu) { |
| 211 | super.onCreateOptionsMenu(menu); |
Michael Kolb | 2b552f5 | 2012-05-14 08:31:04 -0700 | [diff] [blame] | 212 | return (mController != null) && mController.onCreateOptionsMenu(menu); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 216 | public boolean onPrepareOptionsMenu(Menu menu) { |
| 217 | super.onPrepareOptionsMenu(menu); |
John Reck | b3417f0 | 2011-01-14 11:01:05 -0800 | [diff] [blame] | 218 | return mController.onPrepareOptionsMenu(menu); |
Cary Clark | 01cfcdd | 2010-06-04 16:36:45 -0400 | [diff] [blame] | 219 | } |
| 220 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 221 | @Override |
| 222 | public boolean onOptionsItemSelected(MenuItem item) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 223 | if (!mController.onOptionsItemSelected(item)) { |
| 224 | return super.onOptionsItemSelected(item); |
Michael Kolb | 370a4f3 | 2010-10-06 10:45:32 -0700 | [diff] [blame] | 225 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 226 | return true; |
| 227 | } |
| 228 | |
| 229 | @Override |
| 230 | public void onCreateContextMenu(ContextMenu menu, View v, |
| 231 | ContextMenuInfo menuInfo) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 232 | mController.onCreateContextMenu(menu, v, menuInfo); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 233 | } |
| 234 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 235 | @Override |
| 236 | public boolean onContextItemSelected(MenuItem item) { |
| 237 | return mController.onContextItemSelected(item); |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 238 | } |
| 239 | |
Grace Kloba | 5942df0 | 2009-09-18 11:48:29 -0700 | [diff] [blame] | 240 | @Override |
| 241 | public boolean onKeyDown(int keyCode, KeyEvent event) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 242 | return mController.onKeyDown(keyCode, event) || |
| 243 | super.onKeyDown(keyCode, event); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 244 | } |
| 245 | |
Grace Kloba | 5942df0 | 2009-09-18 11:48:29 -0700 | [diff] [blame] | 246 | @Override |
John Reck | e6bf4ab | 2011-02-24 15:48:05 -0800 | [diff] [blame] | 247 | public boolean onKeyLongPress(int keyCode, KeyEvent event) { |
| 248 | return mController.onKeyLongPress(keyCode, event) || |
| 249 | super.onKeyLongPress(keyCode, event); |
| 250 | } |
| 251 | |
| 252 | @Override |
Grace Kloba | 5942df0 | 2009-09-18 11:48:29 -0700 | [diff] [blame] | 253 | public boolean onKeyUp(int keyCode, KeyEvent event) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 254 | return mController.onKeyUp(keyCode, event) || |
| 255 | super.onKeyUp(keyCode, event); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 256 | } |
| 257 | |
Michael Kolb | e421c24 | 2010-10-04 19:29:01 -0700 | [diff] [blame] | 258 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 259 | public void onActionModeStarted(ActionMode mode) { |
| 260 | super.onActionModeStarted(mode); |
| 261 | mController.onActionModeStarted(mode); |
Michael Kolb | e421c24 | 2010-10-04 19:29:01 -0700 | [diff] [blame] | 262 | } |
| 263 | |
Michael Kolb | e421c24 | 2010-10-04 19:29:01 -0700 | [diff] [blame] | 264 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 265 | public void onActionModeFinished(ActionMode mode) { |
| 266 | super.onActionModeFinished(mode); |
| 267 | mController.onActionModeFinished(mode); |
Michael Kolb | e421c24 | 2010-10-04 19:29:01 -0700 | [diff] [blame] | 268 | } |
| 269 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 270 | @Override |
| 271 | protected void onActivityResult(int requestCode, int resultCode, |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 272 | Intent intent) { |
| 273 | mController.onActivityResult(requestCode, resultCode, intent); |
Andrei Popescu | 163ab74 | 2009-10-20 17:58:23 +0100 | [diff] [blame] | 274 | } |
| 275 | |
Michael Kolb | fbc579a | 2011-07-07 15:59:33 -0700 | [diff] [blame] | 276 | @Override |
| 277 | public boolean onSearchRequested() { |
| 278 | return mController.onSearchRequested(); |
| 279 | } |
| 280 | |
Michael Kolb | c3af067 | 2011-08-09 10:24:41 -0700 | [diff] [blame] | 281 | @Override |
| 282 | public boolean dispatchKeyEvent(KeyEvent event) { |
| 283 | return mController.dispatchKeyEvent(event) |
| 284 | || super.dispatchKeyEvent(event); |
| 285 | } |
| 286 | |
| 287 | @Override |
| 288 | public boolean dispatchKeyShortcutEvent(KeyEvent event) { |
| 289 | return mController.dispatchKeyShortcutEvent(event) |
| 290 | || super.dispatchKeyShortcutEvent(event); |
| 291 | } |
| 292 | |
| 293 | @Override |
| 294 | public boolean dispatchTouchEvent(MotionEvent ev) { |
| 295 | return mController.dispatchTouchEvent(ev) |
| 296 | || super.dispatchTouchEvent(ev); |
| 297 | } |
| 298 | |
| 299 | @Override |
| 300 | public boolean dispatchTrackballEvent(MotionEvent ev) { |
| 301 | return mController.dispatchTrackballEvent(ev) |
| 302 | || super.dispatchTrackballEvent(ev); |
| 303 | } |
| 304 | |
| 305 | @Override |
| 306 | public boolean dispatchGenericMotionEvent(MotionEvent ev) { |
| 307 | return mController.dispatchGenericMotionEvent(ev) || |
| 308 | super.dispatchGenericMotionEvent(ev); |
| 309 | } |
| 310 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 311 | } |