Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 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.gallery3d.app; |
| 18 | |
Owen Lin | 7a5e1e7 | 2012-06-20 16:54:24 +0800 | [diff] [blame] | 19 | import android.annotation.TargetApi; |
John Reck | 2abaaf7 | 2012-12-12 13:43:43 -0800 | [diff] [blame] | 20 | import android.app.ActionBar; |
| 21 | import android.app.Activity; |
Pin Ting | 4ba06f0 | 2012-02-11 02:53:53 +0800 | [diff] [blame] | 22 | import android.content.AsyncQueryHandler; |
Owen Lin | be055bc | 2012-05-15 16:56:59 -0700 | [diff] [blame] | 23 | import android.content.ContentResolver; |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 24 | import android.content.BroadcastReceiver; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 25 | import android.content.Intent; |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 26 | import android.content.IntentFilter; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 27 | import android.content.pm.ActivityInfo; |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 28 | import android.content.Context; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 29 | import android.database.Cursor; |
Ray Chen | 7b9c72a | 2012-03-07 18:22:17 +0800 | [diff] [blame] | 30 | import android.graphics.Bitmap; |
| 31 | import android.graphics.drawable.BitmapDrawable; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 32 | import android.media.AudioManager; |
Ray Chen | e6e4beb | 2011-10-11 11:37:18 +0800 | [diff] [blame] | 33 | import android.net.Uri; |
Owen Lin | 7a5e1e7 | 2012-06-20 16:54:24 +0800 | [diff] [blame] | 34 | import android.os.Build; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 35 | import android.os.Bundle; |
| 36 | import android.provider.MediaStore; |
Pin Ting | 4ba06f0 | 2012-02-11 02:53:53 +0800 | [diff] [blame] | 37 | import android.provider.OpenableColumns; |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 38 | import android.telephony.PhoneStateListener; |
| 39 | import android.telephony.TelephonyManager; |
Chih-Chung Chang | fc8c503 | 2011-11-29 14:21:11 +0800 | [diff] [blame] | 40 | import android.view.KeyEvent; |
John Reck | 2abaaf7 | 2012-12-12 13:43:43 -0800 | [diff] [blame] | 41 | import android.view.Menu; |
| 42 | import android.view.MenuItem; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 43 | import android.view.View; |
| 44 | import android.view.Window; |
| 45 | import android.view.WindowManager; |
John Reck | 2abaaf7 | 2012-12-12 13:43:43 -0800 | [diff] [blame] | 46 | import android.widget.ShareActionProvider; |
Ray Chen | e6e4beb | 2011-10-11 11:37:18 +0800 | [diff] [blame] | 47 | import com.android.gallery3d.R; |
Owen Lin | 7a5e1e7 | 2012-06-20 16:54:24 +0800 | [diff] [blame] | 48 | import com.android.gallery3d.common.ApiHelper; |
Pin Ting | 4ba06f0 | 2012-02-11 02:53:53 +0800 | [diff] [blame] | 49 | import com.android.gallery3d.common.Utils; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * This activity plays a video from a specified URI. |
Ray Chen | 7b9c72a | 2012-03-07 18:22:17 +0800 | [diff] [blame] | 53 | * |
| 54 | * The client of this activity can pass a logo bitmap in the intent (KEY_LOGO_BITMAP) |
| 55 | * to set the action bar logo so the playback process looks more seamlessly integrated with |
| 56 | * the original activity. |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 57 | */ |
John Reck | 2abaaf7 | 2012-12-12 13:43:43 -0800 | [diff] [blame] | 58 | public class MovieActivity extends Activity { |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 59 | @SuppressWarnings("unused") |
| 60 | private static final String TAG = "MovieActivity"; |
Ray Chen | a387105 | 2012-05-17 12:15:08 +0800 | [diff] [blame] | 61 | public static final String KEY_LOGO_BITMAP = "logo-bitmap"; |
| 62 | public static final String KEY_TREAT_UP_AS_BACK = "treat-up-as-back"; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 63 | |
| 64 | private MoviePlayer mPlayer; |
| 65 | private boolean mFinishOnCompletion; |
Ray Chen | e6e4beb | 2011-10-11 11:37:18 +0800 | [diff] [blame] | 66 | private Uri mUri; |
Ray Chen | a387105 | 2012-05-17 12:15:08 +0800 | [diff] [blame] | 67 | private boolean mTreatUpAsBack; |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 68 | private AudioManager mAudioManager; |
| 69 | private TelephonyManager mTelephonyManager; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 70 | |
Owen Lin | 7a5e1e7 | 2012-06-20 16:54:24 +0800 | [diff] [blame] | 71 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) |
| 72 | private void setSystemUiVisibility(View rootView) { |
| 73 | if (ApiHelper.HAS_VIEW_SYSTEM_UI_FLAG_LAYOUT_STABLE) { |
| 74 | rootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
| 75 | | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
| 76 | | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); |
| 77 | } |
| 78 | } |
| 79 | |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 80 | @Override |
| 81 | public void onCreate(Bundle savedInstanceState) { |
| 82 | super.onCreate(savedInstanceState); |
| 83 | |
John Reck | 2abaaf7 | 2012-12-12 13:43:43 -0800 | [diff] [blame] | 84 | requestWindowFeature(Window.FEATURE_ACTION_BAR); |
| 85 | requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 86 | mTelephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); |
| 87 | mTelephonyManager.listen(mPhoneListener, PhoneStateListener.LISTEN_CALL_STATE); |
| 88 | mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 89 | |
| 90 | setContentView(R.layout.movie_view); |
Chih-Chung Chang | fb55994 | 2012-03-12 12:46:25 +0800 | [diff] [blame] | 91 | View rootView = findViewById(R.id.movie_view_root); |
Owen Lin | 7a5e1e7 | 2012-06-20 16:54:24 +0800 | [diff] [blame] | 92 | |
| 93 | setSystemUiVisibility(rootView); |
| 94 | |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 95 | Intent intent = getIntent(); |
Chih-Chung Chang | bb7d7b9 | 2011-09-21 15:38:35 +0800 | [diff] [blame] | 96 | initializeActionBar(intent); |
Chih-Chung Chang | 209a916 | 2011-10-14 16:09:09 +0800 | [diff] [blame] | 97 | mFinishOnCompletion = intent.getBooleanExtra( |
| 98 | MediaStore.EXTRA_FINISH_ON_COMPLETION, true); |
Ray Chen | a387105 | 2012-05-17 12:15:08 +0800 | [diff] [blame] | 99 | mTreatUpAsBack = intent.getBooleanExtra(KEY_TREAT_UP_AS_BACK, false); |
Chih-Chung Chang | 209a916 | 2011-10-14 16:09:09 +0800 | [diff] [blame] | 100 | mPlayer = new MoviePlayer(rootView, this, intent.getData(), savedInstanceState, |
| 101 | !mFinishOnCompletion) { |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 102 | @Override |
| 103 | public void onCompletion() { |
| 104 | if (mFinishOnCompletion) { |
| 105 | finish(); |
| 106 | } |
| 107 | } |
| 108 | }; |
| 109 | if (intent.hasExtra(MediaStore.EXTRA_SCREEN_ORIENTATION)) { |
| 110 | int orientation = intent.getIntExtra( |
| 111 | MediaStore.EXTRA_SCREEN_ORIENTATION, |
| 112 | ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); |
| 113 | if (orientation != getRequestedOrientation()) { |
| 114 | setRequestedOrientation(orientation); |
| 115 | } |
| 116 | } |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 117 | Window win = getWindow(); |
| 118 | WindowManager.LayoutParams winParams = win.getAttributes(); |
| 119 | winParams.buttonBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFF; |
Chih-Chung Chang | 8176012 | 2011-09-27 16:50:16 +0800 | [diff] [blame] | 120 | winParams.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 121 | win.setAttributes(winParams); |
Owen Lin | 5dd57a2 | 2012-05-22 14:19:31 -0700 | [diff] [blame] | 122 | |
| 123 | // We set the background in the theme to have the launching animation. |
| 124 | // But for the performance (and battery), we remove the background here. |
| 125 | win.setBackgroundDrawable(null); |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 126 | } |
| 127 | |
Owen Lin | cc8e7ab | 2012-07-27 11:46:50 +0800 | [diff] [blame] | 128 | private void setActionBarLogoFromIntent(Intent intent) { |
Owen Lin | 8a861a0 | 2012-08-24 15:09:42 +0800 | [diff] [blame] | 129 | Bitmap logo = intent.getParcelableExtra(KEY_LOGO_BITMAP); |
| 130 | if (logo != null) { |
John Reck | 2abaaf7 | 2012-12-12 13:43:43 -0800 | [diff] [blame] | 131 | getActionBar().setLogo( |
Owen Lin | 8a861a0 | 2012-08-24 15:09:42 +0800 | [diff] [blame] | 132 | new BitmapDrawable(getResources(), logo)); |
Owen Lin | cc8e7ab | 2012-07-27 11:46:50 +0800 | [diff] [blame] | 133 | } |
| 134 | } |
| 135 | |
Chih-Chung Chang | bb7d7b9 | 2011-09-21 15:38:35 +0800 | [diff] [blame] | 136 | private void initializeActionBar(Intent intent) { |
Pin Ting | 143594f | 2012-01-18 18:15:27 +0800 | [diff] [blame] | 137 | mUri = intent.getData(); |
John Reck | 2abaaf7 | 2012-12-12 13:43:43 -0800 | [diff] [blame] | 138 | final ActionBar actionBar = getActionBar(); |
John Reck | 4ea5c27 | 2013-01-18 16:00:45 -0800 | [diff] [blame] | 139 | if (actionBar == null) { |
| 140 | return; |
| 141 | } |
Owen Lin | cc8e7ab | 2012-07-27 11:46:50 +0800 | [diff] [blame] | 142 | setActionBarLogoFromIntent(intent); |
Owen Lin | b21b8e5 | 2012-08-24 12:25:57 +0800 | [diff] [blame] | 143 | actionBar.setDisplayOptions( |
| 144 | ActionBar.DISPLAY_HOME_AS_UP, |
| 145 | ActionBar.DISPLAY_HOME_AS_UP); |
Pin Ting | 143594f | 2012-01-18 18:15:27 +0800 | [diff] [blame] | 146 | |
Pin Ting | 4ba06f0 | 2012-02-11 02:53:53 +0800 | [diff] [blame] | 147 | String title = intent.getStringExtra(Intent.EXTRA_TITLE); |
| 148 | if (title != null) { |
| 149 | actionBar.setTitle(title); |
| 150 | } else { |
| 151 | // Displays the filename as title, reading the filename from the |
| 152 | // interface: {@link android.provider.OpenableColumns#DISPLAY_NAME}. |
| 153 | AsyncQueryHandler queryHandler = |
| 154 | new AsyncQueryHandler(getContentResolver()) { |
| 155 | @Override |
| 156 | protected void onQueryComplete(int token, Object cookie, |
| 157 | Cursor cursor) { |
| 158 | try { |
| 159 | if ((cursor != null) && cursor.moveToFirst()) { |
| 160 | String displayName = cursor.getString(0); |
| 161 | |
| 162 | // Just show empty title if other apps don't set |
| 163 | // DISPLAY_NAME |
| 164 | actionBar.setTitle((displayName == null) ? "" : |
| 165 | displayName); |
| 166 | } |
| 167 | } finally { |
| 168 | Utils.closeSilently(cursor); |
| 169 | } |
| 170 | } |
| 171 | }; |
| 172 | queryHandler.startQuery(0, null, mUri, |
| 173 | new String[] {OpenableColumns.DISPLAY_NAME}, null, null, |
| 174 | null); |
| 175 | } |
Chih-Chung Chang | bb7d7b9 | 2011-09-21 15:38:35 +0800 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | @Override |
Ray Chen | e6e4beb | 2011-10-11 11:37:18 +0800 | [diff] [blame] | 179 | public boolean onCreateOptionsMenu(Menu menu) { |
| 180 | super.onCreateOptionsMenu(menu); |
John Reck | 2abaaf7 | 2012-12-12 13:43:43 -0800 | [diff] [blame] | 181 | getMenuInflater().inflate(R.menu.movie, menu); |
Owen Lin | 8a861a0 | 2012-08-24 15:09:42 +0800 | [diff] [blame] | 182 | |
Owen Lin | be055bc | 2012-05-15 16:56:59 -0700 | [diff] [blame] | 183 | // Document says EXTRA_STREAM should be a content: Uri |
| 184 | // So, we only share the video if it's "content:". |
Owen Lin | b21b8e5 | 2012-08-24 12:25:57 +0800 | [diff] [blame] | 185 | MenuItem shareItem = menu.findItem(R.id.action_share); |
Wu-cheng Li | fb55719 | 2012-07-19 17:11:06 +0800 | [diff] [blame] | 186 | if (ContentResolver.SCHEME_CONTENT.equals(mUri.getScheme())) { |
Owen Lin | b21b8e5 | 2012-08-24 12:25:57 +0800 | [diff] [blame] | 187 | shareItem.setVisible(true); |
| 188 | ((ShareActionProvider) shareItem.getActionProvider()) |
| 189 | .setShareIntent(createShareIntent()); |
Wu-cheng Li | fb55719 | 2012-07-19 17:11:06 +0800 | [diff] [blame] | 190 | } else { |
Owen Lin | b21b8e5 | 2012-08-24 12:25:57 +0800 | [diff] [blame] | 191 | shareItem.setVisible(false); |
Ray Chen | e6e4beb | 2011-10-11 11:37:18 +0800 | [diff] [blame] | 192 | } |
Owen Lin | 8a861a0 | 2012-08-24 15:09:42 +0800 | [diff] [blame] | 193 | return true; |
Wu-cheng Li | fb55719 | 2012-07-19 17:11:06 +0800 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | private Intent createShareIntent() { |
| 197 | Intent intent = new Intent(Intent.ACTION_SEND); |
| 198 | intent.setType("video/*"); |
| 199 | intent.putExtra(Intent.EXTRA_STREAM, mUri); |
| 200 | return intent; |
| 201 | } |
| 202 | |
Ray Chen | e6e4beb | 2011-10-11 11:37:18 +0800 | [diff] [blame] | 203 | @Override |
Chih-Chung Chang | bb7d7b9 | 2011-09-21 15:38:35 +0800 | [diff] [blame] | 204 | public boolean onOptionsItemSelected(MenuItem item) { |
Wu-cheng Li | fb55719 | 2012-07-19 17:11:06 +0800 | [diff] [blame] | 205 | int id = item.getItemId(); |
| 206 | if (id == android.R.id.home) { |
Ray Chen | a387105 | 2012-05-17 12:15:08 +0800 | [diff] [blame] | 207 | if (mTreatUpAsBack) { |
| 208 | finish(); |
| 209 | } else { |
Mangesh Ghiware | 06c0276 | 2013-09-11 15:59:59 -0700 | [diff] [blame] | 210 | startActivity(new Intent(this, GalleryActivity.class)); |
Ray Chen | a387105 | 2012-05-17 12:15:08 +0800 | [diff] [blame] | 211 | finish(); |
| 212 | } |
Chih-Chung Chang | bb7d7b9 | 2011-09-21 15:38:35 +0800 | [diff] [blame] | 213 | return true; |
Wu-cheng Li | fb55719 | 2012-07-19 17:11:06 +0800 | [diff] [blame] | 214 | } else if (id == R.id.action_share) { |
| 215 | startActivity(Intent.createChooser(createShareIntent(), |
| 216 | getString(R.string.share))); |
| 217 | return true; |
Chih-Chung Chang | bb7d7b9 | 2011-09-21 15:38:35 +0800 | [diff] [blame] | 218 | } |
| 219 | return false; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | @Override |
| 223 | public void onStart() { |
| 224 | ((AudioManager) getSystemService(AUDIO_SERVICE)) |
| 225 | .requestAudioFocus(null, AudioManager.STREAM_MUSIC, |
| 226 | AudioManager.AUDIOFOCUS_GAIN_TRANSIENT); |
| 227 | super.onStart(); |
| 228 | } |
| 229 | |
| 230 | @Override |
| 231 | protected void onStop() { |
| 232 | ((AudioManager) getSystemService(AUDIO_SERVICE)) |
| 233 | .abandonAudioFocus(null); |
| 234 | super.onStop(); |
| 235 | } |
| 236 | |
| 237 | @Override |
| 238 | public void onPause() { |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 239 | unregisterReceiver(mReceiver); |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 240 | mPlayer.onPause(); |
| 241 | super.onPause(); |
| 242 | } |
| 243 | |
| 244 | @Override |
| 245 | public void onResume() { |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 246 | IntentFilter filter = new IntentFilter(); |
| 247 | filter.addAction("com.android.deskclock.ALARM_ALERT"); |
| 248 | filter.addAction("com.android.deskclock.ALARM_DONE"); |
| 249 | registerReceiver(mReceiver, filter); |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 250 | mPlayer.onResume(); |
| 251 | super.onResume(); |
| 252 | } |
| 253 | |
| 254 | @Override |
Owen Lin | 540e469 | 2011-09-14 19:49:03 +0800 | [diff] [blame] | 255 | public void onSaveInstanceState(Bundle outState) { |
| 256 | super.onSaveInstanceState(outState); |
| 257 | mPlayer.onSaveInstanceState(outState); |
| 258 | } |
| 259 | |
| 260 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 261 | public void onDestroy() { |
| 262 | mPlayer.onDestroy(); |
| 263 | super.onDestroy(); |
| 264 | } |
Chih-Chung Chang | fc8c503 | 2011-11-29 14:21:11 +0800 | [diff] [blame] | 265 | |
| 266 | @Override |
| 267 | public boolean onKeyDown(int keyCode, KeyEvent event) { |
| 268 | return mPlayer.onKeyDown(keyCode, event) |
| 269 | || super.onKeyDown(keyCode, event); |
| 270 | } |
| 271 | |
| 272 | @Override |
| 273 | public boolean onKeyUp(int keyCode, KeyEvent event) { |
| 274 | return mPlayer.onKeyUp(keyCode, event) |
| 275 | || super.onKeyUp(keyCode, event); |
| 276 | } |
xulei | 71e9a7b | 2015-09-16 10:28:17 +0800 | [diff] [blame] | 277 | |
| 278 | PhoneStateListener mPhoneListener = new PhoneStateListener() { |
| 279 | private boolean mControlPaused = false; |
| 280 | |
| 281 | public void onCallStateChanged(int state, String incomingNumber) { |
| 282 | super.onCallStateChanged(state, incomingNumber); |
| 283 | switch (state) { |
| 284 | case TelephonyManager.CALL_STATE_RINGING: |
| 285 | if (mPlayer != null && mPlayer.isPlaying()) { |
| 286 | mControlPaused = true; |
| 287 | mPlayer.onMoviePlayPause(); |
| 288 | } |
| 289 | break; |
| 290 | case TelephonyManager.CALL_STATE_IDLE: |
| 291 | if (mPlayer != null && mControlPaused) { |
| 292 | mPlayer.onReplay(); |
| 293 | mControlPaused = false; |
| 294 | } |
| 295 | break; |
| 296 | default: |
| 297 | break; |
| 298 | } |
| 299 | }; |
| 300 | }; |
| 301 | |
| 302 | private BroadcastReceiver mReceiver = new BroadcastReceiver() { |
| 303 | private boolean mControlPaused = false; |
| 304 | |
| 305 | @Override |
| 306 | public void onReceive(Context context, Intent intent) { |
| 307 | String action = intent.getAction(); |
| 308 | if (intent.getAction().equals("com.android.deskclock.ALARM_ALERT")) { |
| 309 | Log.d(TAG, "ALARM_ALERT"); |
| 310 | if (mPlayer != null && mPlayer.isPlaying()) { |
| 311 | mPlayer.onMoviePlayPause(); |
| 312 | mControlPaused = true; |
| 313 | } |
| 314 | } else if (intent.getAction().equals("com.android.deskclock.ALARM_DONE")) { |
| 315 | Log.d(TAG, "ALARM_DONE"); |
| 316 | if (mPlayer != null && mControlPaused) { |
| 317 | mPlayer.onReplay(); |
| 318 | mControlPaused = false; |
| 319 | } |
| 320 | } |
| 321 | } |
| 322 | }; |
| 323 | |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 324 | } |