From ba37d51c1ddc20b0b8472a2eee768a2d024f4fff Mon Sep 17 00:00:00 2001 From: kaiyiz Date: Tue, 27 Jan 2015 18:24:14 +0800 Subject: Gallery2: Grant permission to read/write files of Settings. Set photo of "user" via statusbar->more settings fails, because that Gallery2 does not have the permission to read and write files of Settings. Grant read and write Settings permission to Gallery2. Change-Id: Ifcc5b4d8d938960296c4fa9d0f7f302d353c3197 CRs-Fixed: 785671 --- AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 4c9bf20cb..9ccac2dc7 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -20,6 +20,7 @@ -- cgit v1.2.3 From 104f367812c753362c9c077d1d010e127e3be7f1 Mon Sep 17 00:00:00 2001 From: kaiyiz Date: Wed, 28 Jan 2015 14:55:30 +0800 Subject: Gallery2: Set PhotoPage GL root reset when rotate When there is another activity on top of PhotoPage, the GLRootView will not update to match screen, so the back ground seems corruption. Set GLRoot View resume when onConfigurationChanged happen. CRs-Fixed: 778294 Change-Id: Ib1fd6953462e26f11c3a8957a042db2ad4ecc275 --- src/com/android/gallery3d/app/AbstractGalleryActivity.java | 9 +++++++++ src/com/android/gallery3d/app/PhotoPage.java | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/com/android/gallery3d/app/AbstractGalleryActivity.java b/src/com/android/gallery3d/app/AbstractGalleryActivity.java index 9af1fb8ba..ae30cb0aa 100644 --- a/src/com/android/gallery3d/app/AbstractGalleryActivity.java +++ b/src/com/android/gallery3d/app/AbstractGalleryActivity.java @@ -133,6 +133,15 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext return mGLRootView; } + public void GLRootResume(boolean isResume) { + if (isResume) { + mGLRootView.onResume(); + mGLRootView.lockRenderThread(); + } else { + mGLRootView.unlockRenderThread(); + } + } + public OrientationManager getOrientationManager() { return mOrientationManager; } diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 2deab3234..b5a4d5640 100755 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -1630,6 +1630,15 @@ public abstract class PhotoPage extends ActivityState implements } } + @Override + public void onConfigurationChanged(Configuration config) { + super.onConfigurationChanged(config); + if(mIsActive) return; + mActivity.GLRootResume(true); + mModel.resume(); + mActivity.GLRootResume(false); + } + @Override protected void onResume() { super.onResume(); -- cgit v1.2.3 From 49ce6546e4484cbd5e64b8a9f401f62358b01dc7 Mon Sep 17 00:00:00 2001 From: xiaoqiny Date: Thu, 3 Apr 2014 17:23:12 +0800 Subject: Gallery2: Fix force close issue when mute some videos - catch exception when failed to mute video Change-Id: Ib0901e9f27bdfb0b06f7a8968ca5bcffad63578d CRs-Fixed: 641477 --- src/com/android/gallery3d/app/MuteVideo.java | 16 +++++++++++++--- src/com/android/gallery3d/app/VideoUtils.java | 5 +++++ 2 files changed, 18 insertions(+), 3 deletions(-) mode change 100644 => 100755 src/com/android/gallery3d/app/MuteVideo.java mode change 100644 => 100755 src/com/android/gallery3d/app/VideoUtils.java diff --git a/src/com/android/gallery3d/app/MuteVideo.java b/src/com/android/gallery3d/app/MuteVideo.java old mode 100644 new mode 100755 index a385fbb9f..dd05397d2 --- a/src/com/android/gallery3d/app/MuteVideo.java +++ b/src/com/android/gallery3d/app/MuteVideo.java @@ -87,9 +87,19 @@ public class MuteVideo { VideoUtils.startMute(mFilePath, mDstFileInfo); SaveVideoFileUtils.insertContent( mDstFileInfo, mActivity.getContentResolver(), mUri); - } catch (IOException e) { - Toast.makeText(mActivity, mActivity.getString(R.string.video_mute_err), - Toast.LENGTH_SHORT).show(); + } catch (Exception e) { + mHandler.post(new Runnable() { + @Override + public void run() { + Toast.makeText(mActivity, mActivity.getString(R.string.video_mute_err), + Toast.LENGTH_SHORT).show(); + if (mMuteProgress != null) { + mMuteProgress.dismiss(); + mMuteProgress = null; + } + } + }); + return; } // After muting is done, trigger the UI changed. mHandler.post(new Runnable() { diff --git a/src/com/android/gallery3d/app/VideoUtils.java b/src/com/android/gallery3d/app/VideoUtils.java old mode 100644 new mode 100755 index 76d5d1e02..4f551a67d --- a/src/com/android/gallery3d/app/VideoUtils.java +++ b/src/com/android/gallery3d/app/VideoUtils.java @@ -226,6 +226,11 @@ public class VideoUtils { } catch (IllegalStateException e) { // Swallow the exception due to malformed source. Log.w(LOGTAG, "The source video file is malformed"); + File f = new File(dstPath); + if (f.exists()) { + f.delete(); + } + throw e; } finally { muxer.release(); } -- cgit v1.2.3 From 938e5ef58ca3c485b01d396caf6284386a81d6d9 Mon Sep 17 00:00:00 2001 From: lubiny Date: Thu, 17 Oct 2013 16:51:52 +0800 Subject: Gallery2: Seek to trim start time only once when playing - When playing video in TrimVideo activity, it may enter an endless loop: Seek to trim start time (actually sought to previous sync frame) -> Periodic check, if current position < trim startm, seek again. - This patch adds a flag to ensure seeking to trim start time only once. Change-Id: I3cd74fbd85546cc35d5c32797ab7f1775f091586 CRs-Fixed: 694431 --- src/com/android/gallery3d/app/TrimVideo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/gallery3d/app/TrimVideo.java b/src/com/android/gallery3d/app/TrimVideo.java index c5d721274..a52c25606 100644 --- a/src/com/android/gallery3d/app/TrimVideo.java +++ b/src/com/android/gallery3d/app/TrimVideo.java @@ -57,6 +57,7 @@ public class TrimVideo extends Activity implements private int mTrimStartTime = 0; private int mTrimEndTime = 0; + private boolean mCheckTrimStartTime; private int mVideoPosition = 0; public static final String KEY_TRIM_START = "trim_start"; public static final String KEY_TRIM_END = "trim_end"; @@ -177,10 +178,11 @@ public class TrimVideo extends Activity implements mVideoPosition = mVideoView.getCurrentPosition(); // If the video position is smaller than the starting point of trimming, // correct it. - if (mVideoPosition < mTrimStartTime) { + if (mCheckTrimStartTime && (mVideoPosition < mTrimStartTime)) { mVideoView.seekTo(mTrimStartTime); mVideoPosition = mTrimStartTime; } + mCheckTrimStartTime = false; // If the position is bigger than the end point of trimming, show the // replay button and pause. if (mVideoPosition >= mTrimEndTime && mTrimEndTime > 0) { @@ -204,6 +206,7 @@ public class TrimVideo extends Activity implements private void playVideo() { mVideoView.start(); + mCheckTrimStartTime = true; mController.showPlaying(); setProgress(); } -- cgit v1.2.3