LockerActivity.java
26 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
package com.lotus.town.locker;
import android.app.KeyguardManager;
import android.app.PendingIntent;
import android.app.WallpaperManager;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.drawable.Drawable;
import android.os.BatteryManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.ad.lib.AdInfo;
import com.ad.lib.AdManager;
import com.ad.lib.AdPlacement;
import com.ad.lib.IAdCallback;
import com.ad.lib.RequestInfo;
import com.ad.lib.cat.WebViewActivity;
import com.bumptech.glide.Glide;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.controller.IADController;
import com.controller.NotifyType;
import com.lotus.town.R;
import com.lotus.town.notify.NotifyManager;
import com.lotus.town.utils.NotificationUtils;
import com.lotus.town.widget.FlashTextView;
import com.manager.AdCache;
import com.manager.scenes.RewardVideoRequestInfo;
import com.sdk.EventBus;
import com.sdk.Sdk;
import com.umeng.analytics.MobclickAgent;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Random;
import me.imid.swipebacklayout.lib.SwipeBackLayout;
import me.imid.swipebacklayout.lib.app.SwipeBackActivity;
public class LockerActivity extends SwipeBackActivity implements EventBus.Listener {
private final String TAG = "secln.LockerActivity";
private Context mContext;
private TextView mTime;
private FlashTextView unlock_text;
private TextView mDate;
private TextView mVideoButton;
private TextView mRedPack;
// private ImageView mSpliteLine;
private LinearLayout mAdLayout;
private LinearLayout mRewardVideo;
public static boolean isMIUI() {
String manufacturer = Build.MANUFACTURER;
//这个字符串可以自己定义,例如判断华为就填写huawei,魅族就填写meizu
if ("xiaomi".equalsIgnoreCase(manufacturer)||"OPPO".equalsIgnoreCase(manufacturer)) {
return true;
}
return false;
}
public static void startActivity(Context context){
// if(Sdk.isInSplash){
// return;
// }
if(!IADController.getInstance().isShowOuter()){
return;
}
if(!isMIUI() && !isLockerScreen(context) && !isCharging(context)){
return;
}
if(true) {
Intent i = new Intent();
i.setClass(context, LockerActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
if(!Sdk.isInSplash) {
NotificationUtils.sendNotification(context, LockerActivity.class);
}
}
}
private static boolean isLockerScreen(Context context){
KeyguardManager mKeyguardManager = (KeyguardManager) context.getSystemService(KEYGUARD_SERVICE);
return mKeyguardManager.inKeyguardRestrictedInputMode();
}
public static void startActivitySelf(Context context){
if (!isLockerScreen(context)) {
return;
}
if(Sdk.isInSplash){
for(int j=0;j<10;j++){
Intent intent=new Intent(context,LockerActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, intent, 0);
try {
pendingIntent.send();
} catch (PendingIntent.CanceledException e) {
e.printStackTrace();
}
}
}
}
public static boolean isCharging(Context context) {
Intent batteryBroadcast = context.registerReceiver(null,
new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
// 0 means we are discharging, anything else means charging
boolean isCharging = batteryBroadcast.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) != 0;
return isCharging;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getInstance().register(EventBus.PHONE_COMING,this);
NotificationUtils.clearNotification(this);
// EventBus.getInstance().register(EventBus.SCREEN_ON,this);
Sdk.isInSplash = true;
AdCache.getInstance().initLocker(this);
setContentView(R.layout.activity_locker_new);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
// getWindow().setFormat(WindowManager.LayoutParams.TYPE_WALLPAPER);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER,WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER);
getSwipeBackLayout().setEdgeTrackingEnabled(SwipeBackLayout.EDGE_RIGHT);
try {
Drawable wallPaper = WallpaperManager.getInstance(this).getDrawable();
if (wallPaper != null) {
this.getWindow().setBackgroundDrawable(wallPaper);
}
} catch (Exception e){
}
mContext = this;
initSystemView();
// initSmallView();
initBigView();
initSystem();
// AdCache.getInstance().getDrawVideo(this);
// initSmallAd();
// initBigAd();
// TTAdManager ttAdManager = TTAdManagerHolder.get();
// mTTAdNative = ttAdManager.createAdNative(getApplicationContext());
// //申请部分权限,如read_phone_state,防止获取不了imei时候,下载类广告没有填充的问题。
// TTAdManagerHolder.get().requestPermissionIfNecessary(this);
//
// initView();
// isShow = true;
}
private void initSystemView() {
mTime= (TextView) findViewById(R.id.time);
mDate= (TextView) findViewById(R.id.date);
mRedPack= (TextView) findViewById(R.id.num_get_red);
mRewardVideo= (LinearLayout) findViewById(R.id.reward_video);
unlock_text= (FlashTextView) findViewById(R.id.unlock_text);
mAdLayout= (LinearLayout) findViewById(R.id.big_layout_id);
// mSpliteLine = (ImageView)findViewById(R.id.split_line);
// mSpliteLine.setVisibility(View.INVISIBLE);
String html="<font color='black'>已有</font>";
html+="<font color='#FF6861'> <big> "+"236738"+" </big> </font>";
html+="<font color='black'>"+"人领取"+"</font>";
CharSequence charSequence= Html.fromHtml(html);
mRedPack.setText(charSequence);
mRewardVideo.setVisibility(View.GONE);
mRewardVideo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AdInfo adinfo = AdCache.getInstance().getCacheAdInfo(NotifyType.REWARD_VIDEO_NOTIFY);
if(adinfo != null) {
adinfo.getReporter().bindDislikeView(LockerActivity.this, null);
} else {
AdInfo adinfo2 = AdCache.getInstance().getCacheAdInfo(NotifyType.FULL_SCREEN_VIDEO_NOTIFY);
if (adinfo2 != null) {
adinfo2.getReporter().bindDislikeView(LockerActivity.this, null);
} else {
RewardVideoRequestInfo info = new RewardVideoRequestInfo();
AdManager.getInstance().getAdController(LockerActivity.this, 0).loadRewardVideo(info, new IAdCallback() {
@Override
public void onADLoaded(AdInfo info) {
if (info != null) {
info.getReporter().impress(null, null, "r_w_v_a_d", "r_w_v_c");
info.getReporter().bindDislikeView(LockerActivity.this, null);
}
}
@Override
public void onADError() {
Toast.makeText(LockerActivity.this, "视频还没有准备好,稍后回来再试", Toast.LENGTH_LONG).show();
}
@Override
public void onClicked() {
}
@Override
public void onVideoPlayFinish() {
}
@Override
public void onVideoSkip() {
}
@Override
public void onVideoClose() {
Intent i = new Intent();
i.setClass(Sdk.app(), WebViewActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Sdk.app().startActivity(i);
}
});
}
}
}
});
}
private void initSystem(){
final Calendar calendar=Calendar.getInstance();
int month = calendar.get(Calendar.MONTH)+1;
int day = calendar.get(Calendar.DAY_OF_MONTH);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
String mWay = String.valueOf(calendar.get(Calendar.DAY_OF_WEEK));
if("1".equals(mWay)){
mWay ="天";
}else if("2".equals(mWay)){
mWay ="一";
}else if("3".equals(mWay)){
mWay ="二";
}else if("4".equals(mWay)){
mWay ="三";
}else if("5".equals(mWay)){
mWay ="四";
}else if("6".equals(mWay)){
mWay ="五";
}else if("7".equals(mWay)){
mWay ="六";
}
StringBuilder timeBuffer = new StringBuilder();
if(hour <10){
timeBuffer.append(0).append(hour);
} else {
timeBuffer.append(hour);
}
timeBuffer.append(":");
if(minute <10){
timeBuffer.append(0).append(minute);
} else {
timeBuffer.append(minute);
}
mTime.setText(timeBuffer.toString());
mDate.setText(month+"月"+day+"日 星期"+mWay);
}
@Override
protected void onPause() {
super.onPause();
if(refreshHandler.hasMessages(0)){
refreshHandler.removeMessages(0);
}
MobclickAgent.onPause(this);
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// if(isScreenOn()){
// Sdk.isInSplash = false;
// }
// }
// },1000);
}
@Override
protected void onStop() {
super.onStop();
if(handler.hasMessages(0)){
handler.removeMessages(0);
}
}
private int smallRetryTime = 0;
// private void initSmallAd() {
// RequestInfo info = new RequestInfo();
// info.setId(AdPlacement.getLockerSmallId());
// info.setWidth(1080);
// info.setHeight(1920);
// info.setType(AdSlot.TYPE_BANNER);
// final int adType = IADController.getInstance().getLockerConfig().getType();
// AdManager.getInstance().getAdController(this,adType).loadNativeAd(info, new IAdCallback() {
// @Override
// public void onADLoaded(final AdInfo info) {
// try {
// SmallLayoutWrapper.setVisibility(View.VISIBLE);
// if (info.getAdIcon() != null) {
// smallAdFromLogo.setImageBitmap(info.getAdIcon());
// }
//// smallAdFromLogo
// if (info.getImageList() != null && info.getImageList().size() > 0) {
// Glide.with(mContext).load(info.getImageList().get(0)).into(smallAdImage);
// } else {
// Glide.with(mContext).load(info.getIconUrl()).into(smallAdImage);
// }
// smallTitle.setText(info.getTitle());
// smallSubtTitle.setText(info.getSubtitle());
// smallButton.setText(info.getButtonLabel());
// if (adType == 0) {
// List<View> clickViewList = new ArrayList<>();
// clickViewList.add(smallLayout);
// clickViewList.add(smallButton);
// info.getReporter().impress(smallLayout, clickViewList, "l_s_a_d", "l_s_c");
//
// } else if (adType == 1 || adType == 2) {
// info.getReporter().impress(smallLayout, "l_s_a_d");
// info.getReporter().impress(smallButton, "l_s_a_d");
// smallLayout.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// info.getReporter().click(view, "l_s_c"); // 点击接口
// }
// });
// smallButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// info.getReporter().click(view, "l_s_c"); // 点击接口
// }
// });
// }
// } catch (Exception e){
// }
// }
//
// @Override
// public void onADError() {
// if(smallRetryTime++ <1){
// initSmallAd();
// }
// }
//
// @Override
// public void onClicked() {
//
// }
// });
// }
private Handler handler = new Handler(){
@Override
public void handleMessage(Message msg) {
initBigAd();
}
};
static class LockerType {
String id;
int type;
private LockerType(String id,int type){
this.id = id;
this.type = type;
}
public static LockerType getLockerId(int adType) {
int i = new Random().nextInt(2);
// if (Sdk.isUJ()) {
return new LockerType(AdPlacement.getLockerBigId(adType), AdSlot.TYPE_INTERACTION_AD);
// } else {
// return new LockerType(AdPlacement.getLockerSmallId(adType), AdSlot.TYPE_BANNER);
// }
}
}
private int bigRetryTime = 0;
private boolean isLoadingAd = false;
private void initBigAd() {
final AdInfo adInfo = AdCache.getInstance().getLocker();
Log.v("XPC","initBigAd adInfo="+adInfo);
if(adInfo != null){
int adType = adInfo.getAdType();
if(adType == -1){
throw new IllegalArgumentException("init adType before used");
}
try {
if (adType == 0) {
bigLayout.setVisibility(View.VISIBLE);
bigLayoutGdt.setVisibility(View.GONE);
adInfo.getReporter().bindDislikeView(LockerActivity.this,adCloseButton);
adCloseButton.setVisibility(View.VISIBLE);
// mSpliteLine.setVisibility(View.INVISIBLE);
bigLayoutWrapper.setVisibility(View.VISIBLE);
if (adInfo.getAdIcon() != null) {
bigAdFromLogo.setImageBitmap(adInfo.getAdIcon());
}
if (adInfo.getImageList() != null && adInfo.getImageList().size() > 0) {
Glide.with(mContext).load(adInfo.getImageList().get(0)).into(bigAdImage);
} else {
Glide.with(mContext).load(adInfo.getIconUrl()).into(bigAdImage);
}
Glide.with(mContext).load(adInfo.getIconUrl()).into(bigAdIcon);
bigTitle.setText(adInfo.getTitle());
bigSubtTitle.setText(adInfo.getSubtitle());
bigButton.setText(adInfo.getButtonLabel());
List<View> clickViewList = new ArrayList<>();
clickViewList.add(bigLayoutWrapper);
clickViewList.add(bigButton);
adInfo.getReporter().impress(bigLayoutWrapper, clickViewList, "l_s_a_d", "l_s_c");
}
} catch (Exception e){
}
isLoadingAd = false;
if(Sdk.isInSplash && isScreenOn()){
handler.sendEmptyMessageDelayed(0,8000);
}
return;
}
// TODO: 2019-07-02 XPC 增加类型
final int adType = 0;
LockerType type = LockerType.getLockerId(adType);
RequestInfo info = new RequestInfo();
info.setId(type.id);
info.setWidth(1080);
info.setHeight(1920);
info.setType(type.type);
isLoadingAd = true;
AdManager.getInstance().getAdController(this,adType).loadNativeAd(info, new IAdCallback() {
@Override
public void onADLoaded(final AdInfo info) {
if(info == null){
isLoadingAd = false;
return;
}
try {
info.getReporter().bindDislikeView(LockerActivity.this,adCloseButton);
adCloseButton.setVisibility(View.VISIBLE);
// mSpliteLine.setVisibility(View.INVISIBLE);
bigLayoutWrapper.setVisibility(View.VISIBLE);
if (info.getAdIcon() != null) {
bigAdFromLogo.setImageBitmap(info.getAdIcon());
}
if (info.getImageList() != null && info.getImageList().size() > 0) {
Glide.with(mContext).load(info.getImageList().get(0)).into(bigAdImage);
} else {
Glide.with(mContext).load(info.getIconUrl()).into(bigAdImage);
}
Glide.with(mContext).load(info.getIconUrl()).into(bigAdIcon);
bigTitle.setText(info.getTitle());
bigSubtTitle.setText(info.getSubtitle());
bigButton.setText(info.getButtonLabel());
if (adType == 0) {
bigLayout.setVisibility(View.VISIBLE);
bigLayoutGdt.setVisibility(View.GONE);
info.getReporter().bindDislikeView(LockerActivity.this,adCloseButton);
adCloseButton.setVisibility(View.VISIBLE);
// mSpliteLine.setVisibility(View.INVISIBLE);
bigLayoutWrapper.setVisibility(View.VISIBLE);
if (info.getAdIcon() != null) {
bigAdFromLogo.setImageBitmap(info.getAdIcon());
}
if (info.getImageList() != null && info.getImageList().size() > 0) {
Glide.with(mContext).load(info.getImageList().get(0)).into(bigAdImage);
} else {
Glide.with(mContext).load(info.getIconUrl()).into(bigAdImage);
}
Glide.with(mContext).load(info.getIconUrl()).into(bigAdIcon);
bigTitle.setText(info.getTitle());
bigSubtTitle.setText(info.getSubtitle());
bigButton.setText(info.getButtonLabel());
List<View> clickViewList2 = new ArrayList<>();
clickViewList2.add(bigLayoutWrapper);
clickViewList2.add(bigButton);
info.getReporter().impress(bigLayoutWrapper, clickViewList2, "l_s_a_d", "l_s_c");
} else if (adType == 1) {
if (info.getView() == null) {
return;
}
bigLayoutWrapper.setOnClickListener(null);
bigLayout.setVisibility(View.GONE);
bigLayoutGdt.setVisibility(View.VISIBLE);
bigLayoutGdt.removeAllViews();
bigLayoutGdt.addView(info.getView());
info.getReporter().render();
info.getReporter().impress(bigLayoutGdt, "gdt_l_s_a_d");
bigLayoutGdt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
info.getReporter().click(view, "gdt_l_s_c"); // 点击接口
}
});
} else if(adType == 2){
info.getReporter().impress(bigLayout, "l_s_a_d");
info.getReporter().impress(bigButton, "l_s_a_d");
bigLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
info.getReporter().click(view, "l_s_c"); // 点击接口
}
});
bigButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
info.getReporter().click(view, "l_s_c"); // 点击接口
}
});
}
} catch (Exception e){
}
isLoadingAd = false;
if(Sdk.isInSplash && isScreenOn()){
handler.sendEmptyMessageDelayed(0,8000);
}
}
@Override
public void onADError() {
isLoadingAd = false;
if(bigRetryTime++ <1){
initBigAd();
}
}
@Override
public void onClicked() {
Sdk.isEnabled = true;
}
});
}
private boolean isScreenOn(){
PowerManager powerManager = (PowerManager) this
.getSystemService(Context.POWER_SERVICE);
boolean ifOpen = powerManager.isScreenOn();
return ifOpen;
}
// ImageView smallAdFromLogo;
// ImageView smallAdImage;
// TextView smallTitle;
// TextView smallSubtTitle;
// Button smallButton;
// RelativeLayout smallLayout;
// private RelativeLayout SmallLayoutWrapper;
private void initSmallView(){
// smallAdFromLogo = (ImageView) findViewById(R.id.small_ad_from_logo);
// smallAdImage = (ImageView) findViewById(R.id.small_ad_image);
// smallTitle = (TextView) findViewById(R.id.small_title);
// smallSubtTitle = (TextView) findViewById(R.id.small_subtitle);
// smallButton = (Button)findViewById(R.id.small_btn);
// smallLayout = (RelativeLayout)findViewById(R.id.small_layout);
//
// SmallLayoutWrapper = (RelativeLayout)findViewById(R.id.small_layout_id);
}
ImageView bigAdFromLogo;
ImageView bigAdImage;
ImageView bigAdIcon;
ImageView adCloseButton;
TextView bigTitle;
TextView bigSubtTitle;
Button bigButton;
LinearLayout bigLayout;
LinearLayout bigLayoutGdt;
LinearLayout bigLayoutWrapper;
private void initBigView(){
bigLayout = (LinearLayout) findViewById(R.id.big_layout);
bigLayoutGdt = (LinearLayout) findViewById(R.id.a_big_layout_gdt);
bigAdFromLogo = (ImageView) findViewById(R.id.big_ad_from_logo);
bigAdImage = (ImageView) findViewById(R.id.big_ad_image);
bigAdIcon = (ImageView) findViewById(R.id.big_ad_icon);
bigTitle = (TextView) findViewById(R.id.big_ad_title);
bigSubtTitle = (TextView) findViewById(R.id.big_ad_subtitle);
bigButton = (Button)findViewById(R.id.big_btn);
adCloseButton = (ImageView)findViewById(R.id.close_ad);
bigLayoutWrapper = (LinearLayout)findViewById(R.id.big_layout_id);
}
private boolean isDisplayCharging = false;
private Handler refreshHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
if(isDisplayCharging){
unlock_text.setText("左滑解锁");
isDisplayCharging = false;
} else {
unlock_text.setText("充电中");
isDisplayCharging = true;
}
refreshHandler.sendEmptyMessageDelayed(0,8000);
}
};
@Override
protected void onResume() {
super.onResume();
Log.v("XPC","onResume");
initSystem();
if(isCharging(this)) {
refreshHandler.sendEmptyMessage(0);
}
if(!isLoadingAd && !handler.hasMessages(0)&& isScreenOn()) {
handler.sendEmptyMessage(0);
}
MobclickAgent.onEvent(this,"l_s_p");
MobclickAgent.onResume(this);
}
@Override
protected void onDestroy() {
if(handler.hasMessages(0)){
handler.removeMessages(0);
}
if(isMIUI() && !isLockerScreen(this)){
NotifyManager.NotifyChange(this,NotifyType.UNLOCK_NOTIRY);
}
EventBus.getInstance().unregister(EventBus.PHONE_COMING,this);
// EventBus.getInstance().unregister(EventBus.SCREEN_ON,this);
Sdk.isInSplash = false;
Sdk.isEnabled = false;
super.onDestroy();
}
@Override
public void onBackPressed() {
}
@Override
public void onEvent(int notify) {
if(notify == EventBus.PHONE_COMING){
finish();
}
// else if(notify == EventBus.SCREEN_ON){
// if(!isLoadingAd && !handler.hasMessages(0)) {
// Log.v("XPC","SCREEN_ON initBigAd");
// initBigAd();
// }
//// initSmallAd();
// }
}
}