Bladeren bron

1.应用商店增加使用时间限制,传递正在安装参数。

20241218TB223FC(测试jar包)
wangwanlei 8 maanden geleden
bovenliggende
commit
4d3c4af233
1 gewijzigde bestanden met toevoegingen van 13 en 15 verwijderingen
  1. 13
    15
      app/src/main/java/com/xhly/manageapp/AppAdapter.kt

+ 13
- 15
app/src/main/java/com/xhly/manageapp/AppAdapter.kt Bestand weergeven

@@ -82,22 +82,20 @@ class AppAdapter(var context: Context, var data: ArrayList<AppInfo>) :
82 82
                 }
83 83
                 var destroyFlag=false
84 84
                 try {
85
-                   /* val launchIntent = Intent()
86
-                    launchIntent.setComponent(
87
-                        ComponentName(
88
-                            Const.STOREAPPPKG,
89
-                            Const.STOREAPPPKG+".MainActivity"
90
-                        )
91
-                    )
92
-                    context.startActivity(launchIntent)*/
93
-                    val intent: Intent? =
94
-                        context.getPackageManager().getLaunchIntentForPackage(Const.STOREAPPPKG)
95
-                    if (intent != null) {
96
-                        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
97
-                        context.startActivity(intent)
98
-                        destroyFlag=true
85
+                    val appTimeStrategy = StrategyUtils.getAppTimeStrategy(context, appInfo.packageName)
86
+                    if (appTimeStrategy){
87
+                        val intent: Intent? =
88
+                            context.getPackageManager().getLaunchIntentForPackage(Const.STOREAPPPKG)
89
+                        if (intent != null) {
90
+                            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
91
+                            intent.putExtra("isInstalling",InstallUtils.isInstalling)
92
+                            context.startActivity(intent)
93
+                            destroyFlag=true
94
+                        }else{
95
+                            destroyFlag=false
96
+                        }
99 97
                     }else{
100
-                        destroyFlag=false
98
+                        Toaster.showLong(context.getString(R.string.apptimestoptips))
101 99
                     }
102 100
                 }catch (e:Exception){
103 101
                     destroyFlag=false

Laden…
Annuleren
Opslaan