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
61718ac1
Commit
61718ac1
authored
Oct 25, 2022
by
Takatoshi Miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Task #49379【Android12】API31対応 Bluetooth Permissionを追加
parent
091d434d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
2 deletions
+47
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/Constant.java
+1
-0
ABVJE_Launcher_Android/AndroidManifest.xml
+4
-2
ABVJE_Res_Default_Android/res/values-ja/strings.xml
+1
-0
ABVJE_Res_Default_Android/res/values-ko/strings.xml
+1
-0
ABVJE_Res_Default_Android/res/values/strings.xml
+1
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ABookSettingFragment.java
+5
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookPermissionHelper.java
+34
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/Constant.java
View file @
61718ac1
...
...
@@ -127,6 +127,7 @@ public class Constant {
int
AccessFineLocation
=
1
;
int
Camera
=
2
;
int
Audio
=
3
;
int
Bluetooth
=
4
;
}
public
interface
TaskReportLevel
{
...
...
ABVJE_Launcher_Android/AndroidManifest.xml
View file @
61718ac1
...
...
@@ -21,8 +21,10 @@
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<!-- an app to access precise location from location sources such as GPS, cell towers, and Wi-Fi -->
<uses-permission
android:name=
"android.permission.RECORD_AUDIO"
/>
<!-- AudioPlayView -->
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH_ADMIN"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH"
android:maxSdkVersion=
"30"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion=
"30"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH_SCAN"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH_CONNECT"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.REQUEST_INSTALL_PACKAGES"
/>
...
...
ABVJE_Res_Default_Android/res/values-ja/strings.xml
View file @
61718ac1
...
...
@@ -1535,6 +1535,7 @@
<string
name=
"msg_over_used"
>
使用回数が上限を超えました。他の機器を使用してください。
</string>
<string
name=
"msg_power_off"
>
機器の電源がOFFになりました。電源を入れて再接続してください。
</string>
<string
name=
"alcohol_checker"
>
アルコールチェッカー
</string>
<string
name=
"msg_permission_dialog_bluetooth"
>
Bluetooth利用権限が必要です。\nアプリ設定画面へ遷移します。
</string>
<!-- atForm -->
<string
name=
"msg_disconnected_device"
>
デバイスと切断されました。
</string>
...
...
ABVJE_Res_Default_Android/res/values-ko/strings.xml
View file @
61718ac1
...
...
@@ -1540,6 +1540,7 @@
<string
name=
"msg_over_used"
>
사용 횟수가 상한을 넘었습니다.다른 기기를 사용해 주십시오.
</string>
<string
name=
"msg_power_off"
>
기기의 전원이 OFF되었습니다.전원을 켜고 다시 연결해 주십시오.
</string>
<string
name=
"alcohol_checker"
>
알코올 검사기
</string>
<string
name=
"msg_permission_dialog_bluetooth"
>
Bluetooth 이용권한이 필요합니다. \n앱설정화면으로 이동합니다.
</string>
<!-- atform -->
<string
name=
"pairing_search_scan"
>
주사
</string>
<string
name=
"pairing_search_stop"
>
멈추다
</string>
...
...
ABVJE_Res_Default_Android/res/values/strings.xml
View file @
61718ac1
...
...
@@ -1536,6 +1536,7 @@
<string
name=
"msg_over_used"
>
The number of uses has exceeded the upper limit. Please use other device.
</string>
<string
name=
"msg_power_off"
>
The power of the device has been turned off. Turn on the power and reconnect.
</string>
<string
name=
"alcohol_checker"
>
Alcohol Checker
</string>
<string
name=
"msg_permission_dialog_bluetooth"
>
Bluetooth usage authority is required. \n To transition to the application setting screen.
</string>
<!-- Form -->
<string
name=
"msg_connection_timeout"
>
Could not connect to device.
</string>
<string
name=
"msg_disconnected_device"
>
Disconnected from the device.
</string>
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ABookSettingFragment.java
View file @
61718ac1
...
...
@@ -501,6 +501,11 @@ public class ABookSettingFragment extends PreferenceFragment {
@Override
public
boolean
onPreferenceClick
(
Preference
preference
)
{
try
{
// アプリ側のBluetooth許可チェック
ABookPermissionHelper
helper
=
new
ABookPermissionHelper
(
getActivity
(),
Constant
.
ABookPermissionType
.
Bluetooth
,
null
);
if
(!
helper
.
checkMultiPermissions
(
true
))
{
return
true
;
}
// ペアリング設定画面(BLE通信)
Intent
intent
=
new
Intent
();
intent
.
setClass
(
getActivity
(),
BlePairingSettingActivity
.
class
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookPermissionHelper.java
View file @
61718ac1
...
...
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import
jp.agentec.abook.abv.bl.common.Callback
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
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.util.AlertDialogUtil
;
...
...
@@ -82,6 +83,18 @@ public class ABookPermissionHelper {
android
.
Manifest
.
permission
.
RECORD_AUDIO
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
RECORD_AUDIO
);
}
// アルコールチェッカーHW設定がONかつAndroid12以上の場合のみ
if
(
ABVDataCache
.
getInstance
().
serviceOption
.
isAlcoholCheckerHw
()
&&
Build
.
VERSION
.
SDK_INT
>
30
)
{
// Bluetooth
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
BLUETOOTH_CONNECT
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
BLUETOOTH_CONNECT
);
}
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
BLUETOOTH_SCAN
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
reqPermissions
.
add
(
android
.
Manifest
.
permission
.
BLUETOOTH_SCAN
);
}
}
return
reqPermissions
;
}
...
...
@@ -151,6 +164,27 @@ public class ABookPermissionHelper {
getUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
));
}
break
;
case
Constant
.
ABookPermissionType
.
Bluetooth
:
// Android12未満では実施しない
if
(
Build
.
VERSION
.
SDK_INT
<
31
)
{
break
;
}
// Bluetooth
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
BLUETOOTH_CONNECT
)
!=
PERMISSION_GRANTED
)
{
// リソースパターンの適用
permitionTextResourceId
=
PatternStringUtil
.
patternToInt
(
mContext
,
R
.
string
.
msg_permission_dialog_bluetooth
,
getUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
));
}
if
(
ContextCompat
.
checkSelfPermission
(
mContext
,
android
.
Manifest
.
permission
.
BLUETOOTH_SCAN
)
!=
PERMISSION_GRANTED
)
{
// リソースパターンの適用
permitionTextResourceId
=
PatternStringUtil
.
patternToInt
(
mContext
,
R
.
string
.
msg_permission_dialog_bluetooth
,
getUserPref
(
mContext
,
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
));
}
break
;
}
if
(
permitionTextResourceId
>
0
)
{
...
...
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