IADController.java
1.89 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.controller;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.sdk.Sdk;
import com.sdk.SharedPref;
import com.sdk.utils.TimeUtils;
import org.json.JSONException;
import org.json.JSONObject;
public class IADController {
private static IADController controller = new IADController();
private SharedPreferences mSharedPref;
public static IADController getInstance(){
if(controller == null){
controller = new IADController();
}
return controller;
}
private IADController(){
mSharedPref = Sdk.app().getSharedPreferences("a_d_c",0);
}
public boolean isShowOuter(){
return false;
}
public boolean isShowInner(){
return true;
}
private IADConfig getIAD(String input){
IADConfig config = new IADConfig();
try {
JSONObject object = new JSONObject(input);
if(object.has("open")){
config.setOpen(object.getBoolean("open"));
}
if(object.has("type")){
config.setType(object.getInt("type"));
}
} catch (JSONException e) {
e.printStackTrace();
}
return config;
}
public IADConfig getAdConfig(int type){
if(type == NotifyType.UNLOCK_NOTIRY){
return new IADConfig(true,0);
} else if(type == NotifyType.POP_NOTIFY_EVERYWHERE){
return new IADConfig(true,0);
} else if(type == NotifyType.BATTERY_UNPLUG_NOTIFY){
return new IADConfig(true,0);
} else if(type == NotifyType.WIFI_CONNECTED_NOTIFY){
return new IADConfig(true,0);
} else if(type == NotifyType.PHONE_OVER_NOTIRY){
return new IADConfig(true,0);
} else if(type == NotifyType.SCREEN_ON_NOTIRY){
return new IADConfig(true,0);
}
return null;
}
}