Merge "Disallow FEATURE_INDETERMINATE_PROGRESS for clockwork. Make LauncherActivity CTS tests pass on clockwork. Bug: 14657859" into klp-modular-dev

This commit is contained in:
Aaron Whyte
2014-05-13 01:44:18 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 4 deletions

View File

@@ -340,9 +340,11 @@ public abstract class LauncherActivity extends ListActivity {
super.onCreate(icicle);
mPackageManager = getPackageManager();
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
}
onSetContentView();
mIconResizer = new IconResizer();
@@ -357,7 +359,9 @@ public abstract class LauncherActivity extends ListActivity {
updateAlertTitle();
updateButtonText();
setProgressBarIndeterminateVisibility(false);
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
setProgressBarIndeterminateVisibility(false);
}
}
private void updateAlertTitle() {

View File

@@ -278,6 +278,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
throw new AndroidRuntimeException(
"You cannot combine swipe dismissal and the action bar.");
}
if (featureId == FEATURE_INDETERMINATE_PROGRESS &&
getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
throw new AndroidRuntimeException("You cannot use indeterminate progress on a watch.");
}
return super.requestFeature(featureId);
}