Getting log of why Android app is moved from foreg

2019-08-21 12:46发布

问题:

I have an app that is running on a kiosk. After about 8 hours, the app "goes away". By "goes away" I mean that it is no longer the top most application and that the desktop shows. The app is still running though because it appears after I click the "switch applications" button.

I'm trying to figure out why this is happening. I added

protected void onDestroy() {
    Log.e("here", "onDestroy");
    super.onDestroy();
}

protected void onPause() {
    Log.e("here", "onPause");
    super.onPause();
}


protected void onStop() {
    Log.e("here", "onStop");
    super.onStop();
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.e("here", "onCreate");

    super.onCreate(savedInstanceState);
    webView = (WebView) findViewById(R.id.webView);

    Thread.setDefaultUncaughtExceptionHandler(
                new Thread.UncaughtExceptionHandler() {
                    public void uncaughtException(Thread thread, Throwable ex) {
                    };
                }
        );

I was thinking this way when I take a bug report I will see what is happening. However, none of the stuff is appearning in the log.

10-31 18:44:03.400   354   397 W InputDispatcher: channel '41327498 com.here/com.here.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
10-31 18:44:03.400   354   397 E InputDispatcher: channel '41327498 com.here/com.here.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
10-31 18:44:03.400   354   607 I WindowState: WIN DEATH: Window{41327498 u0 com.here/com.here.MainActivity}
10-31 18:44:03.420   354   607 W InputDispatcher: Attempted to unregister already unregistered input channel '41327498 com.here/com.here.MainActivity (server)'
10-31 18:44:03.430   354   366 W ActivityManager: Force removing ActivityRecord{411eea18 u0 com.here/.MainActivity}: app died, no saved state
10-31 18:44:03.490   354   413 I qtaguid : Failed write_ctrl(s 0 10054) res=-1 errno=1
10-31 18:44:03.490   354   413 W NetworkManagementSocketTagger: setKernelCountSet(10054, 0) failed with errno -1
10-31 18:44:03.600   354   366 I ActivityManager: Start proc com.android.launcher for activity com.android.launcher/com.android.launcher2.Launcher: pid=7147 uid=10024 gids={50024, 1028}

Does anyone have any idea why the window is being hidden after around hours of usage? Is there something I can instrument the system with to figure this out?