Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c87d93ae authored by Daniel Sandler's avatar Daniel Sandler Committed by Android Git Automerger
Browse files

am 598cfcad: Merge "Properly launch quicksettings activities." into jb-mr1-dev

* commit '598cfcad':
  Properly launch quicksettings activities.
parents 5642ed8c 598cfcad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ public abstract class BaseStatusBar extends SystemUI implements
        return mBarService;
    }

    protected boolean isDeviceProvisioned() {
    public boolean isDeviceProvisioned() {
        return mDeviceProvisioned;
    }

+0 −9
Original line number Diff line number Diff line
@@ -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()) {
+4 −3
Original line number Diff line number Diff line
@@ -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();
    }
+24 −2
Original line number Diff line number Diff line
@@ -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) {
+6 −4
Original line number Diff line number Diff line
@@ -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);
        }
    }
}