public void onDownloadingCompleted()

in LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/room/controller/overview/LiveDataFragment.java [145:220]


    public void onDownloadingCompleted(final DownloadingTaskDescription desc) {
        final VideoEntity videoEntity = desc.getVideo();
        switch (desc.getCategory()) {

            case VIDEO:
                new AsyncTask<Void, Void, Void>() {
                    @Override
                    protected Void doInBackground(Void... voids) {

                        if (AppConfiguration.IS_NETWORK_LATENCY_ENABLED) {
                            addLatency(3000L);
                        }
                        mViewModel.updateDatabase(videoEntity, VIDEO, desc.getStoragePath());
                        return null;
                    }

                    @Override
                    protected void onPostExecute(Void aVoid) {
                        super.onPostExecute(aVoid);
                        Toast.makeText(
                                getActivity().getApplicationContext(),
                                "video " + videoEntity.getId() + " " +
                                        "downloaded",
                                Toast.LENGTH_SHORT).show();
                    }
                }.execute();
                break;

            case BACKGROUND:
                new AsyncTask<Void, Void, Void>() {
                    @Override
                    protected Void doInBackground(Void... voids) {

                        if (AppConfiguration.IS_NETWORK_LATENCY_ENABLED) {
                            addLatency(2000L);
                        }
                        mViewModel.updateDatabase(videoEntity, BACKGROUND, desc.getStoragePath());
                        return null;
                    }

                    @Override
                    protected void onPostExecute(Void aVoid) {
                        super.onPostExecute(aVoid);
                        Toast.makeText(
                                getActivity().getApplicationContext(),
                                "background" + videoEntity.getId() + " " +
                                        "downloaded",
                                Toast.LENGTH_SHORT).show();
                    }
                }.execute();
                break;

            case CARD:
                new AsyncTask<Void, Void, Void>() {
                    @Override
                    protected Void doInBackground(Void... voids) {

                        if (AppConfiguration.IS_NETWORK_LATENCY_ENABLED) {
                            addLatency(1000L);
                        }
                        mViewModel.updateDatabase(videoEntity, CARD, desc.getStoragePath());
                        return null;
                    }

                    @Override
                    protected void onPostExecute(Void aVoid) {
                        super.onPostExecute(aVoid);
                        Toast.makeText(
                                getActivity().getApplicationContext(),
                                "card " + videoEntity.getId() + " downloaded",
                                Toast.LENGTH_SHORT).show();
                    }
                }.execute();
                break;
        }
    }