Merge "Hide AppButtonsPreferenceController for system modules." into qt-dev

This commit is contained in:
Narayan Kamath
2019-05-20 07:42:53 +00:00
committed by Android (Google) Code Review
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
*/