From 4291960c7dfbd5ddc6458385a09341f3cf006a48 Mon Sep 17 00:00:00 2001 From: goneil Date: Tue, 23 Jan 2018 17:37:26 -0800 Subject: [PATCH] Move from an alert dialog to a full screen dialog for SIM app install Bug: 70906683 Test: Local install and tests Change-Id: Idafee66814ec3e7b8a4a1254ba5f3e55b7bf864a --- api/system-current.txt | 2 + core/java/android/provider/Settings.java | 22 +++++ core/proto/android/providers/settings.proto | 2 + .../drawable/ic_signal_cellular_alt_24px.xml | 40 ++++++++ core/res/res/values/config.xml | 4 + core/res/res/values/strings.xml | 12 ++- core/res/res/values/symbols.xml | 9 +- .../android/provider/SettingsBackupTest.java | 2 + .../settings/SettingsProtoDumpUtil.java | 6 ++ packages/SimAppDialog/Android.mk | 18 ++++ packages/SimAppDialog/AndroidManifest.xml | 29 ++++++ .../ic_signal_cellular_alt_rounded_24px.xml | 51 ++++++++++ .../SimAppDialog/res/drawable/placeholder.xml | 44 +++++++++ .../layout/install_carrier_app_activity.xml | 57 +++++++++++ .../res/layout/install_carrier_app_footer.xml | 43 +++++++++ packages/SimAppDialog/res/values/strings.xml | 36 +++++++ .../InstallCarrierAppActivity.java | 95 +++++++++++++++++++ 17 files changed, 465 insertions(+), 7 deletions(-) create mode 100644 core/res/res/drawable/ic_signal_cellular_alt_24px.xml create mode 100644 packages/SimAppDialog/Android.mk create mode 100644 packages/SimAppDialog/AndroidManifest.xml create mode 100644 packages/SimAppDialog/res/drawable/ic_signal_cellular_alt_rounded_24px.xml create mode 100644 packages/SimAppDialog/res/drawable/placeholder.xml create mode 100644 packages/SimAppDialog/res/layout/install_carrier_app_activity.xml create mode 100644 packages/SimAppDialog/res/layout/install_carrier_app_footer.xml create mode 100644 packages/SimAppDialog/res/values/strings.xml create mode 100644 packages/SimAppDialog/src/com/android/simappdialog/InstallCarrierAppActivity.java diff --git a/api/system-current.txt b/api/system-current.txt index 39cbe90894ee0..efc5350a27dc2 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4162,6 +4162,8 @@ package android.provider { method public static void resetToDefaults(android.content.ContentResolver, java.lang.String); field public static final java.lang.String AUTOFILL_COMPAT_ALLOWED_PACKAGES = "autofill_compat_allowed_packages"; field public static final java.lang.String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; + field public static final java.lang.String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = "install_carrier_app_notification_persistent"; + field public static final java.lang.String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = "install_carrier_app_notification_sleep_millis"; field public static final java.lang.String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; field public static final java.lang.String THEATER_MODE_ON = "theater_mode_on"; field public static final java.lang.String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 1223271ad4c74..8e2494ee84743 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -12096,6 +12096,28 @@ public final class Settings { public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = "enable_gnss_raw_meas_full_tracking"; + /** + * Whether the notification should be ongoing (persistent) when a carrier app install is + * required. + * + * The value is a boolean (1 or 0). + * @hide + */ + @SystemApi + public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = + "install_carrier_app_notification_persistent"; + + /** + * The amount of time (ms) to hide the install carrier app notification after the user has + * ignored it. After this time passes, the notification will be shown again + * + * The value is a long + * @hide + */ + @SystemApi + public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = + "install_carrier_app_notification_sleep_millis"; + /** * Whether we've enabled zram on this device. Takes effect on * reboot. The value "1" enables zram; "0" disables it, and diff --git a/core/proto/android/providers/settings.proto b/core/proto/android/providers/settings.proto index 02fc4da4d2207..6b92aa8e8ffae 100644 --- a/core/proto/android/providers/settings.proto +++ b/core/proto/android/providers/settings.proto @@ -422,6 +422,8 @@ message GlobalSettingsProto { optional SettingProto enable_deletion_helper_no_threshold_toggle = 340 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto notification_snooze_options = 341 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto enable_gnss_raw_meas_full_tracking = 346 [ (android.privacy).dest = DEST_AUTOMATIC ]; + optional SettingProto install_carrier_app_notification_persistent = 356 [ (android.privacy).dest = DEST_AUTOMATIC ]; + optional SettingProto install_carrier_app_notification_sleep_millis = 357 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto zram_enabled = 347 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto smart_replies_in_notifications_flags = 348 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto show_first_crash_dialog = 349 [ (android.privacy).dest = DEST_AUTOMATIC ]; diff --git a/core/res/res/drawable/ic_signal_cellular_alt_24px.xml b/core/res/res/drawable/ic_signal_cellular_alt_24px.xml new file mode 100644 index 0000000000000..29f1f431c1992 --- /dev/null +++ b/core/res/res/drawable/ic_signal_cellular_alt_24px.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 0218750d0f872..e58b02f844a14 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2328,6 +2328,10 @@ com.android.vpndialogs/com.android.vpndialogs.AlwaysOnDisconnectedDialog + + com.android.simappdialog/com.android.simappdialog.InstallCarrierAppActivity + ;com.android.settings; diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 0efb6f91fce04..4e9ec16b2c54e 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -182,6 +182,8 @@ Voicemail messages Wi-Fi calling + + SIM status Peer requested TTY Mode FULL @@ -3194,10 +3196,12 @@ Restart - To get your new SIM working properly, you\'ll need to install and open an app from your carrier. - - GET THE APP - NOT NOW + Activate mobile service + + Download the carrier app to activate your new SIM + + + Download app New SIM inserted Tap to set it up diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 5a9dc7fa92beb..ee99709f10b0a 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -574,6 +574,7 @@ + @@ -1383,6 +1384,7 @@ + @@ -2072,6 +2074,7 @@ + @@ -2771,9 +2774,9 @@ - - - + + + diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java index dc8ed9efaa760..3e1b96040e7d3 100644 --- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java +++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java @@ -402,6 +402,8 @@ public class SettingsBackupTest { Settings.Global.GPU_DEBUG_APP, Settings.Global.GPU_DEBUG_LAYERS, Settings.Global.ENABLE_GNSS_RAW_MEAS_FULL_TRACKING, + Settings.Global.INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT, + Settings.Global.INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS, Settings.Global.NETWORK_ACCESS_TIMEOUT_MS, Settings.Global.WARNING_TEMPERATURE, Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY, diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index 769b7e9a13c50..1e8c523a9e342 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -870,6 +870,12 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Global.ENABLE_GNSS_RAW_MEAS_FULL_TRACKING, GlobalSettingsProto.ENABLE_GNSS_RAW_MEAS_FULL_TRACKING); + dumpSetting(s, p, + Settings.Global.INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT, + GlobalSettingsProto.INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT); + dumpSetting(s, p, + Settings.Global.INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS, + GlobalSettingsProto.INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS); // Settings.Global.SHOW_PROCESSES intentionally excluded since it's deprecated. dumpSetting(s, p, Settings.Global.LOW_POWER_MODE, diff --git a/packages/SimAppDialog/Android.mk b/packages/SimAppDialog/Android.mk new file mode 100644 index 0000000000000..00a2e60b29f48 --- /dev/null +++ b/packages/SimAppDialog/Android.mk @@ -0,0 +1,18 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := SimAppDialog +LOCAL_CERTIFICATE := platform + + +LOCAL_STATIC_ANDROID_LIBRARIES := \ + android-support-v4 + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res +include frameworks/opt/setupwizard/library/common-platform-deprecated.mk + +include $(BUILD_PACKAGE) diff --git a/packages/SimAppDialog/AndroidManifest.xml b/packages/SimAppDialog/AndroidManifest.xml new file mode 100644 index 0000000000000..873f6c5bac543 --- /dev/null +++ b/packages/SimAppDialog/AndroidManifest.xml @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/packages/SimAppDialog/res/drawable/ic_signal_cellular_alt_rounded_24px.xml b/packages/SimAppDialog/res/drawable/ic_signal_cellular_alt_rounded_24px.xml new file mode 100644 index 0000000000000..85896e8a2687f --- /dev/null +++ b/packages/SimAppDialog/res/drawable/ic_signal_cellular_alt_rounded_24px.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SimAppDialog/res/drawable/placeholder.xml b/packages/SimAppDialog/res/drawable/placeholder.xml new file mode 100644 index 0000000000000..53eee7437c169 --- /dev/null +++ b/packages/SimAppDialog/res/drawable/placeholder.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/packages/SimAppDialog/res/layout/install_carrier_app_activity.xml b/packages/SimAppDialog/res/layout/install_carrier_app_activity.xml new file mode 100644 index 0000000000000..0462a9365c902 --- /dev/null +++ b/packages/SimAppDialog/res/layout/install_carrier_app_activity.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + diff --git a/packages/SimAppDialog/res/layout/install_carrier_app_footer.xml b/packages/SimAppDialog/res/layout/install_carrier_app_footer.xml new file mode 100644 index 0000000000000..10dcb77a65841 --- /dev/null +++ b/packages/SimAppDialog/res/layout/install_carrier_app_footer.xml @@ -0,0 +1,43 @@ + + + + + +