Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
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
Nabil Sadki
cordova-plugin-local-notifications
Commits
16fa62f4
Commit
16fa62f4
authored
Nov 07, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fallback to normal cache dir if there is no external
parent
ced7c19a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
AssetUtil.java
src/android/notification/util/AssetUtil.java
+12
-7
No files found.
src/android/notification/util/AssetUtil.java
View file @
16fa62f4
...
...
@@ -129,10 +129,8 @@ public final class AssetUtil {
String
fileName
=
resPath
.
substring
(
resPath
.
lastIndexOf
(
'/'
)
+
1
);
File
file
=
getTmpFile
(
fileName
);
if
(
file
==
null
)
{
Log
.
e
(
"Asset"
,
"Missing external cache dir"
);
if
(
file
==
null
)
return
Uri
.
EMPTY
;
}
try
{
AssetManager
assets
=
context
.
getAssets
();
...
...
@@ -189,10 +187,8 @@ public final class AssetUtil {
private
Uri
getUriFromRemote
(
String
path
)
{
File
file
=
getTmpFile
();
if
(
file
==
null
)
{
Log
.
e
(
"Asset"
,
"Missing external cache dir"
);
if
(
file
==
null
)
return
Uri
.
EMPTY
;
}
try
{
URL
url
=
new
URL
(
path
);
...
...
@@ -340,7 +336,11 @@ public final class AssetUtil {
File
dir
=
context
.
getExternalCacheDir
();
if
(
dir
==
null
)
{
Log
.
e
(
"Asset"
,
"Missing external cache dir"
);
dir
=
context
.
getCacheDir
();
}
if
(
dir
==
null
)
{
Log
.
e
(
"Asset"
,
"Missing cache dir"
);
return
null
;
}
...
...
@@ -360,8 +360,13 @@ public final class AssetUtil {
* @return content://...
*/
private
Uri
getUriFromFile
(
File
file
)
{
try
{
String
authority
=
context
.
getPackageName
()
+
".provider"
;
return
AssetProvider
.
getUriForFile
(
context
,
authority
,
file
);
}
catch
(
IllegalArgumentException
e
)
{
e
.
printStackTrace
();
return
Uri
.
EMPTY
;
}
}
/**
...
...
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