mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 719795 - Crash when GeckoSmsManager.init is called more than once [r=blassey,mounir]
This commit is contained in:
parent
579a04386b
commit
e7bef730ca
@ -414,7 +414,7 @@ abstract public class GeckoApp
|
||||
registerReceiver(mBatteryReceiver, batteryFilter);
|
||||
|
||||
if (SmsManager.getInstance() != null) {
|
||||
SmsManager.getInstance().init();
|
||||
SmsManager.getInstance().start();
|
||||
}
|
||||
|
||||
GeckoNetworkManager.getInstance().init();
|
||||
@ -580,7 +580,9 @@ abstract public class GeckoApp
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_SHUTDOWN));
|
||||
|
||||
if (SmsManager.getInstance() != null) {
|
||||
SmsManager.getInstance().shutdown();
|
||||
SmsManager.getInstance().stop();
|
||||
if (isFinishing())
|
||||
SmsManager.getInstance().shutdown();
|
||||
}
|
||||
|
||||
GeckoNetworkManager.getInstance().stop();
|
||||
|
@ -356,15 +356,17 @@ public class GeckoSmsManager
|
||||
|
||||
private final static String[] kRequiredMessageRows = new String[] { "_id", "address", "body", "date", "type" };
|
||||
|
||||
public void init() {
|
||||
public GeckoSmsManager() {
|
||||
SmsIOThread.getInstance().start();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
IntentFilter smsFilter = new IntentFilter();
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_RECEIVED);
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_SENT);
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_DELIVERED);
|
||||
|
||||
GeckoApp.mAppContext.registerReceiver(this, smsFilter);
|
||||
|
||||
SmsIOThread.getInstance().start();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -925,9 +927,11 @@ public class GeckoSmsManager
|
||||
MessagesListManager.getInstance().remove(aListId);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
public void stop() {
|
||||
GeckoApp.mAppContext.unregisterReceiver(this);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
SmsIOThread.getInstance().interrupt();
|
||||
MessagesListManager.getInstance().clear();
|
||||
}
|
||||
|
@ -57,7 +57,8 @@ class SmsManager
|
||||
|
||||
interface ISmsManager
|
||||
{
|
||||
public void init();
|
||||
public void start();
|
||||
public void stop();
|
||||
public void shutdown();
|
||||
|
||||
public int getNumberOfMessagesForText(String aText);
|
||||
|
@ -1693,13 +1693,13 @@ abstract public class GeckoApp
|
||||
registerReceiver(mBatteryReceiver, batteryFilter);
|
||||
|
||||
if (SmsManager.getInstance() != null) {
|
||||
SmsManager.getInstance().init();
|
||||
SmsManager.getInstance().start();
|
||||
}
|
||||
|
||||
GeckoNetworkManager.getInstance().init();
|
||||
|
||||
final GeckoApp self = this;
|
||||
|
||||
|
||||
GeckoAppShell.getHandler().postDelayed(new Runnable() {
|
||||
public void run() {
|
||||
Log.w(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - pre checkLaunchState");
|
||||
@ -2016,7 +2016,9 @@ abstract public class GeckoApp
|
||||
mFavicons.close();
|
||||
|
||||
if (SmsManager.getInstance() != null) {
|
||||
SmsManager.getInstance().shutdown();
|
||||
SmsManager.getInstance().stop();
|
||||
if (isFinishing())
|
||||
SmsManager.getInstance().shutdown();
|
||||
}
|
||||
|
||||
GeckoNetworkManager.getInstance().stop();
|
||||
|
@ -356,15 +356,17 @@ public class GeckoSmsManager
|
||||
|
||||
private final static String[] kRequiredMessageRows = new String[] { "_id", "address", "body", "date", "type" };
|
||||
|
||||
public void init() {
|
||||
public GeckoSmsManager() {
|
||||
SmsIOThread.getInstance().start();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
IntentFilter smsFilter = new IntentFilter();
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_RECEIVED);
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_SENT);
|
||||
smsFilter.addAction(GeckoSmsManager.ACTION_SMS_DELIVERED);
|
||||
|
||||
GeckoApp.mAppContext.registerReceiver(this, smsFilter);
|
||||
|
||||
SmsIOThread.getInstance().start();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -925,9 +927,11 @@ public class GeckoSmsManager
|
||||
MessagesListManager.getInstance().remove(aListId);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
public void stop() {
|
||||
GeckoApp.mAppContext.unregisterReceiver(this);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
SmsIOThread.getInstance().interrupt();
|
||||
MessagesListManager.getInstance().clear();
|
||||
}
|
||||
|
@ -57,7 +57,8 @@ class SmsManager
|
||||
|
||||
interface ISmsManager
|
||||
{
|
||||
public void init();
|
||||
public void start();
|
||||
public void stop();
|
||||
public void shutdown();
|
||||
|
||||
public int getNumberOfMessagesForText(String aText);
|
||||
|
Loading…
Reference in New Issue
Block a user