version:1.2.1
fix: update:准备分包
This commit is contained in:
101
build.gradle
101
build.gradle
@@ -27,7 +27,7 @@ def appName() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def releaseTime() {
|
def releaseTime() {
|
||||||
return new Date().format("yyyyMMdd", TimeZone.getDefault())
|
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
|
||||||
}
|
}
|
||||||
|
|
||||||
final String ANDROID_TOP = "${rootDir}"
|
final String ANDROID_TOP = "${rootDir}"
|
||||||
@@ -50,8 +50,8 @@ android {
|
|||||||
minSdkVersion 26
|
minSdkVersion 26
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
|
|
||||||
versionCode 17
|
versionCode 22
|
||||||
versionName "1.1.6"
|
versionName "1.2.1"
|
||||||
|
|
||||||
ndk {
|
ndk {
|
||||||
//选择要添加的对应 cpu 类型的 .so 库。
|
//选择要添加的对应 cpu 类型的 .so 库。
|
||||||
@@ -70,8 +70,17 @@ android {
|
|||||||
|
|
||||||
//签名
|
//签名
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
G10P {
|
||||||
|
storeFile file("keystore/G10PMTK11.jks")
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias "G10PMTK11"
|
||||||
|
keyPassword "123456"
|
||||||
|
v1SigningEnabled true
|
||||||
|
v2SigningEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
U807 {
|
U807 {
|
||||||
storeFile file("src/doc/AllwinnerU807.jks")
|
storeFile file("keystore/AllwinnerU807.jks")
|
||||||
storePassword "123456"
|
storePassword "123456"
|
||||||
keyAlias "u807"
|
keyAlias "u807"
|
||||||
keyPassword "123456"
|
keyPassword "123456"
|
||||||
@@ -79,16 +88,98 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
iPlay50SE {
|
iPlay50SE {
|
||||||
storeFile file("src/doc/iPlay50SE.keystore")
|
storeFile file("keystore/iPlay50SE.keystore")
|
||||||
storePassword "123456"
|
storePassword "123456"
|
||||||
keyAlias "iplay50se"
|
keyAlias "iplay50se"
|
||||||
keyPassword "123456"
|
keyPassword "123456"
|
||||||
v1SigningEnabled true
|
v1SigningEnabled true
|
||||||
v2SigningEnabled true
|
v2SigningEnabled true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
teclast8183 {
|
||||||
|
storeFile file("keystore/TeclastMTK12.jks")
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias "TeclastMTK12"
|
||||||
|
keyPassword "123456"
|
||||||
|
v2SigningEnabled false
|
||||||
|
}
|
||||||
|
|
||||||
|
UnisocS6688 {
|
||||||
|
storeFile file("keystore/UnisocS6688Userdebug.jks")
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias "unisocs6688userdebug"
|
||||||
|
keyPassword "123456"
|
||||||
|
v1SigningEnabled true
|
||||||
|
v2SigningEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
Aigo1071 {
|
||||||
|
storeFile file("keystore/Aigo1071.jks")
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias "aigo1071"
|
||||||
|
keyPassword "123456"
|
||||||
|
v1SigningEnabled true
|
||||||
|
v2SigningEnabled true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
Aigo1071Debug.initWith(debug)
|
||||||
|
Aigo1071Debug {
|
||||||
|
versionNameSuffix "-debug"
|
||||||
|
debuggable true
|
||||||
|
signingConfig signingConfigs.Aigo1071
|
||||||
|
buildConfigField "String", "platform", '"W8183"'
|
||||||
|
}
|
||||||
|
|
||||||
|
Aigo1071Release.initWith(release)
|
||||||
|
Aigo1071Release {
|
||||||
|
signingConfig signingConfigs.Aigo1071
|
||||||
|
buildConfigField "String", "platform", '"W8183"'
|
||||||
|
}
|
||||||
|
|
||||||
|
UnisocS6688Debug.initWith(debug)
|
||||||
|
UnisocS6688Debug {
|
||||||
|
versionNameSuffix "-debug"
|
||||||
|
debuggable true
|
||||||
|
signingConfig signingConfigs.UnisocS6688
|
||||||
|
buildConfigField "String", "platform", '"S6688"'
|
||||||
|
}
|
||||||
|
|
||||||
|
UnisocS6688Release.initWith(release)
|
||||||
|
UnisocS6688Release {
|
||||||
|
signingConfig signingConfigs.UnisocS6688
|
||||||
|
buildConfigField "String", "platform", '"S6688"'
|
||||||
|
}
|
||||||
|
|
||||||
|
teclast8183Debug.initWith(debug)
|
||||||
|
teclast8183Debug {
|
||||||
|
versionNameSuffix "-debug"
|
||||||
|
debuggable true
|
||||||
|
signingConfig signingConfigs.teclast8183
|
||||||
|
buildConfigField "String", "platform", '"A11MTK8183"'
|
||||||
|
}
|
||||||
|
|
||||||
|
teclast8183Release.initWith(release)
|
||||||
|
teclast8183Release {
|
||||||
|
signingConfig signingConfigs.teclast8183
|
||||||
|
buildConfigField "String", "platform", '"A11MTK8183"'
|
||||||
|
}
|
||||||
|
|
||||||
|
G10PDebug.initWith(debug)
|
||||||
|
G10PDebug {
|
||||||
|
versionNameSuffix "-debug"
|
||||||
|
debuggable true
|
||||||
|
signingConfig signingConfigs.G10P
|
||||||
|
buildConfigField "String", "platform", '"G10P"'
|
||||||
|
}
|
||||||
|
|
||||||
|
G10PRelease.initWith(release)
|
||||||
|
G10PRelease {
|
||||||
|
signingConfig signingConfigs.G10P
|
||||||
|
buildConfigField "String", "platform", '"G10P"'
|
||||||
|
}
|
||||||
|
|
||||||
U807Debug.initWith(debug)
|
U807Debug.initWith(debug)
|
||||||
U807Debug {
|
U807Debug {
|
||||||
buildConfigField "String", "platform", '"U807"'
|
buildConfigField "String", "platform", '"U807"'
|
||||||
|
|||||||
@@ -13,6 +13,14 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
Aigo1071Debug {}
|
||||||
|
Aigo1071Release {}
|
||||||
|
UnisocS6688Debug {}
|
||||||
|
UnisocS6688Release {}
|
||||||
|
teclast8183Debug {}
|
||||||
|
teclast8183Release {}
|
||||||
|
G10PDebug {}
|
||||||
|
G10PRelease {}
|
||||||
U807Debug {}
|
U807Debug {}
|
||||||
U807Release {}
|
U807Release {}
|
||||||
iPlay50SEDebug {}
|
iPlay50SEDebug {}
|
||||||
|
|||||||
BIN
keystore/Aigo1071.jks
Normal file
BIN
keystore/Aigo1071.jks
Normal file
Binary file not shown.
BIN
keystore/G10PMTK11.jks
Normal file
BIN
keystore/G10PMTK11.jks
Normal file
Binary file not shown.
BIN
keystore/TeclastMTK12.jks
Normal file
BIN
keystore/TeclastMTK12.jks
Normal file
Binary file not shown.
BIN
keystore/UnisocS6688Userdebug.jks
Normal file
BIN
keystore/UnisocS6688Userdebug.jks
Normal file
Binary file not shown.
@@ -11,6 +11,14 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
Aigo1071Debug {}
|
||||||
|
Aigo1071Release {}
|
||||||
|
UnisocS6688Debug {}
|
||||||
|
UnisocS6688Release {}
|
||||||
|
teclast8183Debug {}
|
||||||
|
teclast8183Release {}
|
||||||
|
G10PDebug {}
|
||||||
|
G10PRelease {}
|
||||||
U807Debug {}
|
U807Debug {}
|
||||||
U807Release {}
|
U807Release {}
|
||||||
iPlay50SEDebug {}
|
iPlay50SEDebug {}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
import cn.jzvd.Jzvd;
|
||||||
import io.reactivex.rxjava3.core.Observer;
|
import io.reactivex.rxjava3.core.Observer;
|
||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
|
||||||
@@ -252,4 +253,18 @@ public class AlarmActivity extends BaseActivity implements AlarmContact.AlarmVie
|
|||||||
rv_data.setVisibility(View.VISIBLE);
|
rv_data.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (Jzvd.backPress()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
Jzvd.releaseAllVideos();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,6 +250,7 @@ public class IconCache extends BaseIconCache {
|
|||||||
this.add("com.android.gallery3d.app.GalleryActivity");//图库
|
this.add("com.android.gallery3d.app.GalleryActivity");//图库
|
||||||
this.add("com.google.android.apps.photos.home.HomeActivity");//图库
|
this.add("com.google.android.apps.photos.home.HomeActivity");//图库
|
||||||
this.add("com.android.messaging.ui.conversationlist.ConversationListActivity");//信息
|
this.add("com.android.messaging.ui.conversationlist.ConversationListActivity");//信息
|
||||||
|
this.add("com.android.mms.ui.BootActivity");//信息
|
||||||
this.add("com.android.music.MusicBrowserActivity");//音乐
|
this.add("com.android.music.MusicBrowserActivity");//音乐
|
||||||
this.add("com.android.providers.downloads.ui.DownloadList");//下载
|
this.add("com.android.providers.downloads.ui.DownloadList");//下载
|
||||||
this.add("com.android.quicksearchbox.SearchActivity");//搜索
|
this.add("com.android.quicksearchbox.SearchActivity");//搜索
|
||||||
@@ -289,6 +290,7 @@ public class IconCache extends BaseIconCache {
|
|||||||
this.add("com_android_gallery3d_app");
|
this.add("com_android_gallery3d_app");
|
||||||
this.add("com_android_gallery3d_app");
|
this.add("com_android_gallery3d_app");
|
||||||
this.add("com_android_mms_ui");
|
this.add("com_android_mms_ui");
|
||||||
|
this.add("com_android_mms_ui");
|
||||||
this.add("com_android_music");
|
this.add("com_android_music");
|
||||||
this.add("com_android_providers_downloads_ui");
|
this.add("com_android_providers_downloads_ui");
|
||||||
this.add("com_android_quicksearchbox");
|
this.add("com_android_quicksearchbox");
|
||||||
|
|||||||
@@ -671,6 +671,18 @@ public class RunningAppManager {
|
|||||||
this.add("com.uiui.appstore");
|
this.add("com.uiui.appstore");
|
||||||
this.add("com.uiui.browser");
|
this.add("com.uiui.browser");
|
||||||
this.add("com.uiui.aios");
|
this.add("com.uiui.aios");
|
||||||
|
|
||||||
|
this.add("com.uiuipad.find");
|
||||||
|
this.add("com.uiuipad.os");
|
||||||
|
this.add("com.uiuipad.browser");
|
||||||
|
this.add("com.uiuipad.store");
|
||||||
|
this.add("com.uiuipad.zyinfo");
|
||||||
|
this.add("com.aole.safe");
|
||||||
|
this.add("com.aole.aios");
|
||||||
|
this.add("com.aole.store");
|
||||||
|
this.add("com.safeos.ae");
|
||||||
|
this.add("com.dangsafe.kf");
|
||||||
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1019,7 +1031,7 @@ public class RunningAppManager {
|
|||||||
// if (machineControl.getIs_part() == 1) {
|
// if (machineControl.getIs_part() == 1) {
|
||||||
// int partType = machineControl.getPart_type();
|
// int partType = machineControl.getPart_type();
|
||||||
if (machineControl.getTime_part() != null && machineControl.getTime_part().size() != 0) {
|
if (machineControl.getTime_part() != null && machineControl.getTime_part().size() != 0) {
|
||||||
int partType = 1;
|
int partType = 0;
|
||||||
HashSet<TimeManagePart> weekdayPart = machineControl.getTime_part().stream().filter(partTime -> partTime.getDay_type() == 0).collect(Collectors.toCollection(HashSet::new));
|
HashSet<TimeManagePart> weekdayPart = machineControl.getTime_part().stream().filter(partTime -> partTime.getDay_type() == 0).collect(Collectors.toCollection(HashSet::new));
|
||||||
HashSet<TimeManagePart> holidayPart = machineControl.getTime_part().stream().filter(partTime -> partTime.getDay_type() == 1).collect(Collectors.toCollection(HashSet::new));
|
HashSet<TimeManagePart> holidayPart = machineControl.getTime_part().stream().filter(partTime -> partTime.getDay_type() == 1).collect(Collectors.toCollection(HashSet::new));
|
||||||
//工作日
|
//工作日
|
||||||
@@ -1080,7 +1092,7 @@ public class RunningAppManager {
|
|||||||
// if (appTimeControl.getIs_part() == 1) {
|
// if (appTimeControl.getIs_part() == 1) {
|
||||||
// int partType = appTimeControl.getPart_type();
|
// int partType = appTimeControl.getPart_type();
|
||||||
if (appTimeControl.getTime_part() != null && appTimeControl.getTime_part().size() != 0) {
|
if (appTimeControl.getTime_part() != null && appTimeControl.getTime_part().size() != 0) {
|
||||||
int partType = 1;
|
int partType = 0;
|
||||||
HashMap<Integer, Set<TimeManagePart>> partTimeMap = new HashMap();
|
HashMap<Integer, Set<TimeManagePart>> partTimeMap = new HashMap();
|
||||||
HashSet<TimeManagePart> weekdayPart = new HashSet(appTimeControl.getTime_part().stream().filter(partTime -> partTime.getDay_type() == 0).collect(Collectors.toList()));
|
HashSet<TimeManagePart> weekdayPart = new HashSet(appTimeControl.getTime_part().stream().filter(partTime -> partTime.getDay_type() == 0).collect(Collectors.toList()));
|
||||||
HashSet<TimeManagePart> holidayPart = new HashSet(appTimeControl.getTime_part().stream().filter(partTime -> partTime.getDay_type() == 1).collect(Collectors.toList()));
|
HashSet<TimeManagePart> holidayPart = new HashSet(appTimeControl.getTime_part().stream().filter(partTime -> partTime.getDay_type() == 1).collect(Collectors.toList()));
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ public class TimeControlManager {
|
|||||||
private static TimeControlManager mTimeControlManager;
|
private static TimeControlManager mTimeControlManager;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||||
|
/*app为分类的分类配置*/
|
||||||
private HashMap<Integer, TimeManageApp> mClassifyTimeControlHashMap = new HashMap<>();
|
private HashMap<Integer, TimeManageApp> mClassifyTimeControlHashMap = new HashMap<>();
|
||||||
|
|
||||||
/*分类的所有包名列表*/
|
/*分类的所有包名列表*/
|
||||||
private HashMap<String, TimeManageApp> mAppTimeControlMap = new HashMap<>();
|
private HashMap<String, TimeManageApp> mAppTimeControlMap = new HashMap<>();
|
||||||
/*整机分类*/
|
/*整机分类*/
|
||||||
@@ -166,7 +167,7 @@ public class TimeControlManager {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置app的配置
|
* 设置app管控时间的配置
|
||||||
*
|
*
|
||||||
* @param appTimeControlList
|
* @param appTimeControlList
|
||||||
*/
|
*/
|
||||||
@@ -174,6 +175,7 @@ public class TimeControlManager {
|
|||||||
if (appTimeControlList == null || appTimeControlList.size() == 0) {
|
if (appTimeControlList == null || appTimeControlList.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMap<Integer, TimeManageApp> classifyTimeControlHashMap = new HashMap<>();
|
HashMap<Integer, TimeManageApp> classifyTimeControlHashMap = new HashMap<>();
|
||||||
List<TimeManageApp> filterAppTimeControlList = appTimeControlList.stream().filter(appTimeControl -> {
|
List<TimeManageApp> filterAppTimeControlList = appTimeControlList.stream().filter(appTimeControl -> {
|
||||||
//tc_use_type == 1 时用的是分类配置,配置都是一样的
|
//tc_use_type == 1 时用的是分类配置,配置都是一样的
|
||||||
|
|||||||
36
src/com/uiuipad/os/manager/bean/ClassConfig.java
Normal file
36
src/com/uiuipad/os/manager/bean/ClassConfig.java
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package com.uiuipad.os.manager.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ClassConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = 3113893274162914847L;
|
||||||
|
|
||||||
|
List<String> pkgs;
|
||||||
|
int id;
|
||||||
|
long time;
|
||||||
|
|
||||||
|
public List<String> getPkgs() {
|
||||||
|
return pkgs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkgs(List<String> pkgs) {
|
||||||
|
this.pkgs = pkgs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(long time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -255,15 +255,22 @@ public class LoaderTask implements Runnable {
|
|||||||
* 需要隐藏的图标
|
* 需要隐藏的图标
|
||||||
*/
|
*/
|
||||||
private HashSet<String> hideApp = new HashSet<String>() {{
|
private HashSet<String> hideApp = new HashSet<String>() {{
|
||||||
this.add(BuildConfig.APPLICATION_ID);
|
|
||||||
this.add("com.android.quicksearchbox");
|
this.add("com.android.quicksearchbox");
|
||||||
this.add("com.st.nfc.dta.mobile");
|
this.add("com.st.nfc.dta.mobile");
|
||||||
this.add("com.mediatek.ygps");
|
this.add("com.mediatek.ygps");
|
||||||
this.add("com.mediatek.factorymode");
|
this.add("com.mediatek.factorymode");
|
||||||
this.add("org.chromium.browser");
|
this.add("org.chromium.browser");
|
||||||
this.add("com.android.email");
|
this.add("com.android.email");
|
||||||
|
this.add("com.uiui.sn");
|
||||||
|
this.add("com.uiui.zy");
|
||||||
|
this.add("com.ygyb.yischool");
|
||||||
|
this.add("com.cube.setlauncherdef");
|
||||||
|
this.add("com.iflytek.speechcloud");
|
||||||
|
this.add("com.oirsdfg89.flg");
|
||||||
|
this.add("com.android.browser");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统应用只显示这几个
|
* 系统应用只显示这几个
|
||||||
*/
|
*/
|
||||||
@@ -316,12 +323,10 @@ public class LoaderTask implements Runnable {
|
|||||||
for (LauncherActivityInfo app : apps) {
|
for (LauncherActivityInfo app : apps) {
|
||||||
Log.e("verifyApplications", "AllAPP: pkg = " + app.getApplicationInfo().packageName);
|
Log.e("verifyApplications", "AllAPP: pkg = " + app.getApplicationInfo().packageName);
|
||||||
Log.e("verifyApplications", "AllAPP: className = " + app.getComponentName().getClassName());
|
Log.e("verifyApplications", "AllAPP: className = " + app.getComponentName().getClassName());
|
||||||
if ("com.ygyb.yischool".equals(app.getApplicationInfo().packageName)
|
if (hideApp.contains(app.getApplicationInfo().packageName)) {
|
||||||
|| "com.cube.setlauncherdef".equals(app.getApplicationInfo().packageName)
|
continue;
|
||||||
|| "com.iflytek.speechcloud".equals(app.getApplicationInfo().packageName)
|
}
|
||||||
|| "com.oirsdfg89.flg".equals(app.getApplicationInfo().packageName)
|
if ("com.uiuipad.os.Launcher".equals(app.getComponentName().getClassName()))
|
||||||
|| "com.uiuipad.os.Launcher".equals(app.getComponentName().getClassName())
|
|
||||||
)
|
|
||||||
continue;
|
continue;
|
||||||
if (is_control == 1) {
|
if (is_control == 1) {
|
||||||
if ("org.chromium.chrome".equals(app.getApplicationInfo().packageName)
|
if ("org.chromium.chrome".equals(app.getApplicationInfo().packageName)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.uiuipad.os.uiuiutils.ApkUtils;
|
|||||||
import com.arialyy.annotations.Download;
|
import com.arialyy.annotations.Download;
|
||||||
import com.arialyy.aria.core.Aria;
|
import com.arialyy.aria.core.Aria;
|
||||||
import com.arialyy.aria.core.task.DownloadTask;
|
import com.arialyy.aria.core.task.DownloadTask;
|
||||||
|
import com.uiuipad.os.uiuiutils.Utils;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ import java.util.HashMap;
|
|||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||||
|
|
||||||
public class MainService extends Service implements MainSContact.MainView, LifecycleProvider<ActivityEvent> {
|
public class MainService extends Service implements MainSContact.MainView, LifecycleProvider<ActivityEvent>, NetworkUtils.OnNetworkStatusChangedListener {
|
||||||
private String TAG = MainService.class.getSimpleName();
|
private String TAG = MainService.class.getSimpleName();
|
||||||
|
|
||||||
public static final String ALARMWAKEUP = "KUXIN_ALARM_WAKEUP";
|
public static final String ALARMWAKEUP = "KUXIN_ALARM_WAKEUP";
|
||||||
@@ -64,6 +65,19 @@ public class MainService extends Service implements MainSContact.MainView, Lifec
|
|||||||
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
|
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisconnected() {
|
||||||
|
Log.e(TAG, "网络未连接");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||||
|
Log.e(TAG, "onConnected: 网络已连接");
|
||||||
|
if (Utils.isScreenOn(MainService.this)) {
|
||||||
|
mPresenter.getTimeManageSn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinder onBind(Intent intent) {
|
public IBinder onBind(Intent intent) {
|
||||||
return mMainBinder;
|
return mMainBinder;
|
||||||
@@ -83,6 +97,7 @@ public class MainService extends Service implements MainSContact.MainView, Lifec
|
|||||||
Log.e(TAG, "onCreate: ");
|
Log.e(TAG, "onCreate: ");
|
||||||
registerReceivers();
|
registerReceivers();
|
||||||
Aria.download(this).register();
|
Aria.download(this).register();
|
||||||
|
NetworkUtils.registerNetworkStatusChangedListener(this);
|
||||||
|
|
||||||
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
||||||
mPresenter = new MainSPresenter(this);
|
mPresenter = new MainSPresenter(this);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import android.net.wifi.WifiInfo;
|
|||||||
import android.net.wifi.WifiManager;
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
import android.os.PowerManager;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -368,4 +369,10 @@ public class Utils {
|
|||||||
int position = url.lastIndexOf("/");
|
int position = url.lastIndexOf("/");
|
||||||
return url.substring(position + 1);
|
return url.substring(position + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isScreenOn(Context context) {
|
||||||
|
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
|
//true为打开,false为关闭
|
||||||
|
return powerManager.isInteractive();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user