Commit a17455e7 by Kim Jinsung

#64361 Android14対応

parent da08b453
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
...@@ -40,9 +40,12 @@ ...@@ -40,9 +40,12 @@
<permission <permission
android:name="${applicationId}.permission.C2D_MESSAGE" android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
<!-- Android13 -->
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<!-- Android14 -->
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"/>
<supports-screens android:anyDensity="true" android:xlargeScreens="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="false"/> <supports-screens android:anyDensity="true" android:xlargeScreens="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="false"/>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- Wifi使用権限 --> <!-- Wifi使用権限 -->
......
...@@ -90,6 +90,7 @@ public interface AppDefType { ...@@ -90,6 +90,7 @@ public interface AppDefType {
//Android13から追加した権限追加 //Android13から追加した権限追加
String ANDROID_13_NOTIFICATION_PERMISSION_CHECK = "android13NotificationPermissionCheck"; String ANDROID_13_NOTIFICATION_PERMISSION_CHECK = "android13NotificationPermissionCheck";
String ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK = "android13ImageVideoPermissionCheck"; String ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK = "android13ImageVideoPermissionCheck";
String ANDROID_14_PERMISSION_CHECK = "android14PermissionCheck";
} }
interface SubMenuType { interface SubMenuType {
......
...@@ -78,6 +78,19 @@ public class ABookPermissionHelper { ...@@ -78,6 +78,19 @@ public class ABookPermissionHelper {
} }
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { //Android14以上
boolean android14PermissionCheckFlg = PreferenceUtil.getUserPref(mContext, AppDefType.UserPrefKey.ANDROID_14_PERMISSION_CHECK, true);
if (android14PermissionCheckFlg) {
if (ContextCompat.checkSelfPermission(mContext,
android.Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) != PackageManager.PERMISSION_GRANTED) {
reqPermissions.add(android.Manifest.permission.READ_MEDIA_VIDEO);
reqPermissions.add(android.Manifest.permission.READ_MEDIA_IMAGES);
reqPermissions.add(android.Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED);
}
PreferenceUtil.putUserPref(mContext, AppDefType.UserPrefKey.ANDROID_14_PERMISSION_CHECK, false);
}
}
return reqPermissions; return reqPermissions;
} }
public ArrayList<String> checkMultiPermissions() { public ArrayList<String> checkMultiPermissions() {
...@@ -107,12 +120,18 @@ public class ABookPermissionHelper { ...@@ -107,12 +120,18 @@ public class ABookPermissionHelper {
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); PreferenceUtil.putUserPref(mContext, AppDefType.UserPrefKey.ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK, false);
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { //Android14以上
if (ContextCompat.checkSelfPermission(mContext,
android.Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) != PackageManager.PERMISSION_GRANTED) {
reqPermissions.add(android.Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED);
PreferenceUtil.putUserPref(mContext, AppDefType.UserPrefKey.ANDROID_14_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); PreferenceUtil.putUserPref(mContext, AppDefType.UserPrefKey.ANDROID_13_NOTIFICATION_PERMISSION_CHECK, false);
} }
} else { } else {
// ストレージ // ストレージ
if (ContextCompat.checkSelfPermission(mContext, if (ContextCompat.checkSelfPermission(mContext,
...@@ -160,7 +179,11 @@ public class ABookPermissionHelper { ...@@ -160,7 +179,11 @@ public class ABookPermissionHelper {
switch (mPermitionType) { switch (mPermitionType) {
case Constant.ABookPermissionType.ReadExternalStorage: case Constant.ABookPermissionType.ReadExternalStorage:
boolean permissionGranted = true; boolean permissionGranted = true;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { //Android13以上 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { //Android14以上
if (ContextCompat.checkSelfPermission(mContext, android.Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) != PERMISSION_GRANTED) {
permissionGranted = false;
}
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { //Android13以上
if (ContextCompat.checkSelfPermission(mContext, android.Manifest.permission.READ_MEDIA_IMAGES) != PERMISSION_GRANTED) { if (ContextCompat.checkSelfPermission(mContext, android.Manifest.permission.READ_MEDIA_IMAGES) != PERMISSION_GRANTED) {
permissionGranted = false; permissionGranted = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment