Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
d07118da
Commit
d07118da
authored
Sep 03, 2024
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AndroidOSバージョンアップ時、権限チェック処理追加
アプリバージョンアップ時、権限チェック処理追加
parent
7fd6a7c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletions
+51
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVSplashActivity.java
+10
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/AppDefType.java
+4
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookPermissionHelper.java
+37
-0
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVSplashActivity.java
View file @
d07118da
...
@@ -71,7 +71,16 @@ public abstract class ABVSplashActivity extends ABVNoAuthenticatedActivity {
...
@@ -71,7 +71,16 @@ public abstract class ABVSplashActivity extends ABVNoAuthenticatedActivity {
REQUEST_PERMISSIONS
);
REQUEST_PERMISSIONS
);
}
}
}
else
{
}
else
{
abookMode
();
//Androidバージョンアップ時追加された権限チェックを追加
ABookPermissionHelper
helper
=
new
ABookPermissionHelper
(
this
);
mPermissionArray
=
helper
.
checkAndroidVersionUpPermissions
();
if
(
mPermissionArray
.
size
()
==
0
)
{
abookMode
();
}
else
{
ActivityCompat
.
requestPermissions
(
this
,
mPermissionArray
.
toArray
(
new
String
[
mPermissionArray
.
size
()]),
REQUEST_PERMISSIONS
);
}
}
}
}
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/AppDefType.java
View file @
d07118da
...
@@ -86,6 +86,10 @@ public interface AppDefType {
...
@@ -86,6 +86,10 @@ public interface AppDefType {
String
CHAT_LAST_ROOMNAME
=
"chatLastRoom"
;
// 最後のルーム名
String
CHAT_LAST_ROOMNAME
=
"chatLastRoom"
;
// 最後のルーム名
String
CHAT_LAST_ROOMID
=
"chatLastRoomId"
;
// 最後のルームID
String
CHAT_LAST_ROOMID
=
"chatLastRoomId"
;
// 最後のルームID
//Android13から追加した権限追加
String
ANDROID_13_NOTIFICATION_PERMISSION_CHECK
=
"android13NotificationPermissionCheck"
;
String
ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK
=
"android13ImageVideoPermissionCheck"
;
}
}
interface
SubMenuType
{
interface
SubMenuType
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookPermissionHelper.java
View file @
d07118da
...
@@ -15,6 +15,7 @@ import java.util.ArrayList;
...
@@ -15,6 +15,7 @@ import java.util.ArrayList;
import
jp.agentec.abook.abv.bl.common.Callback
;
import
jp.agentec.abook.abv.bl.common.Callback
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.cl.util.PreferenceUtil
;
import
jp.agentec.abook.abv.ui.common.appinfo.AppDefType
;
import
jp.agentec.abook.abv.ui.common.appinfo.AppDefType
;
import
jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog
;
import
jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
...
@@ -47,6 +48,38 @@ public class ABookPermissionHelper {
...
@@ -47,6 +48,38 @@ public class ABookPermissionHelper {
mContext
=
context
;
mContext
=
context
;
}
}
/**
* AndroidOSバージョンアップ時の追加権限チェック
* @return 権限文字列の配列
*/
public
ArrayList
<
String
>
checkAndroidVersionUpPermissions
()
{
ArrayList
<
String
>
reqPermissions
=
new
ArrayList
<>();
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
TIRAMISU
)
{
//Android13以上
boolean
chekcImageVideoFlg
=
PreferenceUtil
.
getUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK
,
true
);
if
(
chekcImageVideoFlg
)
{
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
READ_MEDIA_VIDEO
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
READ_MEDIA_VIDEO
);
}
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
READ_MEDIA_IMAGES
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
READ_MEDIA_IMAGES
);
}
PreferenceUtil
.
putUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK
,
false
);
}
boolean
chekcNotificationFlg
=
PreferenceUtil
.
getUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
ANDROID_13_NOTIFICATION_PERMISSION_CHECK
,
true
);
if
(
chekcNotificationFlg
){
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
POST_NOTIFICATIONS
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
POST_NOTIFICATIONS
);
}
PreferenceUtil
.
putUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
ANDROID_13_NOTIFICATION_PERMISSION_CHECK
,
false
);
}
}
return
reqPermissions
;
}
public
ArrayList
<
String
>
checkMultiPermissions
()
{
public
ArrayList
<
String
>
checkMultiPermissions
()
{
ArrayList
<
String
>
reqPermissions
=
new
ArrayList
<>();
ArrayList
<
String
>
reqPermissions
=
new
ArrayList
<>();
...
@@ -67,15 +100,19 @@ public class ABookPermissionHelper {
...
@@ -67,15 +100,19 @@ public class ABookPermissionHelper {
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
READ_MEDIA_VIDEO
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
android
.
Manifest
.
permission
.
READ_MEDIA_VIDEO
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
READ_MEDIA_VIDEO
);
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
READ_MEDIA_VIDEO
);
PreferenceUtil
.
putUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK
,
false
);
}
}
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
READ_MEDIA_IMAGES
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
android
.
Manifest
.
permission
.
READ_MEDIA_IMAGES
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
READ_MEDIA_IMAGES
);
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
READ_MEDIA_IMAGES
);
PreferenceUtil
.
putUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK
,
false
);
}
}
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
POST_NOTIFICATIONS
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
android
.
Manifest
.
permission
.
POST_NOTIFICATIONS
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
POST_NOTIFICATIONS
);
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
POST_NOTIFICATIONS
);
PreferenceUtil
.
putUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
ANDROID_13_NOTIFICATION_PERMISSION_CHECK
,
false
);
}
}
}
else
{
}
else
{
// ストレージ
// ストレージ
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
...
...
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