Hide AppButtonsPreferenceController for system modules.
Bug: 131927465 Test: atest AppButtonsPreferenceControllerTest Change-Id: I2d3aa3429f61325afe49bfe322522fe9ccd03b2c
This commit is contained in:
@@ -160,8 +160,7 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
// TODO(b/37313605): Re-enable once this controller supports instant apps
|
||||
return mAppEntry != null && !AppUtils.isInstant(mAppEntry.info)
|
||||
? AVAILABLE : DISABLED_FOR_USER;
|
||||
return isInstantApp() || isSystemModule() ? DISABLED_FOR_USER : AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -685,6 +684,14 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isInstantApp() {
|
||||
return mAppEntry != null && AppUtils.isInstant(mAppEntry.info);
|
||||
}
|
||||
|
||||
private boolean isSystemModule() {
|
||||
return mAppEntry != null && AppUtils.isSystemModule(mContext, mAppEntry.info.packageName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the status of disable/enable for a package
|
||||
*/
|
||||
|
Reference in New Issue
Block a user