summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/LogWindowWrapper.java
blob: 441eb28e887ffe31fce5083af2c89c49b4997258 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package se.leap.bitmaskclient;

import android.content.*;

import de.blinkt.openvpn.activities.*;

public class LogWindowWrapper {
    private static LogWindowWrapper instance;

    private static String TAG = LogWindowWrapper.class.getName();
    private Context context;
    private String reason = "";

    public LogWindowWrapper(Context context) {
        this.context = context;
    }

    public void showLog() {
        Intent startLW = new Intent(context, LogWindow.class);
        startLW.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(startLW);
    }

    public static LogWindowWrapper getInstance(Context context) {
        if(instance == null)
            instance = new LogWindowWrapper(context);
        return instance;
    }

    public void clearReason() {
        reason = "";
    }

    public void showedBecauseOf(String reason) {
        this.reason = reason;
    }

    public String reason() {
        return reason;
    }
}