am 8452776b: am 5ff35f8a: Merge "Disallow FEATURE_INDETERMINATE_PROGRESS for clockwork. Make LauncherActivity CTS tests pass on clockwork. Bug: 14657859" into klp-modular-dev
* commit '8452776b950b26f86324636242dd302a596fae1d': Disallow FEATURE_INDETERMINATE_PROGRESS for clockwork. Make LauncherActivity CTS tests pass on clockwork. Bug: 14657859
This commit is contained in:
@@ -340,9 +340,11 @@ public abstract class LauncherActivity extends ListActivity {
|
||||
super.onCreate(icicle);
|
||||
|
||||
mPackageManager = getPackageManager();
|
||||
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
setProgressBarIndeterminateVisibility(true);
|
||||
|
||||
if (!mPackageManager.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 (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)) {
|
||||
setProgressBarIndeterminateVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateAlertTitle() {
|
||||
|
||||
@@ -44,6 +44,7 @@ import android.app.ActivityOptions;
|
||||
import android.app.KeyguardManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
@@ -301,6 +302,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user