fix:
update:优化app霸屏
This commit is contained in:
2022-06-09 20:38:48 +08:00
parent 83159cc584
commit b917401e86
12 changed files with 81 additions and 15 deletions

View File

@@ -4,11 +4,15 @@ import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.provider.Settings;
import android.util.Log;
import com.aoleyun.sn.SystemInfoInterface;
import com.aoleyun.sn.utils.ForegroundAppUtil;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.SPUtils;
import com.aoleyun.sn.utils.Utils;
import com.tencent.mmkv.MMKV;
import java.util.List;
@@ -51,6 +55,14 @@ public class RemoteService extends Service {
List<String> disable = JGYUtils.getInstance().getDisablePackage();
return disable;
}
@Override
public String getTopAppPackage() throws RemoteException {
String pkg = Settings.Global.getString(getContentResolver(), ForegroundAppUtil.TOPAPP_KEY);
Log.e(TAG, "getTopAppPackage: " + pkg);
return pkg;
}
};

View File

@@ -824,7 +824,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
*/
@SuppressLint("NewApi")
synchronized private void installApkByPackage(String filePath, String pkg) {
String oldListString = Settings.System.getString(getContentResolver(), "qch_app_forbid");
String oldListString = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
HashSet<String> packageList = new HashSet<>(Arrays.asList(oldListString.split(",")));
if (!packageList.contains(pkg)) {
Log.e(TAG, "installApkByPackage: " + "packageName: " + pkg + " not in whitelist");