// 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.Context;
import android.content.res.Resources;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import de.vier_bier.habpanelviewer.R;
import de.vier_bier.habpanelviewer.status.ApplicationStatus;
package de.vier_bier.habpanelviewer.connection;




/**
 * Holds information about online/offline times.
 */
public class ConnectionStatistics {
    private final Context mCtx;
    private final long mStartTime = System.currentTimeMillis();
    private State mState = State.DISCONNECTED;

    private long mLastOnlineTime = -1;
    private long mLastOfflineTime = mStartTime;
    private long mOfflinePeriods = 0;
    private long mOfflineMillis = 0;
    private long mOfflineMaxMillis = 0;
    private long mOfflineAverage = 0;
    private long mOnlinePeriods = 0;
    private long mOnlineMillis = 0;
    private long mOnlineMaxMillis = 0;
    private long mOnlineAverage = 0;

    public ConnectionStatistics(Context context) {
        mCtx = context;
        EventBus.getDefault().register(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/connection/ConnectionStatistics.java
import android.content.Context;
import android.content.res.Resources;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import de.vier_bier.habpanelviewer.R;
import de.vier_bier.habpanelviewer.status.ApplicationStatus;

package de.vier_bier.habpanelviewer.connection;




/**
 * Holds information about online/offline times.
 */
public class ConnectionStatistics {
    private final Context mCtx;
    private final long mStartTime = System.currentTimeMillis();
    private State mState = State.DISCONNECTED;

    private long mLastOnlineTime = -1;
    private long mLastOfflineTime = mStartTime;
    private long mOfflinePeriods = 0;
    private long mOfflineMillis = 0;
    private long mOfflineMaxMillis = 0;
    private long mOfflineAverage = 0;
    private long mOnlinePeriods = 0;
    private long mOnlineMillis = 0;
    private long mOnlineMaxMillis = 0;
    private long mOnlineAverage = 0;

    public ConnectionStatistics(Context context) {
        mCtx = context;
        EventBus.getDefault().register(this);
    }

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