Fixed possible crashes

This commit is contained in:
DrKLO 2014-03-26 16:24:54 +04:00
parent fc8f91a3b7
commit 0e9d92e8f9
3 changed files with 8 additions and 8 deletions

View File

@ -27,11 +27,11 @@ package org.telegram.PhoneFormat;
import java.util.ArrayList; import java.util.ArrayList;
public class CallingCodeInfo { public class CallingCodeInfo {
public ArrayList<String> countries; public ArrayList<String> countries = new ArrayList<String>();
public String callingCode; public String callingCode = "";
public ArrayList<String> trunkPrefixes; public ArrayList<String> trunkPrefixes = new ArrayList<String>();
public ArrayList<String> intlPrefixes; public ArrayList<String> intlPrefixes = new ArrayList<String>();
public ArrayList<RuleSet> ruleSets; public ArrayList<RuleSet> ruleSets = new ArrayList<RuleSet>();
//public ArrayList formatStrings; //public ArrayList formatStrings;
String matchingAccessCode(String str) { String matchingAccessCode(String str) {

View File

@ -30,7 +30,7 @@ import java.util.regex.Pattern;
public class RuleSet { public class RuleSet {
public int matchLen; public int matchLen;
public ArrayList<PhoneRule> rules; public ArrayList<PhoneRule> rules = new ArrayList<PhoneRule>();
public boolean hasRuleWithIntlPrefix; public boolean hasRuleWithIntlPrefix;
public boolean hasRuleWithTrunkPrefix; public boolean hasRuleWithTrunkPrefix;
public static Pattern pattern = Pattern.compile("[0-9]+"); public static Pattern pattern = Pattern.compile("[0-9]+");

View File

@ -831,7 +831,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
recordDialogId = dialog_id; recordDialogId = dialog_id;
fileBuffer.rewind(); fileBuffer.rewind();
if (android.os.Build.VERSION.SDK_INT >= 16) { /*if (android.os.Build.VERSION.SDK_INT >= 16) { some devices crash with it
AutomaticGainControl agc = null; AutomaticGainControl agc = null;
try { try {
if (AutomaticGainControl.isAvailable()) { if (AutomaticGainControl.isAvailable()) {
@ -850,7 +850,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
} }
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
} }*/
audioRecorder.startRecording(); audioRecorder.startRecording();
} catch (Exception e) { } catch (Exception e) {