version:6.4
fix: update:桌面背景更换,增加管控显示第三方应用
This commit is contained in:
@@ -186,6 +186,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
public void initData() {
|
||||
registmNewAppReceiver();
|
||||
registerSOSNumberReceiver();
|
||||
registerUpdateDesktopReceiver();
|
||||
mAlarmServiceConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
@@ -344,7 +345,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
}
|
||||
}
|
||||
|
||||
private void getData(){
|
||||
private void getData() {
|
||||
if (!isNotificationListenersEnabled()) {
|
||||
ToastUtil.show("请授予\"" + getString(R.string.app_name) + "\"使用通知权");
|
||||
gotoNotificationAccessSetting(this);
|
||||
@@ -483,6 +484,12 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
if (mNewAppReceiver != null) {
|
||||
unregisterReceiver(mNewAppReceiver);
|
||||
}
|
||||
if (sosNumberReceiver != null) {
|
||||
unregisterReceiver(sosNumberReceiver);
|
||||
}
|
||||
if (updateDesktopReceiver != null) {
|
||||
unregisterReceiver(updateDesktopReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
private void registmNewAppReceiver() {
|
||||
@@ -534,6 +541,27 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
}
|
||||
}
|
||||
|
||||
private UpdateDesktopReceiver updateDesktopReceiver;
|
||||
|
||||
private void registerUpdateDesktopReceiver() {
|
||||
if (updateDesktopReceiver == null) {
|
||||
updateDesktopReceiver = new UpdateDesktopReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction("UPDATE_DESKTOP_ICON");
|
||||
registerReceiver(updateDesktopReceiver, filter);
|
||||
}
|
||||
|
||||
class UpdateDesktopReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.e(TAG, "onReceive: " + intent.getAction());
|
||||
addData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemSettings() {
|
||||
mMainPresenter.getDesktopLayout();
|
||||
|
||||
@@ -80,7 +80,6 @@ public class PrivacyPolicyDialog extends AlertDialog {
|
||||
}
|
||||
}, 122, 128, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
spannableString.setSpan(new ForegroundColorSpan(Color.BLUE), 122, 128, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
// spannableString.setSpan(new ClickableSpan() {
|
||||
// @Override
|
||||
// public void onClick(@NonNull View widget) {
|
||||
@@ -88,7 +87,6 @@ public class PrivacyPolicyDialog extends AlertDialog {
|
||||
// }
|
||||
// }, 129, 137, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
// spannableString.setSpan(new ForegroundColorSpan(Color.BLUE), 129, 137, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
tv_content.setText(spannableString);
|
||||
tv_content.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -163,6 +164,13 @@ public class ApkUtils {
|
||||
Log.i(TAG, "queryFilterAppInfo: " + resolveInfo.activityInfo.packageName);
|
||||
allowPackages.add(resolveInfo.activityInfo.packageName);
|
||||
}
|
||||
String appListString = Settings.System.getString(context.getContentResolver(), "only_jgy_shortcut_list");
|
||||
List<String> packageList = new ArrayList<>();
|
||||
if (!TextUtils.isEmpty(appListString)) {
|
||||
packageList = new ArrayList<>(Arrays.asList(appListString.split(",")));
|
||||
}
|
||||
|
||||
int setting_other_appInstaller = Settings.Global.getInt(context.getContentResolver(), "setting_other_appInstaller", 0);
|
||||
|
||||
for (ApplicationInfo app : appInfos) {
|
||||
if (appIsDisable(context, app.packageName)) {
|
||||
@@ -175,12 +183,14 @@ public class ApkUtils {
|
||||
applicationInfos.add(app);
|
||||
}
|
||||
} else {
|
||||
// if(app.uid > 10000){//通过uid排除系统应用,在一些手机上效果不好
|
||||
// applicationInfos.add(app);
|
||||
// }
|
||||
if (allowPackages.contains(app.packageName) && !excludePackageName.contains(app.packageName)) {
|
||||
// if (allowPackages.contains(app.packageName)) {
|
||||
applicationInfos.add(app);
|
||||
if (setting_other_appInstaller == 0) {//不显示自己安装的
|
||||
if (packageList.contains(app.packageName)){
|
||||
applicationInfos.add(app);
|
||||
}
|
||||
}else {
|
||||
if (allowPackages.contains(app.packageName) && !excludePackageName.contains(app.packageName)) {
|
||||
applicationInfos.add(app);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,7 +198,6 @@ public class ApkUtils {
|
||||
applicationInfos.removeIf(applicationInfo -> "com.uiui.city".equals(applicationInfo.packageName));
|
||||
// applicationInfos.removeIf(applicationInfo -> "com.uiui.sn".equals(applicationInfo.packageName));
|
||||
}
|
||||
|
||||
applicationInfos.sort(new Comparator<ApplicationInfo>() {
|
||||
@Override
|
||||
public int compare(ApplicationInfo o1, ApplicationInfo o2) {
|
||||
|
||||
Reference in New Issue
Block a user