summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorxiaoqiny <quic_xiaoqiny@codeaurora.org>2014-04-03 17:23:12 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-01-30 11:17:45 -0800
commit49ce6546e4484cbd5e64b8a9f401f62358b01dc7 (patch)
treea9051a722acdb0bb74b849fa35361bb52976b20e /src/com
parente17d7a4d93c2d56ef21b67ae555cd8df3b352bae (diff)
downloadandroid_packages_apps_Gallery2-49ce6546e4484cbd5e64b8a9f401f62358b01dc7.tar.gz
android_packages_apps_Gallery2-49ce6546e4484cbd5e64b8a9f401f62358b01dc7.tar.bz2
android_packages_apps_Gallery2-49ce6546e4484cbd5e64b8a9f401f62358b01dc7.zip
Gallery2: Fix force close issue when mute some videos
- catch exception when failed to mute video Change-Id: Ib0901e9f27bdfb0b06f7a8968ca5bcffad63578d CRs-Fixed: 641477
Diffstat (limited to 'src/com')
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/app/MuteVideo.java16
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/app/VideoUtils.java5
2 files changed, 18 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/app/MuteVideo.java b/src/com/android/gallery3d/app/MuteVideo.java
index a385fbb9f..dd05397d2 100644..100755
--- 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
index 76d5d1e02..4f551a67d 100644..100755
--- 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();
}