mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-20 07:58:27 +00:00
Workaround for Android bug when swiped from recent tasks list.
Closes #168 https://code.google.com/p/android/issues/detail?id=53313
This commit is contained in:
parent
0f53c9d170
commit
b5fe378bc9
@ -189,6 +189,17 @@
|
|||||||
android:windowSoftInputMode="stateHidden"
|
android:windowSoftInputMode="stateHidden"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
|
<activity android:name=".DummyActivity"
|
||||||
|
android:theme="@android:style/Theme.NoDisplay"
|
||||||
|
android:enabled="true"
|
||||||
|
android:allowTaskReparenting="true"
|
||||||
|
android:noHistory="true"
|
||||||
|
android:excludeFromRecents="true"
|
||||||
|
android:alwaysRetainTaskState="false"
|
||||||
|
android:stateNotNeeded="true"
|
||||||
|
android:clearTaskOnLaunch="true"
|
||||||
|
android:finishOnTaskLaunch="true" />
|
||||||
|
|
||||||
<service android:enabled="true" android:name=".service.ApplicationMigrationService"/>
|
<service android:enabled="true" android:name=".service.ApplicationMigrationService"/>
|
||||||
<service android:enabled="true" android:name=".service.KeyCachingService"/>
|
<service android:enabled="true" android:name=".service.KeyCachingService"/>
|
||||||
<service android:enabled="true" android:name=".service.SendReceiveService"/>
|
<service android:enabled="true" android:name=".service.SendReceiveService"/>
|
||||||
|
16
src/org/thoughtcrime/securesms/DummyActivity.java
Normal file
16
src/org/thoughtcrime/securesms/DummyActivity.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package org.thoughtcrime.securesms;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Workaround for Android bug:
|
||||||
|
* https://code.google.com/p/android/issues/detail?id=53313
|
||||||
|
*/
|
||||||
|
public class DummyActivity extends Activity {
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle bundle) {
|
||||||
|
super.onCreate(bundle);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
@ -33,6 +33,7 @@ import android.util.Log;
|
|||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.DatabaseUpgradeActivity;
|
import org.thoughtcrime.securesms.DatabaseUpgradeActivity;
|
||||||
|
import org.thoughtcrime.securesms.DummyActivity;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.RoutingActivity;
|
import org.thoughtcrime.securesms.RoutingActivity;
|
||||||
import org.thoughtcrime.securesms.crypto.DecryptingQueue;
|
import org.thoughtcrime.securesms.crypto.DecryptingQueue;
|
||||||
@ -133,6 +134,17 @@ public class KeyCachingService extends Service {
|
|||||||
handleClearKey();
|
handleClearKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Workaround for Android bug:
|
||||||
|
* https://code.google.com/p/android/issues/detail?id=53313
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onTaskRemoved(Intent rootIntent) {
|
||||||
|
Intent intent = new Intent(this, DummyActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
private void handleActivityStarted() {
|
private void handleActivityStarted() {
|
||||||
Log.w("KeyCachingService", "Incrementing activity count...");
|
Log.w("KeyCachingService", "Incrementing activity count...");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user