[Android] Restrict diffutil dataset write permission

Geoffrey Métais git at videolan.org
Mon Feb 5 17:18:20 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Sat Feb  3 15:53:07 2018 +0100| [49ba77983de10e2ea6d8526c6d062f05b42992de] | committer: Geoffrey Métais

Restrict diffutil dataset write permission

> https://code.videolan.org/videolan/vlc-android/commit/49ba77983de10e2ea6d8526c6d062f05b42992de
---

 vlc-android/src/org/videolan/vlc/gui/DiffUtilAdapter.kt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/DiffUtilAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/DiffUtilAdapter.kt
index 71eea9729..0a8a2cba5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DiffUtilAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/DiffUtilAdapter.kt
@@ -3,7 +3,6 @@ package org.videolan.vlc.gui
 import android.support.annotation.WorkerThread
 import android.support.v7.util.DiffUtil
 import android.support.v7.widget.RecyclerView
-import android.util.Log
 import kotlinx.coroutines.experimental.android.UI
 import kotlinx.coroutines.experimental.channels.Channel
 import kotlinx.coroutines.experimental.channels.actor
@@ -14,6 +13,7 @@ import java.util.*
 abstract class DiffUtilAdapter<D, VH : RecyclerView.ViewHolder> : RecyclerView.Adapter<VH>() {
 
     protected var dataset: List<D> = listOf()
+    private set
     @Volatile private var last = dataset
     private val diffCallback by lazy(LazyThreadSafetyMode.NONE) { createCB() }
     private val updateActor = actor<List<D>>(newSingleThreadContext("vlc-updater"), capacity = Channel.CONFLATED) {
@@ -28,7 +28,6 @@ abstract class DiffUtilAdapter<D, VH : RecyclerView.ViewHolder> : RecyclerView.A
 
     @WorkerThread
     private suspend fun internalUpdate(list: List<D>) {
-        Log.d("dua", "old list ${dataset.size} -> ${list.size}")
         val finalList = prepareList(list)
         val result = DiffUtil.calculateDiff(diffCallback.apply { update(dataset, finalList) }, detectMoves())
         launch(UI) {



More information about the Android mailing list