// Path: app/src/main/java/de/vier_bier/habpanelviewer/status/ApplicationStatus.java
// public class ApplicationStatus {
//     private final ArrayList<StatusItem> mValues = new ArrayList<>();
//     private final HashMap<String, StatusItem> mIndices = new HashMap<>();
// 
//     public synchronized void set(String key, String value) {
//         StatusItem item = mIndices.get(key);
//         if (item == null) {
//             item = new StatusItem(key, value);
//             mValues.add(item);
//             mIndices.put(key, item);
//         } else {
//             item.setValue(value);
//         }
//     }
// 
//     int getItemCount() {
//         return mValues.size();
//     }
// 
//     StatusItem getItem(int i) {
//         return mValues.get(i);
//     }
// }


import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import com.jakewharton.processphoenix.ProcessPhoenix;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import de.vier_bier.habpanelviewer.status.ApplicationStatus;
package de.vier_bier.habpanelviewer;






/**
 * UncaughtExceptionHandler that restarts the app in case of exceptions.
 */
class AppRestartingExceptionHandler implements Thread.UncaughtExceptionHandler {
    private static final String TAG = "HPV-AppRestartingExHa";

    private final MainActivity mCtx;
    private final int mCount;

    private int mMaxRestarts;
    private boolean mRestartEnabled;

    private final Thread.UncaughtExceptionHandler mDefaultHandler;

    AppRestartingExceptionHandler(MainActivity context, Thread.UncaughtExceptionHandler defaultHandler, int restartCount) {
        mCtx = context;
        mDefaultHandler = defaultHandler;
        mCount = restartCount;

        EventBus.getDefault().register(this);
        Thread.setDefaultUncaughtExceptionHandler(this);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
// Path: app/src/main/java/de/vier_bier/habpanelviewer/status/ApplicationStatus.java
// public class ApplicationStatus {
//     private final ArrayList<StatusItem> mValues = new ArrayList<>();
//     private final HashMap<String, StatusItem> mIndices = new HashMap<>();
// 
//     public synchronized void set(String key, String value) {
//         StatusItem item = mIndices.get(key);
//         if (item == null) {
//             item = new StatusItem(key, value);
//             mValues.add(item);
//             mIndices.put(key, item);
//         } else {
//             item.setValue(value);
//         }
//     }
// 
//     int getItemCount() {
//         return mValues.size();
//     }
// 
//     StatusItem getItem(int i) {
//         return mValues.get(i);
//     }
// }


// Path: app/src/main/java/de/vier_bier/habpanelviewer/AppRestartingExceptionHandler.java
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import com.jakewharton.processphoenix.ProcessPhoenix;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import de.vier_bier.habpanelviewer.status.ApplicationStatus;

package de.vier_bier.habpanelviewer;






/**
 * UncaughtExceptionHandler that restarts the app in case of exceptions.
 */
class AppRestartingExceptionHandler implements Thread.UncaughtExceptionHandler {
    private static final String TAG = "HPV-AppRestartingExHa";

    private final MainActivity mCtx;
    private final int mCount;

    private int mMaxRestarts;
    private boolean mRestartEnabled;

    private final Thread.UncaughtExceptionHandler mDefaultHandler;

    AppRestartingExceptionHandler(MainActivity context, Thread.UncaughtExceptionHandler defaultHandler, int restartCount) {
        mCtx = context;
        mDefaultHandler = defaultHandler;
        mCount = restartCount;

        EventBus.getDefault().register(this);
        Thread.setDefaultUncaughtExceptionHandler(this);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(ApplicationStatus status) {