From 29bbfcc1ba105bde2629969722c2d3f5f0a3cdfe Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 15 Dec 2016 11:48:13 +0100 Subject: [PATCH] Add a check on start of Activity to avoid crash --- AndroidManifest.xml | 441 +++++---- release.patch | 21 +- res/values/strings.xml | 884 +++++++++--------- src/org/linphone/CallActivity.java | 2 +- src/org/linphone/CallIncomingActivity.java | 26 +- src/org/linphone/CallOutgoingActivity.java | 2 +- src/org/linphone/LinphoneActivity.java | 8 +- src/org/linphone/LinphoneGenericActivity.java | 21 + 8 files changed, 731 insertions(+), 674 deletions(-) create mode 100644 src/org/linphone/LinphoneGenericActivity.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index c7929b16b..fcc84342a 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,266 +1,307 @@ - android:versionCode="3214" android:versionName="3.2.1" android:installLocation="auto"> - + - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - + - - - + - - - - - + android:label="@string/app_name" + android:theme="@style/NoTitle" + android:windowSoftInputMode="adjustPan|stateHidden"> - - - - - /> + + + - - - - - - + + + + + + + /> + - - - - - + - + - + + + - + + + + + - - + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + --> - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + + + + + - + - - - - + + + + + + android:resource="@xml/authenticator"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + + + + - + - - - - + - - - + + - + - + - + + + + + - - - + + - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + \ No newline at end of file diff --git a/release.patch b/release.patch index bbd79a658..a98cbc3b3 100644 --- a/release.patch +++ b/release.patch @@ -1,13 +1,14 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml -index 5ef1374..86e13be 100644 +index fcc8434..0e80ea6 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml -@@ -52,7 +52,7 @@ - - - -- -+ - - ++ android:largeHeap="true" ++ android:debuggable="false"> + - - Linphone - Linphone Service - Linphone - Linphone - Starting up - %s registered - %s failed to register - - Linphone Android %s - Linphone Core %s - GNU General Public License V2\n © 2010-2016 Belledonne Communications - www.linphone.org - linphone contacts - EEE, d MMM - yyyy/MM/dd - HH:mm - - yyyy/MM/dd - dd - dd/MM, HH:mm - dd/MM - HH:mm + + Linphone + Linphone Service + Linphone + Linphone + Starting up + %s registered + %s failed to register + + Linphone Android %s + Linphone Core %s + GNU General Public License V2\n © 2010-2016 Belledonne Communications + www.linphone.org + linphone contacts + EEE, d MMM + yyyy/MM/dd - HH:mm - + yyyy/MM/dd + dd + dd/MM, HH:mm + dd/MM + HH:mm - - Username - Phone number - Display name - Password - Password confirmation - Domain - URL - Email - Are you sure you want to delete your selection? - Delete - Retry - Cancel - Accept - Continue - About - Deny - No account configured - Search - Outgoing - Incoming - Missed - Settings - Connection - Decline - Conference - Link - Do you want to link the account %s with your phone number ? - Maybe later - Later - No - Ok - Yes - Link your account + + Username + Phone number + Display name + Password + Password confirmation + Domain + URL + Email + Are you sure you want to delete your selection? + Delete + Retry + Cancel + Accept + Continue + About + Deny + No account configured + Search + Outgoing + Incoming + Missed + Settings + Connection + Decline + Conference + Link + Do you want to link the account %s with your phone number ? + Maybe later + Later + No + Ok + Yes + Link your account - - the libre SIP client + + the libre SIP client - - Welcome - Assistant - Create account - Link account - Continue - Activate your account - Finish configuration - Your account is created. Please check your mails to validate your account: - Once it is done, come back here and click on the button. - This assistant will help you configure and use your SIP account. - Please enter your username and password of Linphone account - Please enter your username and password with your SIP domain - Please provide your provisioning URL - Transport - Your SIP address is - Use Linphone account - Use SIP account - Fetch remote configuration - Please confirm your country code and enter your phone number - We have sent you a SMS with a validation code to your phone number: - To complete your phone number verification, please enter the 4 digit code below:\n - Please enter an username, email and password for your Linphone account - Display name (optional) - Use your Linphone account - Use SIP account - Fetch remote configuration - Fetch and apply - Login - Echo canceler calibration in progress - Enter your login - Your account has not been validated yet. - The confirmation code is invalid.\r\nPlease try again. - Your account has been validated. - Incorrect username or password - Do you agree to download OpenH264 Video Codec provided by Cisco Systems, Inc.? - Downloading OpenH264 Video Codec provided by Cisco Systems, Inc. - Downloading OpenH264 - Before use OpenH264 codec you must restart %s. - Sorry an error has occurred. - OpenH264 Video Codec provided by Cisco Systems, Inc. downloaded. - An error occurred, try again later. - Server unreachable, verify your network connection. - This username is already in use. - This phone number is already in used.\r\nPlease type a different number.\r\nYou can delete your existing account if you want to reuse your phone number. - Your username is invalid. - Your phone number is invalid. - Your email is invalid. - Your password is invalid - Passwords do not match. - Your username will be %s.\r\n\r\nIt may differ from your input to match requirements.\r\nDo you accept? - Please enter your login and password - Forgot password ? - Choose a country - Select your Country - (%s) - Use a username (optional) - Use email address for account validation - Use your username and password instead of your phone number - What will my phone number be used for? - \nThanks to your phone number, your friends will find you more easily.\n\n You will see in your address book who is using Linphone and your friends will know that they can rach you on Linphone as well.\n - \nYour friends will find you more easily if you link your account to your phone number\n\nYou will see in your address book who is using Linphone and your friends will know that they can reach you on Linphone as well.\n - You can only use your phone number with one Linphone account.\n\nIf you had already linked your number to an other account but you prefer to use this one, simply link it now and your number will automatically be moved to this account. + + Welcome + Assistant + Create account + Link account + Continue + Activate your account + Finish configuration + Your account is created. Please check your mails to validate your account: + Once it is done, come back here and click on the button. + This assistant will help you configure and use your SIP account. + Please enter your username and password of Linphone account + Please enter your username and password with your SIP domain + Please provide your provisioning URL + Transport + Your SIP address is + Use Linphone account + Use SIP account + Fetch remote configuration + Please confirm your country code and enter your phone number + We have sent you a SMS with a validation code to your phone number: + To complete your phone number verification, please enter the 4 digit code below:\n + Please enter an username, email and password for your Linphone account + Display name (optional) + Use your Linphone account + Use SIP account + Fetch remote configuration + Fetch and apply + Login + Echo canceler calibration in progress + Enter your login + Your account has not been validated yet. + The confirmation code is invalid.\r\nPlease try again. + Your account has been validated. + Incorrect username or password + Do you agree to download OpenH264 Video Codec provided by Cisco Systems, Inc.? + Downloading OpenH264 Video Codec provided by Cisco Systems, Inc. + Downloading OpenH264 + Before use OpenH264 codec you must restart %s. + Sorry an error has occurred. + OpenH264 Video Codec provided by Cisco Systems, Inc. downloaded. + An error occurred, try again later. + Server unreachable, verify your network connection. + This username is already in use. + This phone number is already in used.\r\nPlease type a different number.\r\nYou can delete your existing account if you want to reuse your phone number. + Your username is invalid. + Your phone number is invalid. + Your email is invalid. + Your password is invalid + Passwords do not match. + Your username will be %s.\r\n\r\nIt may differ from your input to match requirements.\r\nDo you accept? + Please enter your login and password + Forgot password ? + Choose a country + Select your Country + (%s) + Use a username (optional) + Use email address for account validation + Use your username and password instead of your phone number + What will my phone number be used for? + \nThanks to your phone number, your friends will find you more easily.\n\n You will see in your address book who is using Linphone and your friends will know that they can rach you on Linphone as well.\n + \nYour friends will find you more easily if you link your account to your phone number\n\nYou will see in your address book who is using Linphone and your friends will know that they can reach you on Linphone as well.\n + You can only use your phone number with one Linphone account.\n\nIf you had already linked your number to an other account but you prefer to use this one, simply link it now and your number will automatically be moved to this account. - - Invalid email - Account already exist - This account does not exist - Invalid username - Invalid domain - Invalid route - Invalid display name - Username too short - Username too long - Username length invalid - Phone number too long - Phone number too short - Invalid phone number - Password too short - Password too long - Failed to query the server. Please try again later - Unsupported transport - Country code invalid + + Invalid email + Account already exist + This account does not exist + Invalid username + Invalid domain + Invalid route + Invalid display name + Username too short + Username too long + Username length invalid + Phone number too long + Phone number too short + Invalid phone number + Password too short + Password too long + Failed to query the server. Please try again later + Unsupported transport + Country code invalid - - In-app - In-app purchase - The trail period expires on %s - The subscription period expires on %s + + In-app + In-app purchase + The trail period expires on %s + The subscription period expires on %s - - Enter a number or an address + + Enter a number or an address - - No call in your history - No missed call in your history - Do you want to delete selected call log? - Today - Yesterday + + No call in your history + No missed call in your history + Do you want to delete selected call log? + Today + Yesterday - - No contact in your address book. - No SIP contact in your address book. - Do you want to delete selected contacts? - Do you want to delete selected contact? - SIP address - First name - Last name - Organization + + No contact in your address book. + No SIP contact in your address book. + Do you want to delete selected contacts? + Do you want to delete selected contact? + SIP address + First name + Last name + Organization - - No conversations - Do you want to delete selected conversation? - Do you want to delete selected message? - Remote is writing... - Small - Medium - Large - Real size - Text copied to clipboard - Copy text - Select source - Image saved - Error, image not saved - Please wait... - Processing image, can take up to a few seconds depending on the size of the file + + No conversations + Do you want to delete selected conversation? + Do you want to delete selected message? + Remote is writing... + Small + Medium + Large + Real size + Text copied to clipboard + Copy text + Select source + Image saved + Error, image not saved + Please wait... + Processing image, can take up to a few seconds depending on the size of the file - - Registered - Not registered - Registration in progress - Registration failed - unread messages + + Registered + Not registered + Registration in progress + Registration failed + unread messages - - Assistant - Settings - About - Quit + + Assistant + Settings + About + Quit - - incoming call - outgoing call - Your correspondent would like to turn on video - No active call - Your correspondent paused the call - An error occurred while accepting the call - ZRTP token is %s\nYou should only accept if you have the same token as your correspondent - Unknown - Audio - Video - Codec: - IP Family: - Upload bandwidth: - Download bandwidth: - ICE connectivity: - Sent video resolution: - Received video resolution: - Sender loss rate: - Receiver loss rate: - Encoder: - Decoder: - Call + + incoming call + outgoing call + Your correspondent would like to turn on video + No active call + Your correspondent paused the call + An error occurred while accepting the call + ZRTP token is %s\nYou should only accept if you have the same token as your correspondent + Unknown + Audio + Video + Codec: + IP Family: + Upload bandwidth: + Download bandwidth: + ICE connectivity: + Sent video resolution: + Received video resolution: + Sender loss rate: + Receiver loss rate: + Encoder: + Decoder: + Call - - Send log - Reset log + + Send log + Reset log - - Audio call ongoing - Paused call ongoing - Video capturing call ongoing - started - %i unread messages - Missed call - %i missed calls + + Audio call ongoing + Paused call ongoing + Video capturing call ongoing + started + %i unread messages + Missed call + %i missed calls - - Warning: service is not ready - Error - Cannot build destination address from %s - Unknown error - Call declined - User busy - User not found - Incompatible media parameters - Your correspondent has low bandwidth, video cannot be started - Network is unreachable - Bad credentials - Unauthorized - Network error - Download failed. Please check your network connection or try again later. - Failed to download or apply remote provisioning profile... - Remote provisioning - Do you want to change the provisioning URI? + + Warning: service is not ready + Error + Cannot build destination address from %s + Unknown error + Call declined + User busy + User not found + Incompatible media parameters + Your correspondent has low bandwidth, video cannot be started + Network is unreachable + Bad credentials + Unauthorized + Network error + Download failed. Please check your network connection or try again later. + Failed to download or apply remote provisioning profile... + Remote provisioning + Do you want to change the provisioning URI? - - SIP Account - Manage - Disable - Proxy - Domain* - Password* - Username* - Outbound proxy - SIP proxy hostname or ip address (optional) - Route all calls through SIP proxy - Example: john if your account is john@sip.example.org - sip.example.org if your account is john@sip.example.org - You have to re-enter your password if you edit your username and/or the domain - Expire - AVPF - AVPF regular RTCP interval in seconds (between 1 and 5) - Replace + by 00 - Friendlist subscribe - Link your account - Auth userid - Enter authentication userid (optional) - Display name - Enter display name (optional) - Prefix - Transport - UDP - TCP - TLS - Delete this account - Change password - Use as default - Password changed + + SIP Account + Manage + Disable + Proxy + Domain* + Password* + Username* + Outbound proxy + SIP proxy hostname or ip address (optional) + Route all calls through SIP proxy + Example: john if your account is john@sip.example.org + sip.example.org if your account is john@sip.example.org + You have to re-enter your password if you edit your username and/or the domain + Expire + AVPF + AVPF regular RTCP interval in seconds (between 1 and 5) + Replace + by 00 + Friendlist subscribe + Link your account + Auth userid + Enter authentication userid (optional) + Display name + Enter display name (optional) + Prefix + Transport + UDP + TCP + TLS + Delete this account + Change password + Use as default + Password changed - - SIP Accounts - Default account - Add account - In-app Store - Tunnel - Hostname - Port - Mode - - - disabled - 3G only - always - auto - - None - Preferences - Enable Video + + SIP Accounts + Default account + Add account + In-app Store + Tunnel + Hostname + Port + Mode + + + disabled + 3G only + always + auto + + None + Preferences + Enable Video - - Audio - Echo cancellation - Removes the echo heard by other end - Echo canceler calibration - Test echo - Calibrating… - Calibrated in %s ms - No echo - failed - Adaptive rate control - Codec bitrate limit - Codecs + + Audio + Echo cancellation + Removes the echo heard by other end + Echo canceler calibration + Test echo + Calibrating… + Calibrated in %s ms + No echo + failed + Adaptive rate control + Codec bitrate limit + Codecs - - Video - Video overlay - Display call video in overlay when outside the application - Use front camera - Initiate video calls - Always send video requests - Accept incoming video requests - Always accept video requests - Video preset - Preferred video size - Preferred FPS + + Video + Video overlay + Display call video in overlay when outside the application + Use front camera + Initiate video calls + Always send video requests + Accept incoming video requests + Always accept video requests + Video preset + Preferred video size + Preferred FPS - Bandwidth limit in kbits/s - Codecs + Bandwidth limit in kbits/s + Codecs - - Call - Use device ringtone - Auto answer incoming calls - Send in-band DTMFs(RFC2833) - Send out-band DTMFs(SIP INFO) - Voice mail URI + + Call + Use device ringtone + Auto answer incoming calls + Send in-band DTMFs(RFC2833) + Send out-band DTMFs(SIP INFO) + Voice mail URI - - Chat - Sharing server - Do not edit unless you know what you are doing! - Use LIME encryption - Disabled - Mandatory - Preferred + + Chat + Sharing server + Do not edit unless you know what you are doing! + Use LIME encryption + Disabled + Mandatory + Preferred - - Network - Use WiFi only - STUN / TURN server - Enable ICE - Enable TURN - STUN / TURN username (optional) - STUN / TURN password (optional) - Enable UPNP - Use random ports - SIP port to use - Video port or port range - Audio port or port range - Video port or port range (minport-maxport) - Audio port or port range (minport-maxport) - Media encryption - Enable push notifications - Allow IPv6 + + Network + Use WiFi only + STUN / TURN server + Enable ICE + Enable TURN + STUN / TURN username (optional) + STUN / TURN password (optional) + Enable UPNP + Use random ports + SIP port to use + Video port or port range + Audio port or port range + Video port or port range (minport-maxport) + Audio port or port range (minport-maxport) + Media encryption + Enable push notifications + Allow IPv6 - - Advanced - Debug - Background mode - Enable Animations - Enable service notification - Start at boot time - Incoming call hangup (in seconds) - Remote provisioning - Android app settings - Primary account - Display name - Username + + Advanced + Debug + Background mode + Enable Animations + Enable service notification + Start at boot time + Incoming call hangup (in seconds) + Remote provisioning + Android app settings + Primary account + Display name + Username - - Audio hacks - Use specific mode hack - 0=MODE_NORMAL (default), 2=MODE_IN_CALL - Use routing API hack - Use Galaxy S audio hack + + Audio hacks + Use specific mode hack + 0=MODE_NORMAL (default), 2=MODE_IN_CALL + Use routing API hack + Use Galaxy S audio hack - - Back - Dialer - Menu - Toggle micro - Toggle speaker - Decline - Hang up - Accept - Edit - Edit List - Valid - Add to contacts - New contact - Call - Backspace - Chat - Dial back - Return to dialer - Contact picture - Send message - Details - Delete - Add call - New discussion - Search - Search contact - Search country - All contacts - Linphone contacts - Call direction - All calls - Missed calls - Switch video - Add call - Pause - Numpad - History button - Chat button - Contacts button - Call quality - Encryption - Switch camera - Cancel button - Message status - Conference - Username field - Username field - Phone number field - Display name field - Domain field - Remote provisioning field - Confirm password field - Email field - Default account - Deselect all - Select all - Delete selection - First name - Last name - Organization - Back to call - Send a file - Message - Unread chat message - Transfer - Earpiece - Bluetooth - Call options - Audio route - Exit conference + + Back + Dialer + Menu + Toggle micro + Toggle speaker + Decline + Hang up + Accept + Edit + Edit List + Valid + Add to contacts + New contact + Call + Backspace + Chat + Dial back + Return to dialer + Contact picture + Send message + Details + Delete + Add call + New discussion + Search + Search contact + Search country + All contacts + Linphone contacts + Call direction + All calls + Missed calls + Switch video + Add call + Pause + Numpad + History button + Chat button + Contacts button + Call quality + Encryption + Switch camera + Cancel button + Message status + Conference + Username field + Username field + Phone number field + Display name field + Domain field + Remote provisioning field + Confirm password field + Email field + Default account + Deselect all + Select all + Delete selection + First name + Last name + Organization + Back to call + Send a file + Message + Unread chat message + Transfer + Earpiece + Bluetooth + Call options + Audio route + Exit conference diff --git a/src/org/linphone/CallActivity.java b/src/org/linphone/CallActivity.java index 280f623aa..956ebd4e4 100644 --- a/src/org/linphone/CallActivity.java +++ b/src/org/linphone/CallActivity.java @@ -79,7 +79,7 @@ import android.widget.Toast; /** * @author Sylvain Berfini */ -public class CallActivity extends Activity implements OnClickListener, SensorEventListener, ActivityCompat.OnRequestPermissionsResultCallback { +public class CallActivity extends LinphoneGenericActivity implements OnClickListener, SensorEventListener, ActivityCompat.OnRequestPermissionsResultCallback { private final static int SECONDS_BEFORE_HIDING_CONTROLS = 4000; private final static int SECONDS_BEFORE_DENYING_CALL_UPDATE = 30000; private static final int PERMISSIONS_REQUEST_CAMERA = 202; diff --git a/src/org/linphone/CallIncomingActivity.java b/src/org/linphone/CallIncomingActivity.java index 1dcf792ab..5b67cf417 100644 --- a/src/org/linphone/CallIncomingActivity.java +++ b/src/org/linphone/CallIncomingActivity.java @@ -48,7 +48,7 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; -public class CallIncomingActivity extends Activity implements LinphoneSliderTriggered { +public class CallIncomingActivity extends LinphoneGenericActivity implements LinphoneSliderTriggered { private static CallIncomingActivity instance; private TextView name, number; @@ -72,7 +72,7 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + if (getResources().getBoolean(R.bool.orientation_portrait_only)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } @@ -210,7 +210,7 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig if (lc != null) { lc.addListener(mListener); } - + alreadyAcceptedOrDeniedCall = false; mCall = null; @@ -230,8 +230,8 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig finish(); return; } - - + + LinphoneAddress address = mCall.getRemoteAddress(); LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address); if (contact != null) { @@ -242,7 +242,7 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig } number.setText(address.asStringUriOnly()); } - + @Override protected void onStart() { super.onStart(); @@ -278,7 +278,7 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig return; } alreadyAcceptedOrDeniedCall = true; - + LinphoneManager.getLc().terminateCall(mCall); finish(); } @@ -288,7 +288,7 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig return; } alreadyAcceptedOrDeniedCall = true; - + LinphoneCallParams params = LinphoneManager.getLc().createCallParams(mCall); boolean isLowBandwidthConnection = !LinphoneUtils.isHighBandwidthConnection(LinphoneService.instance().getApplicationContext()); @@ -320,15 +320,15 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig public void onRightHandleTriggered() { } - + private void checkAndRequestCallPermissions() { ArrayList permissionsList = new ArrayList(); - + int recordAudio = getPackageManager().checkPermission(Manifest.permission.RECORD_AUDIO, getPackageName()); Log.i("[Permission] Record audio permission is " + (recordAudio == PackageManager.PERMISSION_GRANTED ? "granted" : "denied")); int camera = getPackageManager().checkPermission(Manifest.permission.CAMERA, getPackageName()); Log.i("[Permission] Camera permission is " + (camera == PackageManager.PERMISSION_GRANTED ? "granted" : "denied")); - + if (recordAudio != PackageManager.PERMISSION_GRANTED) { if (LinphonePreferences.instance().firstTimeAskingForPermission(Manifest.permission.RECORD_AUDIO) || ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.RECORD_AUDIO)) { Log.i("[Permission] Asking for record audio"); @@ -343,14 +343,14 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig } } } - + if (permissionsList.size() > 0) { String[] permissions = new String[permissionsList.size()]; permissions = permissionsList.toArray(permissions); ActivityCompat.requestPermissions(this, permissions, 0); } } - + @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { for (int i = 0; i < permissions.length; i++) { diff --git a/src/org/linphone/CallOutgoingActivity.java b/src/org/linphone/CallOutgoingActivity.java index 8c2eb0355..0bee6cadd 100644 --- a/src/org/linphone/CallOutgoingActivity.java +++ b/src/org/linphone/CallOutgoingActivity.java @@ -46,7 +46,7 @@ import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; -public class CallOutgoingActivity extends Activity implements OnClickListener{ +public class CallOutgoingActivity extends LinphoneGenericActivity implements OnClickListener{ private static CallOutgoingActivity instance; private TextView name, number; diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index c46e57468..e819facf8 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -99,7 +99,7 @@ import android.widget.Toast; /** * @author Sylvain Berfini */ -public class LinphoneActivity extends Activity implements OnClickListener, ContactPicked, ActivityCompat.OnRequestPermissionsResultCallback { +public class LinphoneActivity extends LinphoneGenericActivity implements OnClickListener, ContactPicked, ActivityCompat.OnRequestPermissionsResultCallback { public static final String PREF_FIRST_LAUNCH = "pref_first_launch"; private static final int SETTINGS_ACTIVITY = 123; private static final int CALL_ACTIVITY = 19; @@ -157,12 +157,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } - if (!LinphoneManager.isInstanciated()) { - finish(); - startActivity(getIntent().setClass(this, LinphoneLauncherActivity.class)); - return; - } - boolean useFirstLoginActivity = getResources().getBoolean(R.bool.display_account_assistant_at_first_start); if (LinphonePreferences.instance().isProvisioningLoginViewEnabled()) { Intent wizard = new Intent(); diff --git a/src/org/linphone/LinphoneGenericActivity.java b/src/org/linphone/LinphoneGenericActivity.java new file mode 100644 index 000000000..9b65d471b --- /dev/null +++ b/src/org/linphone/LinphoneGenericActivity.java @@ -0,0 +1,21 @@ +package org.linphone; + +import android.app.Activity; +import android.os.Bundle; + +public class LinphoneGenericActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + /*After a crash, Android restart the last Activity so we need to check + * if all dependencies are load + */ + if (!LinphoneManager.isInstanciated()) { + finish(); + startActivity(getIntent().setClass(this, LinphoneLauncherActivity.class)); + return; + } + } +}