Update App info behavior for mainline module

As requested by framework team, the mainline module should be considered
as system apps and not stoppable and disable-able. Since many of these
modules provide critical functionality, disabling them can result in a
very unstable device.

According to the request, Settings will apply below changes to App info
page for protecting mainline modules:
- Hide "Force stop" and "Disable" in App info.
- Disable "Clear storage" and "Clear cache" in "Storage & cache".

Since the mainline module checking API interface changed, also change
the dependent files and test cases.

Fixes: 156955322
Test: robotest and verify "Cell Broadcast Service" in App info
Change-Id: Ibc239bdaf3364eda541a33add382364cfdc6fc9b
This commit is contained in:
Yanting Yang
2020-06-11 12:36:53 +08:00
parent 37d5ed5073
commit 62b15ac669
6 changed files with 107 additions and 11 deletions

View File

@@ -744,7 +744,9 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
}
private boolean isSystemModule() {
return mAppEntry != null && AppUtils.isSystemModule(mContext, mAppEntry.info.packageName);
return mAppEntry != null
&& (AppUtils.isSystemModule(mContext, mAppEntry.info.packageName)
|| AppUtils.isMainlineModule(mPm, mAppEntry.info.packageName));
}
/**