Skip to content

Commit

Permalink
* Version bump to v1.1.4/26
Browse files Browse the repository at this point in the history
! after the v1 update, phones got a "permanent" label :(
  • Loading branch information
artiomchi committed Jul 1, 2012
1 parent b5d45c1 commit cd49c04
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.flexlabs.widgets.dualbattery"
android:installLocation="internalOnly"
android:versionCode="25"
android:versionName="1.1.3">
android:versionCode="26"
android:versionName="1.1.4">
<uses-sdk android:targetSdkVersion="15" android:minSdkVersion="4" />
<uses-permission android:name="com.android.vending.BILLING" />
<application android:icon="@drawable/icon" android:label="@string/app_name" android:hardwareAccelerated="true"
Expand Down
2 changes: 1 addition & 1 deletion src/org/flexlabs/widgets/dualbattery/Constants.java
Expand Up @@ -33,7 +33,7 @@ public class Constants {
public static final int DOCK_STATE_DISCHARGING = 4;

public static final String SETTING_VERSION = "version";
public static final int SETTING_VERSION_CURRENT = 3;
public static final int SETTING_VERSION_CURRENT = 4;
public static final String SETTING_ALWAYS_SHOW_DOCK = "alwaysShowDock";
public static final boolean SETTING_ALWAYS_SHOW_DOCK_DEFAULT = true;

Expand Down
Expand Up @@ -19,6 +19,7 @@
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import org.flexlabs.widgets.dualbattery.BatteryLevel;
import org.flexlabs.widgets.dualbattery.Constants;

public class WidgetSettingsContainer {
Expand Down Expand Up @@ -108,15 +109,24 @@ private static void updateWidgetSettings(SharedPreferences pref, int version) {
int margin = Integer.valueOf(pref.getString(Constants.SETTING_MARGIN, String.valueOf(Constants.SETTING_MARGIN_DEFAULT)));
editor.putInt(Constants.SETTING_MARGIN, margin);
}
editor.putBoolean(Constants.SETTING_JUST_SWAPPED, true);
if (BatteryLevel.getCurrent().is_dockFriendly())
editor.putBoolean(Constants.SETTING_JUST_SWAPPED, true);
version = 2;
}

if (version == 2) {
editor.putBoolean(Constants.SETTING_JUST_SWAPPED, true);
if (BatteryLevel.getCurrent().is_dockFriendly())
editor.putBoolean(Constants.SETTING_JUST_SWAPPED, true);
version = 3;
}

if (version == 3) {
boolean showLabel = pref.getBoolean(Constants.SETTING_SHOW_LABEL, Constants.SETTING_SHOW_LABEL_DEFAULT);
if (showLabel && !BatteryLevel.getCurrent().is_dockFriendly())
editor.remove(Constants.SETTING_SHOW_LABEL);
version = 4;
}

editor.putInt(Constants.SETTING_VERSION, version);
if (Build.VERSION.SDK_INT < 9)
editor.commit();
Expand Down

0 comments on commit cd49c04

Please sign in to comment.