Skip to content

Commit

Permalink
UPDATE: Minor tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
oasisfeng committed Feb 24, 2021
1 parent 93ec58c commit 8d2e44a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
4 changes: 1 addition & 3 deletions engine/src/main/java/com/oasisfeng/island/AdbShell.kt
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ object AdbShell {
}

init {
if (Looper.getMainLooper() == null) Looper.prepareMainLooper() // A prepared Looper is required for the calls below to succeed
if (Looper.getMainLooper() == null) @Suppress("DEPRECATION") Looper.prepareMainLooper() // A prepared Looper is required for the calls below to succeed
}
}

const val TAG = "Island.Adb"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.Manifest.permission.READ_PHONE_STATE
import android.Manifest.permission.READ_SMS
import android.annotation.SuppressLint
import android.app.Activity
import android.app.AlertDialog
import android.app.admin.DevicePolicyManager.ACTION_PROVISION_MANAGED_DEVICE
import android.app.admin.DevicePolicyManager.ACTION_PROVISION_MANAGED_PROFILE
import android.content.BroadcastReceiver
Expand Down Expand Up @@ -97,10 +98,12 @@ class IslandSettingsFragment: android.preference.PreferenceFragment() {
val allowedPackages: Set<String> = policies.invoke(DPM::getCrossProfilePackages)
val allowed = BooleanArray(entries.size) { index -> pkgs[index].packageName in allowedPackages }
Dialogs.buildCheckList(activity, activity.getText(R.string.prompt_manage_cross_profile_apps),
entries, allowed) { _, which, checked -> allowed[which] = checked }.withOkButton {
entries, allowed) { _, which, checked -> allowed[which] = checked }
.setNeutralButton(R.string.action_close) { _,_ ->
pkgs.mapIndexedNotNullTo(ArraySet()) { index, pkg -> if (allowed[index]) pkg.packageName else null }
.toSet().also { policies.invoke(DPM::setCrossProfilePackages, it) }}
.withCancelButton().show() }}
.setPositiveButton(R.string.prompt_manage_cross_profile_apps_footer, null)
.show().apply { getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false } }}

setupNotificationChannelTwoStatePreference(R.string.key_island_watcher, SDK_INT >= P && !Users.isOwner(), NotificationIds.IslandWatcher)
setupNotificationChannelTwoStatePreference(R.string.key_app_watcher, SDK_INT >= O, NotificationIds.IslandAppWatcher)
Expand Down
5 changes: 3 additions & 2 deletions mobile/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<string name="button_setup_island_with_root">通過 ROOT 建立壺中界</string>

<string name="action_clone">分身</string>
<string name="action_clone_back">分身回界外</string>
<string name="action_freeze">凍結</string>
<string name="action_unfreeze">解除凍結</string>
<string name="action_shortcut">建立“解凍並啟動”快速啟動方式</string>
Expand All @@ -76,6 +75,7 @@
<string name="action_activate">啟用</string>
<string name="action_deactivate">解除</string>
<string name="action_rescind">撤除</string>
<string name="action_close">關閉</string>

<string name="menu_tip">提示…</string>
<string name="menu_search">搜尋</string>
Expand Down Expand Up @@ -171,7 +171,8 @@
<string name="prompt_appops_loading">正在載入應用程式列表…</string>
<string name="prompt_appops_no_such_apps">没有應用程式使用此權限</string>
<string name="prompt_appops_revoke_for_all_users_apps">確認對所有用户應用程式(不涉及系统應用程式)撤銷此權限?</string>
<string name="prompt_manage_cross_profile_apps">授權具有跨界互聯能力的應用程式此項特權(部分系统應用程式可能無視此設定獲得特權)</string>
<string name="prompt_manage_cross_profile_apps">授權具有跨界互聯能力的應用程式此項特權</string>
<string name="prompt_manage_cross_profile_apps_footer">部分系统應用程式可能無視此設定享有特權</string>
<string name="pref_quick_controls_header">通知區快速設定控制</string>
<string name="pref_island_watcher_summary">可封印諸界,中止其中所有應用程式的背景活動。再次啟動其中的任何應用程式將會重新啟用。</string>
<string name="pref_app_watcher_summary">可重新凍結最近解凍的應用程式,撤銷臨時授予的權限。</string>
Expand Down
4 changes: 3 additions & 1 deletion mobile/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<string name="action_activate">激活</string>
<string name="action_deactivate">解除</string>
<string name="action_rescind">撤除</string>
<string name="action_close">关闭</string>

<string name="menu_tip">提示…</string>
<string name="menu_search">搜索</string>
Expand Down Expand Up @@ -169,7 +170,8 @@
<string name="prompt_appops_loading">正在载入应用列表…</string>
<string name="prompt_appops_no_such_apps">没有应用使用此权限</string>
<string name="prompt_appops_revoke_for_all_users_apps">确认对所有用户应用(不涉及系统应用)撤销此权限?</string>
<string name="prompt_manage_cross_profile_apps">授权具有跨界互联能力的应用此项特权(部分系统应用可能无视此设置获得特权)</string>
<string name="prompt_manage_cross_profile_apps">授权具有跨界互联能力的应用此项特权</string>
<string name="prompt_manage_cross_profile_apps_footer">部分系统应用可能无视此设置享有特权</string>
<string name="pref_quick_controls_header">通知区快捷控制</string>
<string name="pref_island_watcher_summary">可封印诸界,中止其中所有应用的后台活动。再次启动其中的任何应用将会重新激活。</string>
<string name="pref_app_watcher_summary">可重新冻结最近解冻的应用,撤销临时授予的权限。</string>
Expand Down
4 changes: 3 additions & 1 deletion mobile/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ the sandbox environment. Island never collect data related to your privacy, plea
<string name="action_activate">Activate</string>
<string name="action_deactivate">Deactivate</string>
<string name="action_rescind">Rescind</string>
<string name="action_close">Close</string>

<string name="menu_tip">Tip…</string>
<string name="menu_search">Search</string>
Expand Down Expand Up @@ -172,7 +173,8 @@ the sandbox environment. Island never collect data related to your privacy, plea
<string name="prompt_appops_loading">Loading app list…</string>
<string name="prompt_appops_no_such_apps">No apps with this permission</string>
<string name="prompt_appops_revoke_for_all_users_apps">Are you sure to revoke this permission for all user apps (system apps excluded)?</string>
<string name="prompt_manage_cross_profile_apps">Grant cross-land privilege to apps with this capability. (Some system apps may be always allowed despite this setting)</string>
<string name="prompt_manage_cross_profile_apps">Grant cross-land privilege to apps with this capability.</string>
<string name="prompt_manage_cross_profile_apps_footer">Some system apps may be always privileged despite this setting</string>
<string name="pref_quick_controls_header">Quick controls in notification</string>
<string name="pref_island_watcher_summary">Shortcut to deactivate Island, ceasing all the background activities inside. Island can then be activated on-demand by launching any of the apps inside.</string>
<string name="pref_app_watcher_summary">Shortcut to freeze app recently unfrozen and revoke permissions temporarily granted.</string>
Expand Down

0 comments on commit 8d2e44a

Please sign in to comment.