Handle edge case exception of flush
This commit is contained in:
@@ -5,6 +5,7 @@ import android.os.Build
|
|||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import android.os.RemoteException
|
import android.os.RemoteException
|
||||||
|
import android.system.ErrnoException
|
||||||
import android.system.Os
|
import android.system.Os
|
||||||
import android.system.OsConstants
|
import android.system.OsConstants
|
||||||
import androidx.collection.LongSparseArray
|
import androidx.collection.LongSparseArray
|
||||||
@@ -236,6 +237,8 @@ class RootServer {
|
|||||||
output.flush()
|
output.flush()
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
if (e.isEBADF) throw CancellationException().initCause(e) else throw e
|
if (e.isEBADF) throw CancellationException().initCause(e) else throw e
|
||||||
|
} catch (e: ErrnoException) {
|
||||||
|
if (e.errno == OsConstants.EPIPE) throw CancellationException().initCause(e) else throw e
|
||||||
}
|
}
|
||||||
Logger.me.d("Sent #$counter: $command")
|
Logger.me.d("Sent #$counter: $command")
|
||||||
counter++
|
counter++
|
||||||
|
|||||||
Reference in New Issue
Block a user