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 | |
John Reck | 4155485 | 2010-12-01 12:53:37 -0800 | [diff] [blame] | 19 | import com.google.common.annotations.VisibleForTesting; |
| 20 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 21 | import android.app.Activity; |
Patrick Scott | 539e2ec | 2011-01-13 11:27:38 -0500 | [diff] [blame] | 22 | import android.app.ProgressDialog; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 23 | import android.content.Intent; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 24 | import android.content.res.Configuration; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 25 | import android.graphics.Bitmap; |
Andrei Popescu | 540035d | 2009-09-18 18:59:20 +0100 | [diff] [blame] | 26 | import android.graphics.BitmapFactory; |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 27 | import android.graphics.PixelFormat; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 28 | import android.os.Bundle; |
Patrick Scott | 97efb1e | 2011-01-13 14:31:54 -0500 | [diff] [blame] | 29 | import android.os.Handler; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 30 | import android.util.Log; |
Leon Scroggins III | 8e4fbf1 | 2010-08-17 16:58:15 -0400 | [diff] [blame] | 31 | import android.view.ActionMode; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 32 | import android.view.ContextMenu; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 33 | import android.view.ContextMenu.ContextMenuInfo; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 34 | import android.view.KeyEvent; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 35 | import android.view.Menu; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 36 | import android.view.MenuItem; |
| 37 | import android.view.View; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 38 | import android.view.Window; |
| 39 | import android.view.WindowManager; |
Svetoslav Ganov | 2b34599 | 2010-05-06 06:13:54 -0700 | [diff] [blame] | 40 | import android.view.accessibility.AccessibilityManager; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 41 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 42 | public class BrowserActivity extends Activity { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 43 | |
John Reck | 439c9a5 | 2010-12-14 10:04:39 -0800 | [diff] [blame] | 44 | public static final String ACTION_SHOW_BOOKMARKS = "show_bookmarks"; |
| 45 | public static final String ACTION_SHOW_BROWSER = "show_browser"; |
John Reck | 63bb687 | 2010-12-01 19:29:32 -0800 | [diff] [blame] | 46 | public static final String ACTION_RESTART = "--restart--"; |
| 47 | private static final String EXTRA_STATE = "state"; |
| 48 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 49 | private final static String LOGTAG = "browser"; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 50 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 51 | private final static boolean LOGV_ENABLED = |
| 52 | com.android.browser.Browser.LOGV_ENABLED; |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 53 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 54 | private Controller mController; |
| 55 | private UI mUi; |
Jeff Davidson | 4361029 | 2010-07-16 16:03:58 -0700 | [diff] [blame] | 56 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 57 | @Override |
| 58 | public void onCreate(Bundle icicle) { |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 59 | if (LOGV_ENABLED) { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 60 | Log.v(LOGTAG, this + " onStart"); |
| 61 | } |
| 62 | super.onCreate(icicle); |
Derek Sollenberger | ffa561e | 2010-11-16 14:19:01 -0500 | [diff] [blame] | 63 | |
Patrick Scott | 539e2ec | 2011-01-13 11:27:38 -0500 | [diff] [blame] | 64 | BrowserSettings settings = BrowserSettings.getInstance(); |
| 65 | |
Ben Murdoch | ef67165 | 2010-11-25 17:17:58 +0000 | [diff] [blame] | 66 | // We load the first set of BrowserSettings from the db asynchronously |
| 67 | // but if it has not completed at this point, we have no choice but |
| 68 | // to block waiting for them to finish loading. :( |
Patrick Scott | 539e2ec | 2011-01-13 11:27:38 -0500 | [diff] [blame] | 69 | settings.waitForLoadFromDbToComplete(); |
Ben Murdoch | ef67165 | 2010-11-25 17:17:58 +0000 | [diff] [blame] | 70 | |
Derek Sollenberger | ffa561e | 2010-11-16 14:19:01 -0500 | [diff] [blame] | 71 | // render the browser in OpenGL |
Patrick Scott | 539e2ec | 2011-01-13 11:27:38 -0500 | [diff] [blame] | 72 | if (settings.isHardwareAccelerated()) { |
Derek Sollenberger | ffa561e | 2010-11-16 14:19:01 -0500 | [diff] [blame] | 73 | // Set the flag in the activity's window |
| 74 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, |
| 75 | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); |
| 76 | } else { |
| 77 | // Clear the flag in the activity's window |
| 78 | this.getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); |
| 79 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 80 | |
Mike Reed | d334bf5 | 2010-01-26 15:21:44 -0500 | [diff] [blame] | 81 | // enable this to test the browser in 32bit |
| 82 | if (false) { |
| 83 | getWindow().setFormat(PixelFormat.RGBX_8888); |
| 84 | BitmapFactory.setDefaultConfig(Bitmap.Config.ARGB_8888); |
| 85 | } |
| 86 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 87 | // If this was a web search request, pass it on to the default web |
| 88 | // search provider and finish this activity. |
| 89 | if (IntentHandler.handleWebSearchIntent(this, null, getIntent())) { |
| 90 | finish(); |
| 91 | return; |
| 92 | } |
| 93 | |
| 94 | if (((AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE)) |
| 95 | .isEnabled()) { |
Svetoslav Ganov | 2b34599 | 2010-05-06 06:13:54 -0700 | [diff] [blame] | 96 | setDefaultKeyMode(DEFAULT_KEYS_DISABLE); |
Svetoslav Ganov | 2b34599 | 2010-05-06 06:13:54 -0700 | [diff] [blame] | 97 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 98 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 99 | mController = new Controller(this); |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 100 | boolean xlarge = (getResources().getConfiguration().screenLayout |
| 101 | & Configuration.SCREENLAYOUT_SIZE_MASK) |
| 102 | == Configuration.SCREENLAYOUT_SIZE_XLARGE; |
| 103 | if (xlarge) { |
| 104 | mUi = new XLargeUi(this, mController); |
| 105 | } else { |
| 106 | mUi = new PhoneUi(this, mController); |
| 107 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 108 | mController.setUi(mUi); |
| 109 | mController.setWebViewFactory((BaseUi) mUi); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 110 | |
John Reck | 63bb687 | 2010-12-01 19:29:32 -0800 | [diff] [blame] | 111 | Bundle state = getIntent().getBundleExtra(EXTRA_STATE); |
| 112 | if (state != null && icicle == null) { |
| 113 | icicle = state; |
| 114 | } |
Patrick Scott | 539e2ec | 2011-01-13 11:27:38 -0500 | [diff] [blame] | 115 | |
| 116 | String account = settings.getAutoLoginAccount(this); |
Patrick Scott | 97efb1e | 2011-01-13 14:31:54 -0500 | [diff] [blame] | 117 | if (settings.isAutoLoginEnabled() && account != null && |
| 118 | !GoogleAccountLogin.isLoggedIn()) { |
Patrick Scott | 539e2ec | 2011-01-13 11:27:38 -0500 | [diff] [blame] | 119 | GoogleAccountLogin login = |
| 120 | new GoogleAccountLogin(this, account); |
| 121 | final ProgressDialog dialog = ProgressDialog.show(this, |
| 122 | getString(R.string.pref_autologin_title), |
| 123 | getString(R.string.pref_autologin_progress, account), |
| 124 | true /* indeterminate */, |
| 125 | true /* cancelable */, |
| 126 | login); |
| 127 | final Bundle b = icicle; |
Patrick Scott | 97efb1e | 2011-01-13 14:31:54 -0500 | [diff] [blame] | 128 | final Handler handler = new Handler(); |
| 129 | final Runnable dismiss = new Runnable() { |
Patrick Scott | 539e2ec | 2011-01-13 11:27:38 -0500 | [diff] [blame] | 130 | @Override public void run() { |
| 131 | dialog.dismiss(); |
Patrick Scott | 97efb1e | 2011-01-13 14:31:54 -0500 | [diff] [blame] | 132 | } |
| 133 | }; |
| 134 | final Runnable start = new Runnable() { |
| 135 | @Override public void run() { |
| 136 | // Post a delayed dismiss message to avoid a flash of the |
| 137 | // progress dialog. |
| 138 | handler.postDelayed(dismiss, 1000); |
Patrick Scott | 539e2ec | 2011-01-13 11:27:38 -0500 | [diff] [blame] | 139 | mController.start(b, getIntent()); |
| 140 | } |
| 141 | }; |
| 142 | login.startLogin(start); |
| 143 | } else { |
| 144 | mController.start(icicle, getIntent()); |
| 145 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 146 | } |
| 147 | |
John Reck | 4155485 | 2010-12-01 12:53:37 -0800 | [diff] [blame] | 148 | @VisibleForTesting |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 149 | Controller getController() { |
| 150 | return mController; |
Michael Kolb | a2b2ba8 | 2010-08-04 17:54:03 -0700 | [diff] [blame] | 151 | } |
| 152 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 153 | @Override |
| 154 | protected void onNewIntent(Intent intent) { |
John Reck | 63bb687 | 2010-12-01 19:29:32 -0800 | [diff] [blame] | 155 | if (ACTION_RESTART.equals(intent.getAction())) { |
| 156 | Bundle outState = new Bundle(); |
| 157 | mController.onSaveInstanceState(outState); |
| 158 | finish(); |
| 159 | getApplicationContext().startActivity( |
| 160 | new Intent(getApplicationContext(), BrowserActivity.class) |
| 161 | .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) |
| 162 | .putExtra(EXTRA_STATE, outState)); |
| 163 | return; |
| 164 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 165 | mController.handleNewIntent(intent); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 166 | } |
| 167 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 168 | @Override |
| 169 | protected void onResume() { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 170 | super.onResume(); |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 171 | if (LOGV_ENABLED) { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 172 | Log.v(LOGTAG, "BrowserActivity.onResume: this=" + this); |
| 173 | } |
Michael Kolb | 06f03e4 | 2010-12-06 10:18:26 -0800 | [diff] [blame] | 174 | if (mController != null) { |
| 175 | mController.onResume(); |
| 176 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 177 | } |
| 178 | |
Leon Scroggins | a81a764 | 2009-08-31 17:05:41 -0400 | [diff] [blame] | 179 | @Override |
| 180 | public boolean onMenuOpened(int featureId, Menu menu) { |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 181 | if (Window.FEATURE_OPTIONS_PANEL == featureId) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 182 | mController.onMenuOpened(featureId, menu); |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 183 | } |
Leon Scroggins | a81a764 | 2009-08-31 17:05:41 -0400 | [diff] [blame] | 184 | return true; |
| 185 | } |
| 186 | |
Leon Scroggins | 3bbb6ca | 2009-09-09 12:51:10 -0400 | [diff] [blame] | 187 | @Override |
| 188 | public void onOptionsMenuClosed(Menu menu) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 189 | mController.onOptionsMenuClosed(menu); |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 190 | } |
| 191 | |
Leon Scroggins | b2b19f5 | 2009-10-09 16:10:00 -0400 | [diff] [blame] | 192 | @Override |
| 193 | public void onContextMenuClosed(Menu menu) { |
| 194 | super.onContextMenuClosed(menu); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 195 | mController.onContextMenuClosed(menu); |
Leon Scroggins | b2b19f5 | 2009-10-09 16:10:00 -0400 | [diff] [blame] | 196 | } |
| 197 | |
Leon Scroggins | c6fa110 | 2009-09-21 10:40:01 -0400 | [diff] [blame] | 198 | /** |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 199 | * onSaveInstanceState(Bundle map) |
| 200 | * onSaveInstanceState is called right before onStop(). The map contains |
| 201 | * the saved state. |
| 202 | */ |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 203 | @Override |
| 204 | protected void onSaveInstanceState(Bundle outState) { |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 205 | if (LOGV_ENABLED) { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 206 | Log.v(LOGTAG, "BrowserActivity.onSaveInstanceState: this=" + this); |
| 207 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 208 | mController.onSaveInstanceState(outState); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 209 | } |
| 210 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 211 | @Override |
| 212 | protected void onPause() { |
Michael Kolb | 06f03e4 | 2010-12-06 10:18:26 -0800 | [diff] [blame] | 213 | if (mController != null) { |
| 214 | mController.onPause(); |
| 215 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 216 | super.onPause(); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 217 | } |
| 218 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 219 | @Override |
| 220 | protected void onDestroy() { |
Dave Bort | 31a6d1c | 2009-04-13 15:56:49 -0700 | [diff] [blame] | 221 | if (LOGV_ENABLED) { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 222 | Log.v(LOGTAG, "BrowserActivity.onDestroy: this=" + this); |
| 223 | } |
| 224 | super.onDestroy(); |
Michael Kolb | 06f03e4 | 2010-12-06 10:18:26 -0800 | [diff] [blame] | 225 | if (mController != null) { |
| 226 | mController.onDestroy(); |
| 227 | } |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 228 | mUi = null; |
| 229 | mController = null; |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | @Override |
| 233 | public void onConfigurationChanged(Configuration newConfig) { |
| 234 | super.onConfigurationChanged(newConfig); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 235 | mController.onConfgurationChanged(newConfig); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 236 | } |
| 237 | |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 238 | @Override |
| 239 | public void onLowMemory() { |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 240 | super.onLowMemory(); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 241 | mController.onLowMemory(); |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 242 | } |
| 243 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 244 | @Override |
| 245 | public boolean onCreateOptionsMenu(Menu menu) { |
| 246 | super.onCreateOptionsMenu(menu); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 247 | return mController.onCreateOptionsMenu(menu); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 251 | public boolean onPrepareOptionsMenu(Menu menu) { |
| 252 | super.onPrepareOptionsMenu(menu); |
John Reck | b3417f0 | 2011-01-14 11:01:05 -0800 | [diff] [blame] | 253 | return mController.onPrepareOptionsMenu(menu); |
Cary Clark | 01cfcdd | 2010-06-04 16:36:45 -0400 | [diff] [blame] | 254 | } |
| 255 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 256 | @Override |
| 257 | public boolean onOptionsItemSelected(MenuItem item) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 258 | if (!mController.onOptionsItemSelected(item)) { |
| 259 | return super.onOptionsItemSelected(item); |
Michael Kolb | 370a4f3 | 2010-10-06 10:45:32 -0700 | [diff] [blame] | 260 | } |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 261 | return true; |
| 262 | } |
| 263 | |
| 264 | @Override |
| 265 | public void onCreateContextMenu(ContextMenu menu, View v, |
| 266 | ContextMenuInfo menuInfo) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 267 | mController.onCreateContextMenu(menu, v, menuInfo); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 268 | } |
| 269 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 270 | @Override |
| 271 | public boolean onContextItemSelected(MenuItem item) { |
| 272 | return mController.onContextItemSelected(item); |
Grace Kloba | 22ac16e | 2009-10-07 18:00:23 -0700 | [diff] [blame] | 273 | } |
| 274 | |
Grace Kloba | 5942df0 | 2009-09-18 11:48:29 -0700 | [diff] [blame] | 275 | @Override |
| 276 | public boolean onKeyDown(int keyCode, KeyEvent event) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 277 | return mController.onKeyDown(keyCode, event) || |
| 278 | super.onKeyDown(keyCode, event); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 279 | } |
| 280 | |
Grace Kloba | 5942df0 | 2009-09-18 11:48:29 -0700 | [diff] [blame] | 281 | @Override |
| 282 | public boolean onKeyUp(int keyCode, KeyEvent event) { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 283 | return mController.onKeyUp(keyCode, event) || |
| 284 | super.onKeyUp(keyCode, event); |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 285 | } |
| 286 | |
Michael Kolb | e421c24 | 2010-10-04 19:29:01 -0700 | [diff] [blame] | 287 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 288 | public void onActionModeStarted(ActionMode mode) { |
| 289 | super.onActionModeStarted(mode); |
| 290 | mController.onActionModeStarted(mode); |
Michael Kolb | e421c24 | 2010-10-04 19:29:01 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Michael Kolb | e421c24 | 2010-10-04 19:29:01 -0700 | [diff] [blame] | 293 | @Override |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 294 | public void onActionModeFinished(ActionMode mode) { |
| 295 | super.onActionModeFinished(mode); |
| 296 | mController.onActionModeFinished(mode); |
Michael Kolb | e421c24 | 2010-10-04 19:29:01 -0700 | [diff] [blame] | 297 | } |
| 298 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 299 | @Override |
| 300 | protected void onActivityResult(int requestCode, int resultCode, |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 301 | Intent intent) { |
| 302 | mController.onActivityResult(requestCode, resultCode, intent); |
Andrei Popescu | 163ab74 | 2009-10-20 17:58:23 +0100 | [diff] [blame] | 303 | } |
| 304 | |
Andrei Popescu | 56199cc | 2010-01-12 22:39:16 +0000 | [diff] [blame] | 305 | |
The Android Open Source Project | 0c90888 | 2009-03-03 19:32:16 -0800 | [diff] [blame] | 306 | } |