mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-21 23:15:23 +00:00
Compare against existing Build.VERSION_CODES.
The 1.X Android versions don't have the 2.X VERSION_CODE symbols, so comparing against them in order to make 1.6 choices will throw runtime exceptions.
This commit is contained in:
parent
bbea3fe1b1
commit
8a6a1a5f03
@ -77,7 +77,7 @@ public class ApplicationPreferencesActivity extends PreferenceActivity {
|
||||
super.onCreate(icicle);
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ECLAIR) {
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.DONUT) {
|
||||
CheckBoxPreference mmsPreference = (CheckBoxPreference)this.findPreference("pref_all_mms");
|
||||
mmsPreference.setChecked(false);
|
||||
mmsPreference.setEnabled(false);
|
||||
@ -133,7 +133,7 @@ public class ApplicationPreferencesActivity extends PreferenceActivity {
|
||||
}
|
||||
|
||||
public static boolean showIcon() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR;
|
||||
return Build.VERSION.SDK_INT > Build.VERSION_CODES.DONUT;
|
||||
}
|
||||
|
||||
private void handleIdentitySelection(Intent data) {
|
||||
|
@ -50,7 +50,7 @@ public abstract class ContactAccessor {
|
||||
if (sInstance == null) {
|
||||
String className;
|
||||
|
||||
if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.ECLAIR)
|
||||
if (Integer.parseInt(Build.VERSION.SDK) <= Build.VERSION_CODES.DONUT)
|
||||
className = "ContactAccessorOldApi";
|
||||
else
|
||||
className = "ContactAccessorNewApi";
|
||||
|
@ -47,7 +47,7 @@ public class RecipientFactory {
|
||||
|
||||
int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
|
||||
|
||||
if (sdkVersion < Build.VERSION_CODES.ECLAIR) className = "OldRecipientProvider";
|
||||
if (sdkVersion <= Build.VERSION_CODES.DONUT) className = "OldRecipientProvider";
|
||||
else className = "NewRecipientProvider";
|
||||
|
||||
try {
|
||||
|
@ -33,7 +33,7 @@ import android.util.Log;
|
||||
public class MmsListener extends BroadcastReceiver {
|
||||
|
||||
private boolean isRelevent(Context context, Intent intent) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ECLAIR)
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.DONUT)
|
||||
return false;
|
||||
|
||||
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean(ApplicationPreferencesActivity.ALL_MMS_PERF, true))
|
||||
|
Loading…
Reference in New Issue
Block a user