Skip to content

Commit

Permalink
[app] only add to pkgset if it's not ptrbuilt
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed Mar 7, 2022
1 parent 09695b9 commit 382fd6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import github.tornaco.android.thanos.core.app.ThanosManager;
import github.tornaco.android.thanos.core.pm.AppInfo;
import github.tornaco.android.thanos.core.pm.PackageManager;
import github.tornaco.android.thanos.core.pm.PackageSet;
import github.tornaco.android.thanos.core.pm.Pkg;
import github.tornaco.android.thanos.databinding.ActivitySmartFreezeAppsBinding;
import github.tornaco.android.thanos.picker.AppPickerActivity;
Expand Down Expand Up @@ -186,7 +187,13 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
result -> {
if (result.getResultCode() == Activity.RESULT_OK && result.getData() != null && result.getData().hasExtra("apps")) {
List<AppInfo> appInfos = result.getData().getParcelableArrayListExtra("apps");
onRequestAddToSmartFreezeListAskIfAddToPkgSet(appInfos);
PackageSet packageSet = viewModel.getPackageSet();
if (packageSet == null) return;
if (packageSet.isPrebuilt()) {
onRequestAddToSmartFreezeList(appInfos, false);
} else {
onRequestAddToSmartFreezeListAskIfAddToPkgSet(appInfos);
}
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ public void setPkgSetId(@Nullable String pkgSetId) {
this.pkgSetId = pkgSetId;
}

void start() {
loadModels();
@Nullable
public PackageSet getPackageSet() {
return pkgSetId == null ? null : ThanosManager.from(getApplication()).getPkgManager().getPackageSetById(pkgSetId, true);
}

void remove() {

void start() {
loadModels();
}

@Verify
Expand Down

0 comments on commit 382fd6d

Please sign in to comment.