-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent Android cached app freezer from freezing the replay server
- Loading branch information
1 parent
b5ba9bd
commit 193cd3d
Showing
5 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package @RENDERDOC_ANDROID_PACKAGE_NAME@; | ||
import android.app.Notification; | ||
import android.content.Intent; | ||
import android.os.Binder; | ||
import android.os.Handler; | ||
import android.os.HandlerThread; | ||
import android.os.IBinder; | ||
import android.os.Looper; | ||
import android.os.Message; | ||
import android.os.Process; | ||
|
||
public class DummyService extends android.app.Service | ||
{ | ||
private Looper serviceLooper; | ||
private Handler serviceHandler; | ||
|
||
@Override | ||
public void onCreate() { | ||
HandlerThread thread = new HandlerThread("DummyServiceThread", Process.THREAD_PRIORITY_BACKGROUND); | ||
thread.start(); | ||
|
||
serviceLooper = thread.getLooper(); | ||
serviceHandler = new Handler(serviceLooper); | ||
} | ||
|
||
@Override | ||
public int onStartCommand(Intent intent, int flags, int startId) { | ||
Notification notification = new Notification.Builder(this) | ||
.setPriority(Notification.PRIORITY_LOW) | ||
.setSmallIcon(R.drawable.icon) | ||
.setContentTitle("RenderDoc Dummy Foreground Service") | ||
.setContentText("RenderDoc needs this dummy foreground service to prevent cached app freezer from interrupting the network connection") | ||
.build(); | ||
startForeground(startId, notification); | ||
|
||
// If we get killed, don't restart | ||
return START_NOT_STICKY; | ||
} | ||
|
||
@Override | ||
public IBinder onBind(Intent intent) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void onDestroy() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters