Commit e6d88f37 authored by eighthave's avatar eighthave Committed by Georg Koppen
Browse files

Orfox: hook up default panic trigger to "quit and clear"

parent f5b60f66
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -168,6 +168,13 @@
                <data android:pathPattern=".*\\.xpi" />
            </intent-filter>

            <!-- receive triggers from panickit apps -->
            <intent-filter>
                <action android:name="info.guardianproject.panic.action.TRIGGER" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

#ifdef MOZ_ANDROID_BEAM
            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
+34 −27
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ public abstract class GeckoApp extends GeckoActivity
    public static final String ACTION_INIT_PW              = "org.mozilla.gecko.INIT_PW";
    public static final String ACTION_SWITCH_TAB           = "org.mozilla.gecko.SWITCH_TAB";
    public static final String ACTION_SHUTDOWN             = "org.mozilla.gecko.SHUTDOWN";
    public static final String ACTION_PANIC_TRIGGER        = "info.guardianproject.panic.action.TRIGGER";

    public static final String INTENT_REGISTER_STUMBLER_LISTENER = "org.mozilla.gecko.STUMBLER_REGISTER_LOCAL_LISTENER";

@@ -554,6 +555,14 @@ public abstract class GeckoApp extends GeckoActivity
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == R.id.quit) {
            quitAndClear();
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    private void quitAndClear() {
        // Make sure the Guest Browsing notification goes away when we quit.
        GuestSession.hideNotification(this);

@@ -586,10 +595,6 @@ public abstract class GeckoApp extends GeckoActivity
        // We don't call shutdown here because this creates a race condition which
        // can cause the clearing of private data to fail. Instead, we shut down the
        // UI only after we're done sanitizing.
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
@@ -1531,6 +1536,8 @@ public abstract class GeckoApp extends GeckoActivity
            // Copy extras.
            settingsIntent.putExtras(intent.getUnsafe());
            startActivity(settingsIntent);
        } else if (ACTION_PANIC_TRIGGER.equals(action)) {
            quitAndClear();
        }

        mPromptService = new PromptService(this, getAppEventDispatcher());