mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-23 14:18:52 +01:00
Merge pull request #220 from harkin/harkin/fix-potential-wakelock
fix potential wakelock
This commit is contained in:
+9
-8
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user