mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Add a 'do not auto start application' setting
This commit is contained in:
parent
9633d4ccb8
commit
b38d2f89cf
4 changed files with 34 additions and 8 deletions
|
|
@ -48,6 +48,8 @@
|
|||
-(void) setupUI;
|
||||
-(void) setupGSMInteraction;
|
||||
|
||||
-(void) startApplication;
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIWindow *window;
|
||||
@property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController;
|
||||
@property (nonatomic, retain) ABPeoplePickerNavigationController* myPeoplePickerController;
|
||||
|
|
|
|||
|
|
@ -94,6 +94,15 @@ int __aeabi_idiv(int a, int b) {
|
|||
}
|
||||
}
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
|
||||
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
|
||||
&& [[NSUserDefaults standardUserDefaults] boolForKey:@"disable_autoboot_preference"]) {
|
||||
// autoboot disabled, doing nothing
|
||||
return;
|
||||
} else if ([LinphoneManager instance] == nil) {
|
||||
[self startApplication];
|
||||
}
|
||||
|
||||
[[LinphoneManager instance] becomeActive];
|
||||
|
||||
if (callCenter == nil) {
|
||||
|
|
@ -223,22 +232,30 @@ int __aeabi_idiv(int a, int b) {
|
|||
nil];
|
||||
|
||||
[self loadDefaultSettings: appDefaults];
|
||||
|
||||
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
|
||||
&& [UIApplication sharedApplication].applicationState == UIApplicationStateBackground
|
||||
&& [[NSUserDefaults standardUserDefaults] boolForKey:@"disable_autoboot_preference"]) {
|
||||
// autoboot disabled, doing nothing
|
||||
} else {
|
||||
[self startApplication];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) startApplication {
|
||||
/* explicitely instanciate LinphoneManager */
|
||||
LinphoneManager* lm = [[LinphoneManager alloc] init];
|
||||
assert(lm == [LinphoneManager instance]);
|
||||
|
||||
|
||||
|
||||
[self setupUI];
|
||||
|
||||
|
||||
[[LinphoneManager instance] startLibLinphone];
|
||||
|
||||
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
|
||||
|
||||
[self setupGSMInteraction];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -65,9 +65,6 @@ extern void libmsbcg729_init();
|
|||
return self;
|
||||
}
|
||||
+(LinphoneManager*) instance {
|
||||
if (theLinphoneManager==nil) {
|
||||
[[LinphoneManager alloc] init];
|
||||
}
|
||||
return theLinphoneManager;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,16 @@
|
|||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
<string>disable_autoboot_preference</string>
|
||||
<key>Title</key>
|
||||
<string>Disable application autostart</string>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>DefaultValue</key>
|
||||
<true/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue