Sharesheet - Add additional checks for low ram devices

Continue to hide the direct share area for low ram devices. Make sure
the A-Z list loads properly.

Bug: 132342311
Test: Use low ram device
Change-Id: I66b58af3994e034e4d870286ef62ba4a9289e083
This commit is contained in:
Matt Pietal
2019-05-29 07:14:14 -04:00
parent 2cf040d602
commit 030bd8471f

View File

@@ -1603,7 +1603,8 @@ public class ChooserActivity extends ResolverActivity {
*/
@Nullable
private AppPredictor getAppPredictorForDirectShareIfEnabled() {
return USE_PREDICTION_MANAGER_FOR_DIRECT_TARGETS ? getAppPredictor() : null;
return USE_PREDICTION_MANAGER_FOR_DIRECT_TARGETS && !ActivityManager.isLowRamDeviceStatic()
? getAppPredictor() : null;
}
/**
@@ -2349,6 +2350,8 @@ public class ChooserActivity extends ResolverActivity {
@Override
public void onListRebuilt() {
updateAlphabeticalList();
// don't support direct share on low ram devices
if (ActivityManager.isLowRamDeviceStatic()) {
return;
@@ -2379,7 +2382,6 @@ public class ChooserActivity extends ResolverActivity {
queryTargetServices(this);
}
updateAlphabeticalList();
}
@Override
@@ -2830,7 +2832,7 @@ public class ChooserActivity extends ResolverActivity {
// There can be at most one row in the listview, that is internally
// a ViewGroup with 2 rows
public int getServiceTargetRowCount() {
if (isSendAction(getTargetIntent())) {
if (isSendAction(getTargetIntent()) && !ActivityManager.isLowRamDeviceStatic()) {
return 1;
}
return 0;