Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
74e6766c
Commit
74e6766c
authored
Dec 12, 2020
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Parcelize for TrafficStats
parent
2409c74a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
15 deletions
+2
-15
core/src/main/java/com/github/shadowsocks/aidl/TrafficStats.kt
...src/main/java/com/github/shadowsocks/aidl/TrafficStats.kt
+2
-15
No files found.
core/src/main/java/com/github/shadowsocks/aidl/TrafficStats.kt
View file @
74e6766c
...
@@ -20,9 +20,10 @@
...
@@ -20,9 +20,10 @@
package
com.github.shadowsocks.aidl
package
com.github.shadowsocks.aidl
import
android.os.Parcel
import
android.os.Parcelable
import
android.os.Parcelable
import
kotlinx.android.parcel.Parcelize
@Parcelize
data class
TrafficStats
(
data class
TrafficStats
(
// Bytes per second
// Bytes per second
var
txRate
:
Long
=
0L
,
var
txRate
:
Long
=
0L
,
...
@@ -35,18 +36,4 @@ data class TrafficStats(
...
@@ -35,18 +36,4 @@ data class TrafficStats(
operator
fun
plus
(
other
:
TrafficStats
)
=
TrafficStats
(
operator
fun
plus
(
other
:
TrafficStats
)
=
TrafficStats
(
txRate
+
other
.
txRate
,
rxRate
+
other
.
rxRate
,
txRate
+
other
.
txRate
,
rxRate
+
other
.
rxRate
,
txTotal
+
other
.
txTotal
,
rxTotal
+
other
.
rxTotal
)
txTotal
+
other
.
txTotal
,
rxTotal
+
other
.
rxTotal
)
constructor
(
parcel
:
Parcel
)
:
this
(
parcel
.
readLong
(),
parcel
.
readLong
(),
parcel
.
readLong
(),
parcel
.
readLong
())
override
fun
writeToParcel
(
parcel
:
Parcel
,
flags
:
Int
)
{
parcel
.
writeLong
(
txRate
)
parcel
.
writeLong
(
rxRate
)
parcel
.
writeLong
(
txTotal
)
parcel
.
writeLong
(
rxTotal
)
}
override
fun
describeContents
()
=
0
companion
object
CREATOR
:
Parcelable
.
Creator
<
TrafficStats
>
{
override
fun
createFromParcel
(
parcel
:
Parcel
)
=
TrafficStats
(
parcel
)
override
fun
newArray
(
size
:
Int
):
Array
<
TrafficStats
?
>
=
arrayOfNulls
(
size
)
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment