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

Commit d609fd17 authored by Nishanth Kumar Sirivolu's avatar Nishanth Kumar Sirivolu Committed by Gerrit - the friendly Code Review server
Browse files

MSIM: Provide voice pref selection in qucksettings.

Add new buttons in Quick settings to select preferred
voice SIM card for placing out going calls

CRs-Fixed: 1003527

Change-Id: Ic2811f80085e5f9a25ea589c1c1c9247cad4ab72
parent ab119de4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
    framework-protos \
    SystemUI-proto-tags

LOCAL_JAVA_LIBRARIES := telephony-common
LOCAL_JAVA_LIBRARIES := telephony-common telephony-ext

LOCAL_PACKAGE_NAME := SystemUI
LOCAL_CERTIFICATE := platform
+37 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2016, The Linux Foundation. All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are
  met:
       * Redistributions of source code must retain the above copyright
         notice, this list of conditions and the following disclaimer.
       * Redistributions in binary form must reproduce the above
         copyright notice, this list of conditions and the following
         disclaimer in the documentation and/or other materials provided
         with the distribution.
       * Neither the name of The Linux Foundation nor the names of its
         contributors may be used to endorse or promote products derived
         from this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

  <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp">
  <solid android:color="#6E6E6E"/> <!-- this one is ths color of the Rounded Button -->
  <corners
   android:bottomRightRadius="10dp"
   android:bottomLeftRadius="10dp"
   android:topLeftRadius="10dp"
   android:topRightRadius="10dp"/>
   </shape>
+112 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2016, The Linux Foundation. All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are
  met:
       * Redistributions of source code must retain the above copyright
         notice, this list of conditions and the following disclaimer.
       * Redistributions in binary form must reproduce the above
         copyright notice, this list of conditions and the following
         disclaimer in the documentation and/or other materials provided
         with the distribution.
       * Neither the name of The Linux Foundation nor the names of its
         contributors may be used to endorse or promote products derived
         from this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:paddingStart="24dp"
    android:paddingEnd="16dp"
    android:orientation="horizontal"
    style="@style/BrightnessDialogContainer">

  <LinearLayout android:layout_width="wrap_content"
        android:layout_weight="1"
        android:gravity="center"
        android:layout_height="wrap_content"
        android:orientation="vertical">

    <LinearLayout android:layout_width="120dp"
          android:layout_height="35dp"
          android:orientation="horizontal"
          android:gravity="center_vertical"
          android:id="@+id/sim_switch_slot1_layout"
          android:background="@drawable/rounded_button_shape">

      <ImageView android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical"
          android:id="@+id/sim_switch_slot1_icon"/>

      <TextView
          android:id="@+id/sim_switch_slot_1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:layout_gravity="center"
          android:layout_marginStart="8dp"
          android:text="@string/sim1" />
    </LinearLayout>

    <TextView android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textColor="#ffffff"
          android:gravity="center"
          android:singleLine="true"
          android:ellipsize="end"
          android:id="@+id/slot1name"/>
  </LinearLayout>

  <LinearLayout android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical"
        android:gravity="center">

    <LinearLayout android:layout_width="120dp"
          android:layout_height="35dp"
          android:orientation="horizontal"
          android:gravity="center_vertical"
          android:id="@+id/sim_switch_slot2_layout"
          android:background="@drawable/rounded_button_shape">

      <ImageView android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical"
          android:id="@+id/sim_switch_slot2_icon"/>

      <TextView
          android:id="@+id/sim_switch_slot_2"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:layout_gravity="center"
          android:layout_marginStart="8dp"
          android:text="@string/sim2" />
    </LinearLayout>

    <TextView android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textColor="#ffffff"
          android:gravity="center"
          android:singleLine="true"
          android:ellipsize="end"
          android:id="@+id/slot2name"/>
  </LinearLayout>

</LinearLayout>
+3 −0
Original line number Diff line number Diff line
@@ -1717,4 +1717,7 @@
    <!-- accessibility label for paging indicator in quick settings [CHAR LIMITi=NONE] -->
    <string name="accessibility_quick_settings_page">Page <xliff:g name="current_page" example="1">%1$d</xliff:g> of <xliff:g name="num_pages" example="2">%2$d</xliff:g></string>

    <string name="sim1">SIM 1</string>
    <string name="sim2">SIM 2</string>

</resources>
+11 −0
Original line number Diff line number Diff line
@@ -36,9 +36,11 @@ import com.android.systemui.qs.QSTile.Host.Callback;
import com.android.systemui.qs.customize.QSCustomizer;
import com.android.systemui.qs.external.CustomTile;
import com.android.systemui.settings.BrightnessController;
import com.android.systemui.settings.SimSwitchController;
import com.android.systemui.settings.ToggleSlider;
import com.android.systemui.statusbar.phone.QSTileHost;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
import com.android.systemui.statusbar.policy.MobileSignalController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService.Tunable;

@@ -53,6 +55,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
    protected final Context mContext;
    protected final ArrayList<TileRecord> mRecords = new ArrayList<TileRecord>();
    protected final View mBrightnessView;
    protected View mSimSwitcherView = null;
    private final H mHandler = new H();

    private int mPanelPaddingBottom;
@@ -62,6 +65,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {

    private Callback mCallback;
    private BrightnessController mBrightnessController;
    private SimSwitchController mSimSwitchController;
    protected QSTileHost mHost;

    protected QSFooter mFooter;
@@ -84,6 +88,13 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {

        setOrientation(VERTICAL);

        if(MobileSignalController.isCarrierOneSupported()) {
            mSimSwitcherView = LayoutInflater.from(context).inflate(
                R.layout.sim_switcher, this, false);
            addView(mSimSwitcherView);
            mSimSwitchController = new SimSwitchController(getContext(), mSimSwitcherView, this);
        }

        mBrightnessView = LayoutInflater.from(context).inflate(
                R.layout.quick_settings_brightness_dialog, this, false);
        addView(mBrightnessView);
Loading