Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sobot_android
Sobot_module_Dev
Commits
417dceb9
Commit
417dceb9
authored
Nov 17, 2021
by
app_dev@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉Environment.isExternalStorageLegacy()判断
parent
2e800cab
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
11 deletions
+10
-11
SobotDownload.java
...n/java/com/sobot/network/http/download/SobotDownload.java
+1
-1
SobotBitmapUtil.java
...src/main/java/com/sobot/pictureframe/SobotBitmapUtil.java
+1
-1
SobotIOUtils.java
sobot_utils/src/main/java/com/sobot/utils/SobotIOUtils.java
+2
-2
SobotImageUtils.java
..._utils/src/main/java/com/sobot/utils/SobotImageUtils.java
+1
-1
SobotPathManager.java
...utils/src/main/java/com/sobot/utils/SobotPathManager.java
+4
-5
SobotSDCardUtils.java
...utils/src/main/java/com/sobot/utils/SobotSDCardUtils.java
+1
-1
No files found.
sobot_network/src/main/java/com/sobot/network/http/download/SobotDownload.java
View file @
417dceb9
...
...
@@ -257,7 +257,7 @@ public class SobotDownload {
String
path
;
if
(
isExitsSdcard
())
{
//SD卡已装入
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
Environment
.
isExternalStorageLegacy
()
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
// /storage/emulated/0/sobot/com.sobot.chat.sdktest/cache/
path
=
getRootDir
(
context
)
+
File
.
separator
;
}
else
{
...
...
sobot_pictureframe/src/main/java/com/sobot/pictureframe/SobotBitmapUtil.java
View file @
417dceb9
...
...
@@ -75,7 +75,7 @@ public class SobotBitmapUtil {
@SuppressWarnings
(
"deprecation"
)
public
static
Bitmap
compress
(
String
filePath
,
Context
context
,
boolean
isCamera
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
Environment
.
isExternalStorageLegacy
()
||
isCamera
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
isCamera
)
{
BitmapFactory
.
Options
options
=
new
BitmapFactory
.
Options
();
options
.
inJustDecodeBounds
=
true
;
// 设置后decode图片不会返回一个bitmap对象,但是会将图片的信息封装到Options中
BitmapFactory
.
decodeFile
(
filePath
,
options
);
...
...
sobot_utils/src/main/java/com/sobot/utils/SobotIOUtils.java
View file @
417dceb9
...
...
@@ -576,7 +576,7 @@ public class SobotIOUtils {
// * @return
// */
// public static Uri insertFileIntoMediaStore (Context context,String fileName, String fileType, String relativePath) {
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q
||Environment.isExternalStorageLegacy()
) {
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
// return null;
// }
// ContentResolver resolver = context.getContentResolver();
...
...
@@ -599,7 +599,7 @@ public class SobotIOUtils {
// }
// public static Uri findFileExists(Context context,String filePath) {
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q
||Environment.isExternalStorageLegacy()
) {
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
// File file = new File(filePath);
// if (file.exists()) {
// return FileOpenHelper.getUri(SobotApp.getApplicationContext(), filePath);
...
...
sobot_utils/src/main/java/com/sobot/utils/SobotImageUtils.java
View file @
417dceb9
...
...
@@ -131,7 +131,7 @@ public class SobotImageUtils {
}
final
boolean
isKitKat
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
;
if
(!(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
Environment
.
isExternalStorageLegacy
()
)){
if
(!(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)){
return
uriToFileApiQ
(
context
,
uri
);
}
// DocumentProvider
...
...
sobot_utils/src/main/java/com/sobot/utils/SobotPathManager.java
View file @
417dceb9
...
...
@@ -41,7 +41,6 @@ public class SobotPathManager {
}
return
instance
;
}
public
String
getRootDir
()
{
if
(
mRootPath
==
null
)
{
String
packageName
=
mContext
!=
null
?
mContext
.
getPackageName
()
:
""
;
...
...
@@ -52,7 +51,7 @@ public class SobotPathManager {
//sdcard/download/xxxx/video
public
String
getVideoDir
()
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
Environment
.
isExternalStorageLegacy
())
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
return
getRootDir
()
+
File
.
separator
+
VIDEO_DIR
+
File
.
separator
;
}
else
{
return
mContext
.
getExternalFilesDir
(
Environment
.
DIRECTORY_MOVIES
).
getPath
()
+
File
.
separator
;
...
...
@@ -61,7 +60,7 @@ public class SobotPathManager {
//sdcard/download/xxxx/voice
public
String
getVoiceDir
()
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
Environment
.
isExternalStorageLegacy
())
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
return
getRootDir
()
+
File
.
separator
+
VOICE_DIR
+
File
.
separator
;
}
else
{
return
mContext
.
getExternalFilesDir
(
Environment
.
DIRECTORY_MUSIC
).
getPath
()
+
File
.
separator
;
...
...
@@ -71,7 +70,7 @@ public class SobotPathManager {
//sdcard/download/xxxx/pic
public
String
getPicDir
()
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
Environment
.
isExternalStorageLegacy
())
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
return
getRootDir
()
+
File
.
separator
+
PIC_DIR
+
File
.
separator
;
}
else
{
return
mContext
.
getExternalFilesDir
(
Environment
.
DIRECTORY_PICTURES
).
getPath
()
+
File
.
separator
;
...
...
@@ -81,7 +80,7 @@ public class SobotPathManager {
//sdcard/download/xxxx/cache
public
String
getCacheDir
()
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
Environment
.
isExternalStorageLegacy
())
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
return
getRootDir
()
+
File
.
separator
+
CACHE_DIR
+
File
.
separator
;
}
else
{
return
mContext
.
getExternalFilesDir
(
Environment
.
DIRECTORY_DOWNLOADS
).
getPath
()
+
File
.
separator
+
CACHE_DIR
+
File
.
separator
;
...
...
sobot_utils/src/main/java/com/sobot/utils/SobotSDCardUtils.java
View file @
417dceb9
...
...
@@ -46,7 +46,7 @@ public class SobotSDCardUtils {
String
path
;
if
(
isExitsSdcard
())
{
//SD卡已装入
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
||
Environment
.
isExternalStorageLegacy
()
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
// /storage/emulated/0/sobot/com.sobot.chat.sdktest/cache/
path
=
getRootDir
(
context
)
+
File
.
separator
;
}
else
{
...
...
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