Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
android-components
Commits
d9b05587
Commit
d9b05587
authored
Jul 11, 2019
by
Tiger Oakes
Committed by
Tiger Oakes
Jul 12, 2019
Browse files
Issue #3481 - Fix null checks for Q
parent
6d1363d9
Changes
5
Hide whitespace changes
Inline
Side-by-side
components/feature/qr/src/main/java/mozilla/components/feature/qr/QrFragment.kt
View file @
d9b05587
...
...
@@ -179,11 +179,10 @@ class QrFragment : Fragment() {
val
availableImage
=
image
if
(
availableImage
!=
null
)
{
val
buffer
=
availableImage
.
planes
[
0
].
buffer
data
=
ByteArray
(
buffer
.
remaining
())
buffer
.
get
(
data
)
data
=
ByteArray
(
buffer
.
remaining
()).
also
{
buffer
.
get
(
it
)
}
val
width
=
availableImage
.
width
val
height
=
availableImage
.
height
val
source
=
PlanarYUVLuminanceSource
(
data
,
width
,
height
,
0
,
0
,
width
,
height
,
false
)
val
source
=
PlanarYUVLuminanceSource
(
data
!!
,
width
,
height
,
0
,
0
,
width
,
height
,
false
)
val
bitmap
=
BinaryBitmap
(
HybridBinarizer
(
source
))
if
(
qrState
==
STATE_FIND_QRCODE
)
{
qrState
=
STATE_DECODE_PROGRESS
...
...
components/feature/tab-collections/src/androidTest/java/mozilla/components/feature/tab/collections/TabCollectionStorageTest.kt
View file @
d9b05587
...
...
@@ -330,12 +330,12 @@ class TabCollectionStorageTest {
)
assertEquals
(
2
,
storage
.
getTabCollectionsCount
())
assertEquals
(
2
,
TabEntity
.
getStateDirectory
(
context
.
filesDir
).
listFiles
().
size
)
assertEquals
(
2
,
TabEntity
.
getStateDirectory
(
context
.
filesDir
).
listFiles
()
?
.
size
)
storage
.
removeAllCollections
()
assertEquals
(
0
,
storage
.
getTabCollectionsCount
())
assertEquals
(
0
,
TabEntity
.
getStateDirectory
(
context
.
filesDir
).
listFiles
().
size
)
assertEquals
(
0
,
TabEntity
.
getStateDirectory
(
context
.
filesDir
).
listFiles
()
?
.
size
)
}
private
fun
getAllCollections
():
List
<
TabCollection
>
{
...
...
components/lib/crash/src/main/java/mozilla/components/lib/crash/Crash.kt
View file @
d9b05587
...
...
@@ -87,7 +87,7 @@ sealed class Crash {
companion
object
{
fun
fromIntent
(
intent
:
Intent
):
Crash
{
val
bundle
=
intent
.
getBundleExtra
(
INTENT_CRASH
)
val
bundle
=
intent
.
getBundleExtra
(
INTENT_CRASH
)
!!
return
if
(
bundle
.
containsKey
(
INTENT_MINIDUMP_PATH
))
{
NativeCodeCrash
.
fromBundle
(
bundle
)
...
...
components/service/experiments/src/main/java/mozilla/components/service/experiments/debug/ExperimentsDebugActivity.kt
View file @
d9b05587
...
...
@@ -80,8 +80,10 @@ class ExperimentsDebugActivity : Activity() {
intent
.
hasExtra
(
OVERRIDE_BRANCH_EXTRA_KEY
))
{
val
experiment
=
intent
.
getStringExtra
(
OVERRIDE_EXPERIMENT_EXTRA_KEY
)
val
branch
=
intent
.
getStringExtra
(
OVERRIDE_BRANCH_EXTRA_KEY
)
logger
.
info
(
"Override to the following experiment/branch:$experiment/$branch"
)
Experiments
.
setOverride
(
applicationContext
,
experiment
,
true
,
branch
)
if
(
experiment
!=
null
&&
branch
!=
null
)
{
logger
.
info
(
"Override to the following experiment/branch:$experiment/$branch"
)
Experiments
.
setOverride
(
applicationContext
,
experiment
,
true
,
branch
)
}
}
val
intent
=
packageManager
.
getLaunchIntentForPackage
(
packageName
)
...
...
components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/manager/FxaAccountManager.kt
View file @
d9b05587
...
...
@@ -395,7 +395,7 @@ open class FxaAccountManager(
private
fun
processQueueAsync
(
event
:
Event
):
Deferred
<
Unit
>
=
CoroutineScope
(
coroutineContext
).
async
{
eventQueue
.
add
(
event
)
do
{
val
toProcess
=
eventQueue
.
poll
()
val
toProcess
:
Event
=
eventQueue
.
poll
()
!!
val
transitionInto
=
nextState
(
state
,
toProcess
)
if
(
transitionInto
==
null
)
{
...
...
Write
Preview
Supports
Markdown
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