Skip to content

Commit

Permalink
try to handle auto power off exceptions on some cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
obs committed Jul 15, 2016
1 parent 34fb6be commit 3fdd594
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.obsidium.bettermanual"
minSdkVersion 10
targetSdkVersion 10
versionCode 3
versionName "1.2"
versionCode 4
versionName "1.3"
}
buildTypes {
release {
Expand Down
25 changes: 22 additions & 3 deletions app/src/main/java/com/obsidium/bettermanual/ManualActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,14 @@ private void prepareTimelapse()
m_tvHint.setText("\uE4CD to set timelapse interval, \uE04C to confirm");
m_tvHint.setVisibility(View.VISIBLE);

m_autoPowerOffTimeBackup = Settings.getAutoPowerOffTime();
// Not supported on some camera models
try
{
m_autoPowerOffTimeBackup = Settings.getAutoPowerOffTime();
}
catch (NoSuchMethodError e)
{
}
}
}

Expand Down Expand Up @@ -1510,7 +1517,13 @@ private void startShootingTimelapse()
{
m_tvHint.setVisibility(View.GONE);
m_tvMsg.setVisibility(View.GONE);
Settings.setAutoPowerOffTime(m_timelapseInterval / 1000 * 2);
try
{
Settings.setAutoPowerOffTime(m_timelapseInterval / 1000 * 2);
}
catch (NoSuchMethodError e)
{
}
m_handler.post(m_timelapseRunnable);
}

Expand All @@ -1533,7 +1546,13 @@ private void abortTimelapse()
m_viewFlags = m_prefs.getViewFlags(m_viewFlags);
updateViewVisibility();

Settings.setAutoPowerOffTime(m_autoPowerOffTimeBackup);
try
{
Settings.setAutoPowerOffTime(m_autoPowerOffTimeBackup);
}
catch (NoSuchMethodError e)
{
}
}

@Override
Expand Down

0 comments on commit 3fdd594

Please sign in to comment.