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
7474269f
Commit
7474269f
authored
Oct 10, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash on 4.4
parent
40447ce1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/main/scala/com/github/shadowsocks/ShadowsocksApplication.scala
...scala/com/github/shadowsocks/ShadowsocksApplication.scala
+6
-2
No files found.
src/main/scala/com/github/shadowsocks/ShadowsocksApplication.scala
View file @
7474269f
...
...
@@ -43,6 +43,7 @@ import java.util
import
java.util.Locale
import
java.util.concurrent.TimeUnit
import
android.annotation.SuppressLint
import
android.app.Application
import
android.content.res.Configuration
import
android.os.
{
Build
,
LocaleList
}
...
...
@@ -62,8 +63,10 @@ object ShadowsocksApplication {
private
final
val
TAG
=
"ShadowsocksApplication"
// The ones in Locale doesn't have script included
private
final
lazy
val
SIMPLIFIED_CHINESE
=
Locale
.
forLanguageTag
(
"zh-Hans-CN"
)
private
final
lazy
val
TRADITIONAL_CHINESE
=
Locale
.
forLanguageTag
(
"zh-Hant-TW"
)
private
final
lazy
val
SIMPLIFIED_CHINESE
=
if
(
Build
.
VERSION
.
SDK_INT
>=
21
)
Locale
.
forLanguageTag
(
"zh-Hans-CN"
)
else
Locale
.
SIMPLIFIED_CHINESE
private
final
lazy
val
TRADITIONAL_CHINESE
=
if
(
Build
.
VERSION
.
SDK_INT
>=
21
)
Locale
.
forLanguageTag
(
"zh-Hant-TW"
)
else
Locale
.
TRADITIONAL_CHINESE
}
class
ShadowsocksApplication
extends
Application
{
...
...
@@ -115,6 +118,7 @@ class ShadowsocksApplication extends Application {
}
}
else
null
@SuppressLint
(
Array
(
"NewApi"
))
private
def
checkChineseLocale
(
config
:
Configuration
)
:
Unit
=
if
(
Build
.
VERSION
.
SDK_INT
>=
24
)
{
val
localeList
=
config
.
getLocales
val
newList
=
new
Array
[
Locale
](
localeList
.
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