feat: suspend apps from the configuration (setPackagesSuspended)

オープン
#142 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
android, java, kotlin, react, typescript

調査の方向性

Find the config.apply parsing and the Android device agent code that calls DevicePolicyManager.setPackagesSuspended, then locate the console configuration app list for the optional Suspended action. Verify behavior for API 24+, packages that Android refuses to suspend, reapplying configuration at boot, and unsuspending packages removed from suspendedApps; the feature is done when the configured packages are suspended without uninstalling them and the agent reports rejected packages.

索引モデルが issue の本文から書いたものです。

説明

enhancement
Area

Device agent (Android)

The problem

On fully managed phones (parental control, small fleet) I sometimes need an app to stop working without removing it: for example blocked on school days, or until a rule is agreed on. Today the options are:

  • uninstall it (app.uninstall, #7 / #54): its data is lost, and it can simply be reinstalled;
  • kiosk mode: only the listed apps can run, which is far too strict for daily use;
  • DNS blocking: works for online apps only, and only while DNS goes through the filter.

None of them keeps the app installed but unusable.

Proposed solution

A list in the configuration, applied by the agent with DevicePolicyManager.setPackagesSuspended (API 24, Device Owner):

  • Key: suspendedApps in the config.apply document (open to another name): the package names to suspend. The app stays installed with its data, its icon is greyed out, and opening it shows the system's "app paused by your admin" dialog.
  • A package removed from the list is unsuspended. An absent key means not managed.
  • Suspension is lost if the app is uninstalled and reinstalled. Each config.apply, including the re-apply at boot, could suspend the listed packages again. Android 8+ no longer delivers PACKAGE_ADDED to manifest receivers, so another trigger would be needed to catch a reinstall right away.
  • Android refuses to suspend some packages (the Device Owner itself, the default launcher and dialer, etc.): setPackagesSuspended returns them, and the agent could report them in the result.
  • Console: a "Suspended" action or toggle in the configuration's app list, or a button in the device's Apps tab (#134).

#70 (blocking installs) and this one cover different needs: #70 stops new apps, this stops a given app that is already installed.

Alternatives considered
  • setApplicationHidden: the app disappears entirely, which is more confusing for the user and harder to notice.
  • DNS blocking (AdGuard Home and similar): useful, but bypassed by turning the VPN off or changing Private DNS, and useless for offline apps.
  • Kiosk mode: too strict, see above.
Before submitting
  • I searched existing issues and discussions for the same idea.
主要言語
Java
スター
44
フォーク
25
平均マージ
1日 13時間
マージ済み PR(30日)
80

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MDMesh-app/MDMesh のほかの issue

MDMesh-app/MDMesh の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。