Merge pull request #220 from harkin/harkin/fix-potential-wakelock

fix potential wakelock
This commit is contained in:
Moez Bhatti
2015-10-06 00:36:59 -04:00
@@ -16,15 +16,12 @@ public class EndlessJabberWakefulService extends IntentService {
Context context = getApplicationContext(); Context context = getApplicationContext();
// Get the class to call // Get the class to call
String implemenationClass = context.getSharedPreferences("EndlessJabberSDK", Context.MODE_PRIVATE).getString("InterfaceClass", null); String implementationClass = context.getSharedPreferences("EndlessJabberSDK", Context.MODE_PRIVATE).getString("InterfaceClass", null);
if (implemenationClass == null) {
return;
}
if (implementationClass != null) {
IEndlessJabberImplementation instanceOfMyClass; IEndlessJabberImplementation instanceOfMyClass;
try { try {
instanceOfMyClass = (IEndlessJabberImplementation) Class.forName(implemenationClass).newInstance(); instanceOfMyClass = (IEndlessJabberImplementation) Class.forName(implementationClass).newInstance();
Bundle extras = intent.getExtras(); Bundle extras = intent.getExtras();
@@ -69,10 +66,14 @@ public class EndlessJabberWakefulService extends IntentService {
break; break;
} }
} }
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { } catch (InstantiationException e) {
} catch (IllegalAccessException e) {
} catch (ClassNotFoundException e) {
} }
}
EndlessJabberReceiver.completeWakefulIntent(intent); EndlessJabberReceiver.completeWakefulIntent(intent);
} }
} }