Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
5d0d5b5d
Commit
5d0d5b5d
authored
Aug 18, 2022
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Android/Context: allow type=nullptr in GetExternalFilesDir()
parent
1aa3c1e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
Context.cxx
src/android/Context.cxx
+3
-4
Context.hxx
src/android/Context.hxx
+4
-1
No files found.
src/android/Context.cxx
View file @
5d0d5b5d
...
...
@@ -44,13 +44,12 @@ Context::Initialise(JNIEnv *env) noexcept
}
AllocatedPath
Context
::
GetExternalFilesDir
(
JNIEnv
*
env
,
const
char
*
_
type
)
noexcept
Context
::
GetExternalFilesDir
(
JNIEnv
*
env
,
const
char
*
type
)
noexcept
{
assert
(
_type
!=
nullptr
);
Java
::
String
type
{
env
,
_type
};
jobject
file
=
env
->
CallObjectMethod
(
Get
(),
getExternalFilesDir_method
,
type
.
Get
());
jobject
file
=
env
->
CallObjectMethod
(
Get
(),
getExternalFilesDir_method
,
Java
::
String
::
Optional
(
env
,
type
).
Get
());
if
(
Java
::
DiscardException
(
env
)
||
file
==
nullptr
)
return
nullptr
;
...
...
src/android/Context.hxx
View file @
5d0d5b5d
...
...
@@ -36,9 +36,12 @@ public:
Context
(
JNIEnv
*
env
,
jobject
obj
)
noexcept
:
Java
::
GlobalObject
(
env
,
obj
)
{}
/**
* @param type the subdirectory name; may be nullptr
*/
[[
gnu
::
pure
]]
AllocatedPath
GetExternalFilesDir
(
JNIEnv
*
env
,
const
char
*
type
)
noexcept
;
const
char
*
type
=
nullptr
)
noexcept
;
[[
gnu
::
pure
]]
AllocatedPath
GetCacheDir
(
JNIEnv
*
env
)
const
noexcept
;
...
...
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