diff options
author | Chih-Chung Chang <chihchung@google.com> | 2012-07-03 12:49:45 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2012-07-03 18:31:13 +0800 |
commit | 6772173d2a49b87a1d209f42fe52b5f830596f99 (patch) | |
tree | 051c9c01b242bcb1e11ccfdf8f4fcac7a355995e /src/com/android/gallery3d/app | |
parent | df4763cf8752fb1babc7244fc2be33ed87d3b072 (diff) | |
download | android_packages_apps_Gallery2-6772173d2a49b87a1d209f42fe52b5f830596f99.tar.gz android_packages_apps_Gallery2-6772173d2a49b87a1d209f42fe52b5f830596f99.tar.bz2 android_packages_apps_Gallery2-6772173d2a49b87a1d209f42fe52b5f830596f99.zip |
Remove dependencies on APIs only exist on newer platforms.
Change-Id: I606a23863247454051dd183ddf6b77f6bc882685
Diffstat (limited to 'src/com/android/gallery3d/app')
-rw-r--r-- | src/com/android/gallery3d/app/MoviePlayer.java | 8 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java index 660c4d953..f2dc9ad20 100644 --- a/src/com/android/gallery3d/app/MoviePlayer.java +++ b/src/com/android/gallery3d/app/MoviePlayer.java @@ -58,6 +58,10 @@ public class MoviePlayer implements private static final String KEY_VIDEO_POSITION = "video-position"; private static final String KEY_RESUMEABLE_TIME = "resumeable-timeout"; + // These are constants in KeyEvent, appearing on API level 11. + private static final int KEYCODE_MEDIA_PLAY = 126; + private static final int KEYCODE_MEDIA_PAUSE = 127; + // Copied from MediaPlaybackService in the Music Player app. private static final String SERVICECMD = "com.android.music.musicservicecommand"; private static final String CMDNAME = "command"; @@ -411,12 +415,12 @@ public class MoviePlayer implements playVideo(); } return true; - case KeyEvent.KEYCODE_MEDIA_PAUSE: + case KEYCODE_MEDIA_PAUSE: if (mVideoView.isPlaying()) { pauseVideo(); } return true; - case KeyEvent.KEYCODE_MEDIA_PLAY: + case KEYCODE_MEDIA_PLAY: if (!mVideoView.isPlaying()) { playVideo(); } diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 22b01637e..3b6a7704b 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -321,10 +321,9 @@ public class PhotoPage extends ActivityState implements } } - @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + @TargetApi(ApiHelper.VERSION_CODES.JELLY_BEAN) private void setNfcBeamPushUris(Uri[] uris) { - if (mNfcAdapter != null && - Build.VERSION.SDK_INT >= ApiHelper.VERSION_CODES.JELLY_BEAN) { + if (mNfcAdapter != null && ApiHelper.HAS_SET_BEAM_PUSH_URIS) { mNfcAdapter.setBeamPushUris(uris, (Activity)mActivity); } } |