Merge "Hide AppButtonsPreferenceController for system modules." into qt-dev am: 76cf0dbddd am: c756190b9c

am: 35870d6e5b

Change-Id: I46ef78848acec0f723719fdf778ff9a828d0fb85
This commit is contained in:
Narayan Kamath
2019-05-20 08:24:12 -07:00
committed by android-build-merger
2 changed files with 55 additions and 9 deletions

View File

@@ -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
*/