Support unknown user provisioning for VVM3
Users on legacy visual voicemail or transfering from other devices
may receive a STATUS SMS with the provisioning status "Unknown".
On VVM3 we need to go though a series of URLs to have the user
provisioned.
The STATUS SMS will come with a URL to the voicemail management
gateway. From it we can find the self provisioning gateway URL that
we can modify voicemail services.
A request to the self provisioning gateway to activate basic visual
voicemail will return us with a web page. If the user hasn't
subscribe to it yet it will contain a link to confirm the
subscription. This link should be clicked through cellular network,
and have cookies enabled.
After the process is completed, the carrier should send us another
STATUS SMS with a new or ready user.
+ Moved provisioning to OmtpProvisioningService, which will do it in
the background instead of blocking the SMS receiver.
+ Handle missing MESSAGE_LENGTH field in SyncMessage, this field is
optional.
Change-Id: I473bf62143ce611dffbdb0bb74de9d011bbf1400
Fixes:28697797
diff --git a/src/com/android/phone/Assert.java b/src/com/android/phone/Assert.java
new file mode 100644
index 0000000..d4233b2
--- /dev/null
+++ b/src/com/android/phone/Assert.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+
+package com.android.phone;
+
+import android.os.Looper;
+
+/**
+ * Assertions which will result in program termination.
+ */
+public class Assert {
+
+ public static void isTrue(boolean condition) {
+ if (!condition) {
+ throw new AssertionError("Expected condition to be true");
+ }
+ }
+
+ public static void isNotMainThread() {
+ isTrue(!Looper.getMainLooper().equals(Looper.myLooper()));
+ }
+
+ public static void fail() {
+ throw new AssertionError("Fail");
+ }
+}