mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 607387 - android restarter spins for ever waiting for fennec to die r=mwu a=blocking-fennec
This commit is contained in:
parent
97a46aa911
commit
5afc1bb7db
@ -72,11 +72,12 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<receiver android:enabled="true" android:name="Restarter">
|
||||
<activity android:enabled="true" android:name="Restarter">
|
||||
<intent-filter>
|
||||
<action android:name="org.mozilla.gecko.restart@MOZ_APP_NAME@" />
|
||||
<action android:name="org.mozilla.gecko.restart@MOZ_APP_NAME@"
|
||||
android:process="@MOZ_APP_NAME@Restarter"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</activity>
|
||||
#if MOZ_CRASHREPORTER
|
||||
<activity android:name="CrashReporter"
|
||||
android:label="@MOZ_APP_DISPLAYNAME@ Crash Reporter"
|
||||
|
@ -447,8 +447,9 @@ abstract public class GeckoApp
|
||||
intent.setClassName("org.mozilla." + getAppName(),
|
||||
"org.mozilla." + getAppName() + ".Restarter");
|
||||
addEnvToIntent(intent);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
Log.i("GeckoAppJava", intent.toString());
|
||||
sendBroadcast(intent);
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Log.i("GeckoAppJava", e.toString());
|
||||
}
|
||||
|
@ -38,17 +38,19 @@
|
||||
#filter substitution
|
||||
package org.mozilla.@MOZ_APP_NAME@;
|
||||
|
||||
import android.app.*;
|
||||
import android.content.*;
|
||||
import android.util.*;
|
||||
import android.os.*;
|
||||
import java.io.*;
|
||||
|
||||
public class Restarter extends BroadcastReceiver {
|
||||
public class Restarter extends Activity {
|
||||
@Override
|
||||
public void onReceive(Context aContext, Intent aIntent) {
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
Log.i("Restarter", "trying to restart @MOZ_APP_NAME@");
|
||||
try {
|
||||
boolean stillRunning;
|
||||
int spinCountdown = 8;
|
||||
do {
|
||||
stillRunning = false;
|
||||
java.lang.Process p = Runtime.getRuntime().exec("/system/bin/ps");
|
||||
@ -68,7 +70,11 @@ public class Restarter extends BroadcastReceiver {
|
||||
}
|
||||
}
|
||||
}
|
||||
} while(stillRunning);
|
||||
if (stillRunning)
|
||||
spinCountdown--;
|
||||
else
|
||||
spinCountdown = 0;
|
||||
} while(spinCountdown != 0);
|
||||
} catch (Exception e) {
|
||||
Log.i("Restarter", e.toString());
|
||||
}
|
||||
@ -77,12 +83,12 @@ public class Restarter extends BroadcastReceiver {
|
||||
Intent intent = new Intent(action);
|
||||
intent.setClassName("org.mozilla.@MOZ_APP_NAME@",
|
||||
"org.mozilla.@MOZ_APP_NAME@.App");
|
||||
Bundle b = aIntent.getExtras();
|
||||
Bundle b = getIntent().getExtras();
|
||||
if (b != null)
|
||||
intent.putExtras(b);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
Log.i("GeckoAppJava", intent.toString());
|
||||
aContext.startActivity(intent);
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Log.i("Restarter", e.toString());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user