update:2020.03.11 新增启动时写入能安装的包名

This commit is contained in:
2020-03-11 18:25:31 +08:00
parent 208b58f854
commit 5e8d5d12e0
4 changed files with 54 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.provider.Settings;
import android.util.Log;
import android.view.WindowManager;
@@ -48,6 +49,8 @@ public class MyDownloadService extends Service {
startService(new Intent(this, StepService.class));
startService(new Intent(this, GuardService.class));
CheckUpdate();
HTTPInterface.getAllAppPackageName(handler);
// new Thread(new Runnable() {
// @Override
// public void run() {
@@ -89,6 +92,15 @@ public class MyDownloadService extends Service {
Bundle bundle = (Bundle) msg.obj;
getFile(bundle);
break;
case 201:
String apppackage = (String) msg.obj;
Log.e("fht", Settings.System.getString(getContentResolver(), "qch_app_forbid") + "?");
if (Settings.System.putString(getContentResolver(), "qch_app_forbid", apppackage)) {
Log.e("fht", "app package write successful");
}
break;
case 202:
break;
}
}
};