diff options
author | Daniel Sandler <dsandler@android.com> | 2012-09-24 13:42:36 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-24 13:42:36 -0700 |
commit | 598cfcad42c117a05c4a6f3f75c415b1146170d1 (patch) | |
tree | 254ba295c6fa8703656334a8f4bda9f68e7a4e92 /packages | |
parent | 4249be40bd1c51dae37c27f9450ed01f19edcbef (diff) | |
parent | 3ffdcc70c28d7a2abbb4f248d32d70d45d61fd44 (diff) | |
download | frameworks_base-598cfcad42c117a05c4a6f3f75c415b1146170d1.zip frameworks_base-598cfcad42c117a05c4a6f3f75c415b1146170d1.tar.gz frameworks_base-598cfcad42c117a05c4a6f3f75c415b1146170d1.tar.bz2 |
Merge "Properly launch quicksettings activities." into jb-mr1-dev
Diffstat (limited to 'packages')
5 files changed, 35 insertions, 19 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index dab6306..ec67c15 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -143,7 +143,7 @@ public abstract class BaseStatusBar extends SystemUI implements return mBarService; } - protected boolean isDeviceProvisioned() { + public boolean isDeviceProvisioned() { return mDeviceProvisioned; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index a4a3a6a..57528a5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -381,15 +381,6 @@ public class PanelView extends FrameLayout { mBar = panelBar; } - public void setImeWindowStatus(boolean visible) { - // To be implemented by classes extending PanelView - } - - public void setup(NetworkController network, BluetoothController bt, BatteryController batt, - LocationController location) { - // To be implemented by classes extending PanelView - } - public void collapse() { // TODO: abort animation or ongoing touch if (!isFullyCollapsed()) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index c55da5d..7e44b16 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -171,7 +171,7 @@ public class PhoneStatusBar extends BaseStatusBar { TextView mNotificationPanelDebugText; // settings - PanelView mSettingsPanel; + SettingsPanelView mSettingsPanel; int mSettingsPanelGravity; // top bar @@ -426,8 +426,9 @@ public class PhoneStatusBar extends BaseStatusBar { } // Quick Settings (WIP) - mSettingsPanel = (PanelView) mStatusBarWindow.findViewById(R.id.settings_panel); + mSettingsPanel = (SettingsPanelView) mStatusBarWindow.findViewById(R.id.settings_panel); mSettingsPanel.setBar(mStatusBarView); + mSettingsPanel.setService(this); mSettingsPanel.setup(mNetworkController, mBluetoothController, mBatteryController, mLocationController); @@ -1854,7 +1855,7 @@ public class PhoneStatusBar extends BaseStatusBar { } // Update the QuickSettings container - ((SettingsPanelView) mSettingsPanel).updateResources(); + mSettingsPanel.updateResources(); loadDimens(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java index 37fa524..2d9c1ea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; +import android.app.ActivityManagerNative; import android.app.AlertDialog; import android.app.Dialog; import android.app.PendingIntent; @@ -36,6 +37,7 @@ import android.hardware.display.DisplayManager; import android.hardware.display.WifiDisplayStatus; import android.net.Uri; import android.os.Handler; +import android.os.RemoteException; import android.os.SystemProperties; import android.os.UserHandle; import android.provider.ContactsContract; @@ -75,6 +77,7 @@ class QuickSettings { private DisplayManager mDisplayManager; private WifiDisplayStatus mWifiDisplayStatus; + private PhoneStatusBar mStatusBarService; private BrightnessController mBrightnessController; private BluetoothController mBluetoothController; @@ -129,6 +132,14 @@ class QuickSettings { mBar = bar; } + public void setService(PhoneStatusBar phoneStatusBar) { + mStatusBarService = phoneStatusBar; + } + + public PhoneStatusBar getService() { + return mStatusBarService; + } + public void setImeWindowStatus(boolean visible) { mModel.onImeWindowStatusChanged(visible); } @@ -203,10 +214,21 @@ class QuickSettings { Intent intent = new Intent(action); startSettingsActivity(intent); } + private void startSettingsActivity(Intent intent) { + startSettingsActivity(intent, true); + } + + private void startSettingsActivity(Intent intent, boolean onlyProvisioned) { + if (onlyProvisioned && !getService().isDeviceProvisioned()) return; + try { + // Dismiss the lock screen when Settings starts. + ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity(); + } catch (RemoteException e) { + } intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); - mBar.collapseAllPanels(true); - mContext.startActivityAsUser(intent, UserHandle.CURRENT); + mContext.startActivityAsUser(intent, UserHandle.USER_CURRENT); + getService().animateCollapse(); } private void addUserTiles(ViewGroup parent, LayoutInflater inflater) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java index 4a7a424..2ed450dd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java @@ -58,18 +58,14 @@ public class SettingsPanelView extends PanelView { } } - @Override public void setImeWindowStatus(boolean visible) { if (mQS != null) { mQS.setImeWindowStatus(visible); } } - @Override public void setup(NetworkController networkController, BluetoothController bluetoothController, BatteryController batteryController, LocationController locationController) { - super.setup(networkController, bluetoothController, batteryController, locationController); - if (mQS != null) { mQS.setup(networkController, bluetoothController, batteryController, locationController); @@ -93,4 +89,10 @@ public class SettingsPanelView extends PanelView { "settings,v=" + vel); super.fling(vel, always); } + + public void setService(PhoneStatusBar phoneStatusBar) { + if (mQS != null) { + mQS.setService(phoneStatusBar); + } + } } |