Commit a17455e7 by Kim Jinsung

#64361 Android14対応

parent da08b453
......@@ -8,7 +8,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_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.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
......@@ -40,9 +40,12 @@
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<!-- Android13 -->
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<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"/>
......
......@@ -12,7 +12,7 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<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" />
<!-- Wifi使用権限 -->
......
......@@ -90,6 +90,7 @@ public interface AppDefType {
//Android13から追加した権限追加
String ANDROID_13_NOTIFICATION_PERMISSION_CHECK = "android13NotificationPermissionCheck";
String ANDROID_13_IMAGE_VIDEO_CHECK_PERMISSION_CHECK = "android13ImageVideoPermissionCheck";
String ANDROID_14_PERMISSION_CHECK = "android14PermissionCheck";
}
interface SubMenuType {
......
......@@ -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;
}
public ArrayList<String> checkMultiPermissions() {
......@@ -107,12 +120,18 @@ public class ABookPermissionHelper {
reqPermissions.add(android.Manifest.permission.READ_MEDIA_IMAGES);
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,
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);
}
} else {
// ストレージ
if (ContextCompat.checkSelfPermission(mContext,
......@@ -160,7 +179,11 @@ public class ABookPermissionHelper {
switch (mPermitionType) {
case Constant.ABookPermissionType.ReadExternalStorage:
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) {
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