Skip to content

Commit

Permalink
SimSettings: Port manual provisiong support
Browse files Browse the repository at this point in the history
commit 1751f6f
Author: Danny Baumann <dannybaumann@web.de>
Date:   Thu Feb 16 14:50:56 2017 +0100

    Fix possible NPE on SIM settings shutdown.

    Change-Id: Ibf6b54fc2b97a780cfd7ace17c54855ef7e70c57

commit f982e03
Author: Danny Baumann <dannybaumann@web.de>
Date:   Tue Feb 28 12:26:37 2017 +0100

    Clean up SIM enable toggle implementation

    - Move strings to cm_strings.xml
    - Improve string wording
    - Remove unused code
    - Streamline implementation

    Change-Id: I58fc3002cfcc37dd1798819223289cc541bed211

commit 7adcacb2b7b586f2cc1fe26db769e63553a89494
Author: Ricardo Cerqueira <ricardo@cyngn.com>
Date:   Thu Jul 28 12:29:40 2016 +0100

    SimSettings: Make provisioning optional even if qti-telephony is present

    Current code assumes the manual provisioning options should come
    up if the qti-telephony blob is present. Don't make that assumption.

    Change-Id: I5e4f28b628e3fe3fe9e506631e92c85103e87ccf

commit bdc7782bceb1dfe27996aa4be6bdbae865777aaa
Author: Venkatraman Nerellapalli <venkataraman.nerellapalli@codeaurora.org>
Date:   Sat Jan 9 17:20:00 2016 +0530

    Telephony(MSIM): Fix ANR on SIM deactivation

    Dismiss dialog box on confirmation.
    SIM activation & deactivation in background thread.

    Change-Id: I0268a710f35e30b2abec3dd671942b52fc0e0b46
    CRs-Fixed: 957308

commit e7f94ba9a879bd0928efade6ed3734eb829ed834
Author: Luca Stefani <luca.stefani.ge1@gmail.com>
Date:   Sun Jul 3 21:56:08 2016 +0200

    Settings: Disable sim switch if subscription isn't valid

    Change-Id: I22ba9a3270da13f77fdd43586b7dc487f0929453

commit c6856615eb456139108570dc855356e0cb95ab7c
Author: LuK1337 <priv.luk@gmail.com>
Date:   Sun Jul 3 22:11:26 2016 +0200

    Settings: Don't set the icon for sim activation / deactivation dialog

    * This icon doesn't look any good.
      It's better to just get rid of it.

    Change-Id: I47f70a80136695e9aa61ff98999a2cf770390079

commit 9e21654c1d8f3393cfb662866b64e3531645e31b
Author: LuK1337 <priv.luk@gmail.com>
Date:   Sun Jan 3 22:32:00 2016 +0100

    Hide manual provisioning switch when extphone framework is not present

    * It doesn't work without it.

    Change-Id: Iec11ec2006059f26668f2a6fee4c2c9ca6650119

commit 00823fa8f1f91da538440425e676b95b4d829457
Author: Ricardo Cerqueira <ricardo@cyngn.com>
Date:   Thu Nov 5 18:23:52 2015 +0000

    Break MSIM dependency on qci-telephony-framework

    If the provisioning state is invalid, the framework is most likely
    absent. Consider the card as provisioned to pass all relevant checks.

    Change-Id: I975ff156e4328e9d3f6e2626a863bbacb29e3337

commit e92619a138fc1a2370ed0d583bae0573c214eaf0
Author: Sandeep Gutta <sangutta@codeaurora.org>
Date:   Mon Sep 14 20:14:07 2015 +0530

    Telephony(MSIM): Select preferred primary sub.

    Add UI to select preferred primary sub.
    It is used when two SIM cards inserted have same
    priority as per policy.

    Change-Id: I5726fe9f4df03e680dc2406854d08da77297444d

commit dade627ff0569117908a5ef47f93251530c6f319
Author: Sandeep Gutta <sangutta@codeaurora.org>
Date:   Sun Sep 13 22:09:23 2015 +0530

    Telephony(MSIM): Fix to do not allow both SIM deactivation

    Use proper SubInfo record object to do not allow
    user to deactivate both SIMs on DSDS devices.

    Change-Id: I6f56d819367272b3a009c7a8133709c643e8bd84
    CRs-Fixed: 893504

commit d9983cb15c59672f3030869a6b5f143da5320866
Author: Sandeep Gutta <sangutta@codeaurora.org>
Date:   Mon Aug 10 15:09:59 2015 +0530

    Telephony(MSIM): Manual provision related fixes

    - Consider Manual provision state while displaying
      active sub info list.
    - Enable sms/data user preference option only
      if more than one subscription active.
    - Introduce below system proeprty to control AOSP
      behavior of user selection of fallback preference
      for sms/data
      "persist.radio.aosp_usr_pref_sel"

    Change-Id: I2b308b801f3f677c5a3ffaee5a8e6beda12aedd2

commit 86b04f6dfd56383bc0142cb5d03ebca9648b5061
Author: Chaitanya Saggurthi <csaggurt@codeaurora.org>
Date:   Thu Jul 16 16:33:34 2015 +0530

    Telephony(MSIM): Add Manual provisioning support

    Add toggle switch UI option in SimSettings screen to
    enable/disable SIM cards

    Change-Id: Id07271aedb12eabc0b106ac278ba2e12c71cfe03

@xyyx: port to O

Change-Id: Iba3110c0bbc1038873510b17b88a5388285e08a8
  • Loading branch information
Thecrazyskull authored and akhilnarang committed Jan 25, 2018
1 parent d9e34f6 commit f2149b2
Show file tree
Hide file tree
Showing 5 changed files with 595 additions and 8 deletions.
1 change: 1 addition & 0 deletions Android.mk
Expand Up @@ -34,6 +34,7 @@ LOCAL_JAVA_LIBRARIES := \
core-oj \
telephony-common \
ims-common \
telephony-ext \
org.dirtyunicorns.utils

LOCAL_JAVA_LIBRARIES += org.apache.http.legacy
Expand Down
39 changes: 39 additions & 0 deletions res/layout/custom_sim_switch.xml
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright (c) 2014, 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.
*
*/
-->
<Switch xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sub_switch_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clickable="true"
android:focusable="false"
android:padding="8dip" />
17 changes: 17 additions & 0 deletions res/values/cm_strings.xml
Expand Up @@ -84,4 +84,21 @@

<!-- Volume link notification -->
<string name="volume_link_notification_title">Link ring &amp; notification volumes</string>

<!-- Manual provisioning support -->
<string name="sim_enabler_summary"><xliff:g id="displayName">%1$s</xliff:g> is <xliff:g id="status" example="disabled">%2$s</xliff:g></string>
<string name="sim_disabled">disabled</string>
<string name="sim_missing">missing or faulty</string>
<string name="sim_enabler_need_disable_sim">SIM card will be deactivated. Do you want to continue?</string>
<string name="sim_enabler_will_disable_sim_title">Attention</string>
<string name="sim_enabler_need_switch_data_service">This SIM will be disabled and SIM <xliff:g id="slotid">%1$s</xliff:g> will be used for data services. Are you sure you want to continue?</string>
<string name="sim_enabler_airplane_on">Unable to perform the operation while airplane mode is on.</string>
<string name="sim_enabler_in_call">Unable to perform the operation while in call.</string>
<string name="sim_enabler_both_inactive">Can\'t disable all SIM cards</string>
<string name="sim_enabler_enabling">Activating\u2026</string>
<string name="sim_enabler_disabling">Deactivating\u2026</string>
<string name="sub_activate_success">SIM activated.</string>
<string name="sub_activate_failed">Activation failed.</string>
<string name="sub_deactivate_success">SIM deactivated.</string>
<string name="sub_deactivate_failed">Deactivation failed.</string>
</resources>
6 changes: 6 additions & 0 deletions res/values/config.xml
Expand Up @@ -127,4 +127,10 @@
-->
<integer name="config_fingerprintSensorLocation">0</integer>

<!-- Does the device allow for manual subscription provisioning? Only works for multi-sim devices,
and currently depends on QC's proprietary telephony stack -->
<bool name="config_enableManualSubProvisioning">true</bool>

<!-- Whether notify user that switch data service -->
<bool name="confirm_to_switch_data_service">false</bool>
</resources>

0 comments on commit f2149b2

Please sign in to comment.