diff options
author | Aaron Whyte <awhyte@google.com> | 2014-05-13 20:36:31 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-13 20:36:31 +0000 |
commit | 8452776b950b26f86324636242dd302a596fae1d (patch) | |
tree | 3fb10f26c151c767ff771e534adfff91a9565a2d | |
parent | cf768044cdbef02ba9c0d44f33c9f17735f91455 (diff) | |
parent | 5ff35f8a7fa543e43b2e1ea8a23ba6d32563e34b (diff) | |
download | frameworks_base-8452776b950b26f86324636242dd302a596fae1d.zip frameworks_base-8452776b950b26f86324636242dd302a596fae1d.tar.gz frameworks_base-8452776b950b26f86324636242dd302a596fae1d.tar.bz2 |
am 5ff35f8a: Merge "Disallow FEATURE_INDETERMINATE_PROGRESS for clockwork. Make LauncherActivity CTS tests pass on clockwork. Bug: 14657859" into klp-modular-dev
* commit '5ff35f8a7fa543e43b2e1ea8a23ba6d32563e34b':
Disallow FEATURE_INDETERMINATE_PROGRESS for clockwork. Make LauncherActivity CTS tests pass on clockwork. Bug: 14657859
-rw-r--r-- | core/java/android/app/LauncherActivity.java | 12 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/core/java/android/app/LauncherActivity.java b/core/java/android/app/LauncherActivity.java index 96c7246..9ec7f41 100644 --- a/core/java/android/app/LauncherActivity.java +++ b/core/java/android/app/LauncherActivity.java @@ -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() { diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 78020e9..c670b5c 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -43,6 +43,7 @@ import com.android.internal.widget.SwipeDismissLayout; 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; @@ -278,6 +279,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); } |