merge b2g-inbound to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2013-08-14 14:11:03 +02:00
commit c32ebba83a
30 changed files with 401 additions and 548 deletions

View File

@ -22,7 +22,6 @@ category JavaScript-navigator-property mozKeyboard @mozilla.org/b2g-keyboard;1
component {4607330d-e7d2-40a4-9eb8-43967eae0142} MozKeyboard.js
contract @mozilla.org/b2g-inputmethod;1 {4607330d-e7d2-40a4-9eb8-43967eae0142}
category JavaScript-navigator-property mozInputMethod @mozilla.org/b2g-inputmethod;1
# DirectoryProvider.js
component {9181eb7c-6f87-11e1-90b1-4f59d80dd2e5} DirectoryProvider.js

View File

@ -4,6 +4,7 @@
"use strict";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
@ -297,7 +298,6 @@ MozInputMethod.prototype = {
cpmm.removeMessageListener('Keyboard:GetContext:Result:OK', this);
this._window = null;
this._inputcontextHandler = null;
this._mgmt = null;
},
@ -307,6 +307,7 @@ MozInputMethod.prototype = {
switch(msg.name) {
case 'Keyboard:FocusChange':
if (json.type !== 'blur') {
// XXX Bug 904339 could receive 'text' event twice
this.setInputContext(json);
}
else {
@ -336,12 +337,12 @@ MozInputMethod.prototype = {
return this._inputcontext;
},
set oninputcontextchange(val) {
this._inputcontextHandler = val;
set oninputcontextchange(handler) {
this.__DOM_IMPL__.setEventHandler("oninputcontextchange", handler);
},
get oninputcontextchange() {
return this._inputcontextHandler;
return this.__DOM_IMPL__.getEventHandler("oninputcontextchange");
},
setInputContext: function mozKeyboardContextChange(data) {
@ -355,13 +356,9 @@ MozInputMethod.prototype = {
this._inputcontext.init(this._window);
}
let handler = this._inputcontextHandler;
if (!handler || !(handler instanceof Ci.nsIDOMEventListener))
return;
let evt = new this._window.CustomEvent("inputcontextchange",
ObjectWrapper.wrap({}, this._window));
handler.handleEvent(evt);
let event = new this._window.Event("inputcontextchange",
ObjectWrapper.wrap({}, this._window));
this.__DOM_IMPL__.dispatchEvent(event);
}
};
@ -412,7 +409,6 @@ MozInputContext.prototype = {
this._window = win;
this._utils = win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
this.initDOMRequestHelper(win,
["Keyboard:GetText:Result:OK",
"Keyboard:GetText:Result:Error",
@ -427,21 +423,20 @@ MozInputContext.prototype = {
// All requests that are still pending need to be invalidated
// because the context is no longer valid.
Object.keys(self._requests).forEach(function(k) {
// takeRequest also does a delete from context
let req = self.takeRequest(k);
Services.DOMRequest.fireError(req, "InputContext got destroyed");
this.forEachPromiseResolver(function(k) {
self.takePromiseResolver(k).reject("InputContext got destroyed");
});
this.destroyDOMRequestHelper();
// A consuming application might still hold a cached version of this
// object. After destroying the DOMRequestHelper all methods will throw
// because we cannot create new requests anymore, but we still hold
// A consuming application might still hold a cached version of
// this object. After destroying all methods will throw because we
// cannot create new promises anymore, but we still hold
// (outdated) information in the context. So let's clear that out.
for (var k in this._context)
if (this._context.hasOwnProperty(k))
for (var k in this._context) {
if (this._context.hasOwnProperty(k)) {
this._context[k] = null;
}
}
},
receiveMessage: function ic_receiveMessage(msg) {
@ -451,35 +446,35 @@ MozInputContext.prototype = {
}
let json = msg.json;
let request = json.requestId ? this.takeRequest(json.requestId) : null;
let resolver = this.takePromiseResolver(json.requestId);
if (!request) {
if (!resolver) {
return;
}
switch (msg.name) {
case "Keyboard:SendKey:Result:OK":
Services.DOMRequest.fireSuccess(request, null);
resolver.resolve();
break;
case "Keyboard:GetText:Result:OK":
Services.DOMRequest.fireSuccess(request, json.text);
resolver.resolve(json.text);
break;
case "Keyboard:GetText:Result:Error":
Services.DOMRequest.fireError(request, json.error);
resolver.reject(json.error);
break;
case "Keyboard:SetSelectionRange:Result:OK":
case "Keyboard:ReplaceSurroundingText:Result:OK":
Services.DOMRequest.fireSuccess(request,
resolver.resolve(
ObjectWrapper.wrap(json.selectioninfo, this._window));
break;
case "Keyboard:SequenceError":
// Occurs when a new element got focus, but the inputContext was
// not invalidated yet...
Services.DOMRequest.fireError(request, "InputContext has expired");
resolver.reject("InputContext has expired");
break;
default:
Services.DOMRequest.fireError(request, "Could not find a handler for " +
msg.name);
dump("Could not find a handler for " + msg.name);
resolver.reject();
break;
}
},
@ -500,31 +495,28 @@ MozInputContext.prototype = {
this._context.textAfterCursor = ctx.textAfterCursor;
if (selectionDirty) {
this._fireEvent(this._onselectionchange, "selectionchange", {
this._fireEvent("selectionchange", {
selectionStart: ctx.selectionStart,
selectionEnd: ctx.selectionEnd
});
}
if (surroundDirty) {
this._fireEvent(this._onsurroundingtextchange, "surroundingtextchange", {
this._fireEvent("surroundingtextchange", {
beforeString: ctx.textBeforeCursor,
afterString: ctx.textAfterCursor
});
}
},
_fireEvent: function ic_fireEvent(handler, eventName, aDetail) {
if (!handler || !(handler instanceof Ci.nsIDOMEventListener))
return;
_fireEvent: function ic_fireEvent(eventName, aDetail) {
let detail = {
detail: aDetail
};
let evt = new this._window.CustomEvent(eventName,
ObjectWrapper.wrap(aDetail, this._window));
handler.handleEvent(evt);
let event = new this._window.Event(eventName,
ObjectWrapper.wrap(aDetail, this._window));
this.__DOM_IMPL__.dispatchEvent(event);
},
// tag name of the input field
@ -546,16 +538,16 @@ MozInputContext.prototype = {
},
getText: function ic_getText(offset, length) {
let request = this.createRequest();
cpmm.sendAsyncMessage('Keyboard:GetText', {
contextId: this._contextId,
requestId: this.getRequestId(request),
offset: offset,
length: length
let self = this;
return this.createPromise(function(resolver) {
let resolverId = self.getPromiseResolverId(resolver);
cpmm.sendAsyncMessage('Keyboard:GetText', {
contextId: self._contextId,
requestId: resolverId,
offset: offset,
length: length
});
});
return request;
},
get selectionStart() {
@ -575,46 +567,46 @@ MozInputContext.prototype = {
},
setSelectionRange: function ic_setSelectionRange(start, length) {
let request = this.createRequest();
cpmm.sendAsyncMessage("Keyboard:SetSelectionRange", {
contextId: this._contextId,
requestId: this.getRequestId(request),
selectionStart: start,
selectionEnd: start + length
let self = this;
return this.createPromise(function(resolver) {
let resolverId = self.getPromiseResolverId(resolver);
cpmm.sendAsyncMessage("Keyboard:SetSelectionRange", {
contextId: self._contextId,
requestId: resolverId,
selectionStart: start,
selectionEnd: start + length
});
});
return request;
},
get onsurroundingtextchange() {
return this._onsurroundingtextchange;
return this.__DOM_IMPL__.getEventHandler("onsurroundingtextchange");
},
set onsurroundingtextchange(handler) {
this._onsurroundingtextchange = handler;
this.__DOM_IMPL__.setEventHandler("onsurroundingtextchange");
},
get onselectionchange() {
return this._onselectionchange;
return this.__DOM_IMPL__.getEventHandler("onselectionchange");
},
set onselectionchange(handler) {
this._onselectionchange = handler;
this.__DOM_IMPL__.setEventHandler("onselectionchange");
},
replaceSurroundingText: function ic_replaceSurrText(text, offset, length) {
let request = this.createRequest();
cpmm.sendAsyncMessage('Keyboard:ReplaceSurroundingText', {
contextId: this._contextId,
requestId: this.getRequestId(request),
text: text,
beforeLength: offset || 0,
afterLength: length || 0
let self = this;
return this.createPromise(function(resolver) {
let resolverId = self.getPromiseResolverId(resolver);
cpmm.sendAsyncMessage('Keyboard:ReplaceSurroundingText', {
contextId: self._contextId,
requestId: resolverId,
text: text,
beforeLength: offset || 0,
afterLength: length || 0
});
});
return request;
},
deleteSurroundingText: function ic_deleteSurrText(offset, length) {
@ -622,27 +614,27 @@ MozInputContext.prototype = {
},
sendKey: function ic_sendKey(keyCode, charCode, modifiers) {
let request = this.createRequest();
cpmm.sendAsyncMessage('Keyboard:SendKey', {
contextId: this._contextId,
requestId: this.getRequestId(request),
keyCode: keyCode,
charCode: charCode,
modifiers: modifiers
let self = this;
return this.createPromise(function(resolver) {
let resolverId = self.getPromiseResolverId(resolver);
cpmm.sendAsyncMessage('Keyboard:SendKey', {
contextId: self._contextId,
requestId: resolverId,
keyCode: keyCode,
charCode: charCode,
modifiers: modifiers
});
});
return request;
},
setComposition: function ic_setComposition(text, cursor) {
throw "Not implemented";
throw new this._window.DOMError("NotSupportedError", "Not implemented");
},
endComposition: function ic_endComposition(text) {
throw "Not implemented";
throw new this._window.DOMError("NotSupportedError", "Not implemented");
}
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory(
[MozKeyboard, MozInputMethodManager, MozInputMethod]);
[MozKeyboard, MozInputMethod]);

View File

@ -13,119 +13,6 @@ interface nsIB2GCameraContent : nsISupports
DOMString getCameraURI([optional] in jsval options);
};
[scriptable, uuid(1e38633d-d08b-4867-9944-afa5c648adb6)]
interface nsIB2GInputContext : nsISupports
{
// The tag name of input field, which is enum of "input", "textarea", or "contenteditable"
readonly attribute DOMString type;
// The type of the input field, which is enum of text, number, password, url, search, email, and so on.
// See http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#states-of-the-type-attribute
readonly attribute DOMString inputType;
/*
* The inputmode string, representing the input mode.
* See http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#input-modalities:-the-inputmode-attribute
*/
readonly attribute DOMString inputMode;
/*
* The primary language for the input field.
* It is the value of HTMLElement.lang.
* See http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlelement
*/
readonly attribute DOMString lang;
/*
* Get the whole text content of the input field.
*/
nsIDOMDOMRequest getText([optional] in long offset, [optional] in long length);
// The start and stop position of the selection.
readonly attribute long selectionStart;
readonly attribute long selectionEnd;
// The start and stop position of the selection.
readonly attribute DOMString textBeforeCursor;
readonly attribute DOMString textAfterCursor;
/*
* Set the selection range of the the editable text.
* Note: This method cannot be used to move the cursor during composition. Calling this
* method will cancel composition.
* @param start The beginning of the selected text.
* @param length The length of the selected text.
*
* Note that the start position should be less or equal to the end position.
* To move the cursor, set the start and end position to the same value.
*/
nsIDOMDOMRequest setSelectionRange(in long start, in long length);
/*
* Commit text to current input field and replace text around cursor position. It will clear the current composition.
*
* @param text The string to be replaced with.
* @param offset The offset from the cursor position where replacing starts. Defaults to 0.
* @param length The length of text to replace. Defaults to 0.
*/
nsIDOMDOMRequest replaceSurroundingText(in DOMString text, [optional] in long offset, [optional] in long length);
/*
*
* Delete text around the cursor.
* @param offset The offset from the cursor position where deletion starts.
* @param length The length of text to delete.
* TODO: maybe updateSurroundingText(DOMString beforeText, DOMString afterText); ?
*/
nsIDOMDOMRequest deleteSurroundingText(in long offset, in long length);
/*
* Notifies when the text around the cursor is changed, due to either text
* editing or cursor movement. If the cursor has been moved, but the text around has not
* changed, the IME won't get notification.
*
* The event handler function is specified as:
* @param beforeString Text before and including cursor position.
* @param afterString Text after and excluing cursor position.
* function(DOMString beforeText, DOMString afterText) {
* ...
* }
*/
attribute nsIDOMEventListener onsurroundingtextchange;
attribute nsIDOMEventListener onselectionchange;
/*
* send a character with its key events.
* @param modifiers see http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMWindowUtils.idl#206
* @return true if succeeds. Otherwise false if the input context becomes void.
* Alternative: sendKey(KeyboardEvent event), but we will likely waste memory for creating the KeyboardEvent object.
*/
nsIDOMDOMRequest sendKey(in long keyCode, in long charCode, in long modifiers);
/*
* Set current composition. It will start or update composition.
* @param cursor Position in the text of the cursor.
*
* The API implementation should automatically ends the composition
* session (with event and confirm the current composition) if
* endComposition is never called. Same apply when the inputContext is lost
* during a unfinished composition session.
*/
nsIDOMDOMRequest setComposition(in DOMString text, in long cursor);
/*
* End composition and actually commit the text. (was |commitText(text, offset, length)|)
* Ending the composition with an empty string will not send any text.
* Note that if composition always ends automatically (with the current composition committed) if the composition
* did not explicitly with |endComposition()| but was interrupted with |sendKey()|, |setSelectionRange()|,
* user moving the cursor, or remove the focus, etc.
*
* @param text The text
*/
nsIDOMDOMRequest endComposition(in DOMString text);
};
[scriptable, uuid(40ad96b2-9efa-41fb-84c7-fbcec9b153f0)]
interface nsIB2GKeyboard : nsISupports
{
@ -191,46 +78,3 @@ interface nsIB2GKeyboard : nsISupports
[optional] in long beforeLength,
[optional] in long afterLength);
};
// Manages the list of IMEs, enables/disables IME and switches to an IME.
[scriptable, uuid(e51a6fa0-ef85-11e2-b778-0800200c9a66)]
interface nsIInputMethodManager : nsISupports
{
// Ask the OS to show a list of available IMEs for users to switch from.
// OS should ignore this request if the app is currently not the active one.
void showAll();
// Ask the OS to switch away from the current active Keyboard app.
// OS should ignore this request if the app is currently not the active one.
void next();
// To know if the OS supports IME switching or not.
// Use case: let the keyboard app knows if it is necessary to show the "IME switching"
// (globe) button. We have a use case that when there is only one IME enabled, we
// should not show the globe icon.
boolean supportsSwitching();
// Ask the OS to hide the current active Keyboard app. (was: |removeFocus()|)
// OS should ignore this request if the app is currently not the active one.
// The OS will void the current input context (if it exists).
// This method belong to |mgmt| because we would like to allow Keyboard to access to
// this method w/o a input context.
void hide();
};
[scriptable, uuid(4607330d-e7d2-40a4-9eb8-43967eae0142)]
interface nsIInputMethod : nsISupports
{
// Input Method Manager contain a few global methods expose to apps
readonly attribute nsIInputMethodManager mgmt;
// Fired when the input context changes, include changes from and to null.
// The new InputContext instance will be available in the event object under |inputcontext| property.
// When it changes to null it means the app (the user of this API) no longer has the control of the original focused input field.
// Note that if the app saves the original context, it might get void; implementation decides when to void the input context.
readonly attribute nsIB2GInputContext inputcontext;
// An "input context" is mapped to a text field that the app is allow to mutate.
// this attribute should be null when there is no text field currently focused.
attribute nsIDOMEventListener oninputcontextchange;
};

View File

@ -1,4 +1,4 @@
{
"revision": "2b195ef19ed8cadd557ca185bae72c9ff836b264",
"revision": "47daabb93939a38f1f8efa7fdb1cd22ef8445600",
"repo_path": "/integration/gaia-central"
}

View File

@ -1,7 +1,7 @@
[
{
"size": 214609120,
"digest": "cbda63d37b8db104a0fddcb5d8ffe1da173922805863905cb82e819c80cf6032caffa49903cb74e8c703da35df876cc305a7d7b989a52c045e99845e20718f7e",
"size": 86149048,
"digest": "4ff723d8a372e2af95e62efb8739517943f362b515b4cee78006137a8dbc97f3b42edbd2e17429eaa7fa16b7f24594ed058b7032bcb7aa2ecfe9788a212dda4d",
"algorithm": "sha512",
"filename": "helix-ics.tar.xz"
},

View File

@ -209,5 +209,21 @@ DOMRequestIpcHelper.prototype = {
*/
createPromise: function(aPromiseInit) {
return new this._window.Promise(aPromiseInit);
}
},
forEachRequest: function(aCallback) {
Object.keys(this._requests).forEach(function(k) {
if (this.getRequest(k) instanceof this._window.DOMRequest) {
aCallback(k);
}
}, this);
},
forEachPromiseResolver: function(aCallback) {
Object.keys(this._requests).forEach(function(k) {
if (this.getPromiseResolver(k) instanceof this._window.PromiseResolver) {
aCallback(k);
}
}, this);
},
}

View File

@ -125,10 +125,7 @@ BluetoothA2dpManager::Get()
}
// If we're in shutdown, don't create a new instance
if (sInShutdown) {
NS_WARNING("BluetoothA2dpManager can't be created during shutdown");
return nullptr;
}
NS_ENSURE_FALSE(sInShutdown, nullptr);
// Create a new instance, register, and return
BluetoothA2dpManager* manager = new BluetoothA2dpManager();
@ -153,15 +150,8 @@ BluetoothA2dpManager::Connect(const nsAString& aDeviceAddress)
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!aDeviceAddress.IsEmpty());
if (sInShutdown) {
NS_WARNING("Connect called while in shutdown!");
return false;
}
if (mA2dpConnected) {
NS_WARNING("BluetoothA2dpManager is connected");
return false;
}
NS_ENSURE_FALSE(sInShutdown, false);
NS_ENSURE_FALSE(mA2dpConnected, false);
mDeviceAddress = aDeviceAddress;
@ -176,10 +166,7 @@ BluetoothA2dpManager::Connect(const nsAString& aDeviceAddress)
void
BluetoothA2dpManager::Disconnect()
{
if (!mA2dpConnected) {
NS_WARNING("BluetoothA2dpManager has been disconnected");
return;
}
NS_ENSURE_TRUE_VOID(mA2dpConnected);
MOZ_ASSERT(!mDeviceAddress.IsEmpty());
@ -203,22 +190,28 @@ BluetoothA2dpManager::HandleSinkPropertyChanged(const BluetoothSignal& aSignal)
if (name.EqualsLiteral("Connected")) {
// Indicates if a stream is setup to a A2DP sink on the remote device.
MOZ_ASSERT(value.type() == BluetoothValue::Tbool);
MOZ_ASSERT(mA2dpConnected != value.get_bool());
mA2dpConnected = value.get_bool();
NotifyConnectionStatusChanged();
DispatchConnectionStatusChanged();
} else if (name.EqualsLiteral("Playing")) {
// Indicates if a stream is active to a A2DP sink on the remote device.
MOZ_ASSERT(value.type() == BluetoothValue::Tbool);
MOZ_ASSERT(mPlaying != value.get_bool());
mPlaying = value.get_bool();
} else if (name.EqualsLiteral("State")) {
MOZ_ASSERT(value.type() == BluetoothValue::TnsString);
MOZ_ASSERT(mSinkState != StatusStringToSinkState(value.get_nsString()));
HandleSinkStateChanged(StatusStringToSinkState(value.get_nsString()));
} else {
NS_WARNING("Unknown sink property");
}
}
/* HandleSinkPropertyChanged update sink state in A2dp
/* HandleSinkStateChanged updates sink state in A2dp
*
* Possible values: "disconnected", "connecting", "connected", "playing"
*

View File

@ -12,8 +12,6 @@
BEGIN_BLUETOOTH_NAMESPACE
class BluetoothA2dpManagerObserver;
class BluetoothA2dpManager : public BluetoothProfileManagerBase
{
public:

View File

@ -655,34 +655,6 @@ BluetoothAdapter::SetPairingConfirmation(const nsAString& aDeviceAddress,
return request.forget();
}
already_AddRefed<DOMRequest>
BluetoothAdapter::SetAuthorization(const nsAString& aDeviceAddress, bool aAllow,
ErrorResult& aRv)
{
nsCOMPtr<nsPIDOMWindow> win = GetOwner();
if (!win) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<DOMRequest> request = new DOMRequest(win);
nsRefPtr<BluetoothVoidReplyRunnable> results =
new BluetoothVoidReplyRunnable(request);
BluetoothService* bs = BluetoothService::Get();
if (!bs) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
if (!bs->SetAuthorizationInternal(aDeviceAddress, aAllow, results)) {
NS_WARNING("SetAuthorization failed!");
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
return request.forget();
}
already_AddRefed<DOMRequest>
BluetoothAdapter::Connect(const nsAString& aDeviceAddress,
uint16_t aProfileId, ErrorResult& aRv)

View File

@ -440,10 +440,7 @@ BluetoothHfpManager::Get()
}
// If we're in shutdown, don't create a new instance
if (sInShutdown) {
NS_WARNING("BluetoothHfpManager can't be created during shutdown");
return nullptr;
}
NS_ENSURE_FALSE(sInShutdown, nullptr);
// Create a new instance, register, and return
BluetoothHfpManager* manager = new BluetoothHfpManager();

View File

@ -216,10 +216,7 @@ BluetoothOppManager::Get()
}
// If we're in shutdown, don't create a new instance
if (sInShutdown) {
NS_WARNING("BluetoothOppManager can't be created during shutdown");
return nullptr;
}
NS_ENSURE_FALSE(sInShutdown, nullptr);
// Create a new instance, register, and return
BluetoothOppManager *manager = new BluetoothOppManager();
@ -515,10 +512,7 @@ BluetoothOppManager::CreateFile()
path.Append(mFileName);
mDsFile = DeviceStorageFile::CreateUnique(path, nsIFile::NORMAL_FILE_TYPE, 0644);
if (!mDsFile) {
NS_WARNING("Couldn't create the file");
return false;
}
NS_ENSURE_TRUE(mDsFile, false);
nsCOMPtr<nsIFile> f;
mDsFile->mFile->Clone(getter_AddRefs(f));

View File

@ -790,10 +790,6 @@ BluetoothService::Notify(const BluetoothSignal& aData)
} else if (aData.name().EqualsLiteral("RequestPasskey")) {
MOZ_ASSERT(aData.value().get_ArrayOfBluetoothNamedValue().Length() == 3,
"RequestPinCode: Wrong length of parameters");
} else if (aData.name().EqualsLiteral("Authorize")) {
MOZ_ASSERT(aData.value().get_ArrayOfBluetoothNamedValue().Length() == 2,
"Authorize: Wrong length of parameters");
type.AssignLiteral("bluetooth-authorize");
} else if (aData.name().EqualsLiteral("Cancel")) {
MOZ_ASSERT(aData.value().get_ArrayOfBluetoothNamedValue().Length() == 0,
"Cancel: Wrong length of parameters");

View File

@ -232,10 +232,6 @@ public:
SetPairingConfirmationInternal(const nsAString& aDeviceAddress, bool aConfirm,
BluetoothReplyRunnable* aRunnable) = 0;
virtual bool
SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow,
BluetoothReplyRunnable* aRunnable) = 0;
virtual void
Connect(const nsAString& aDeviceAddress,
uint16_t aProfileId,

View File

@ -18,3 +18,34 @@ BluetoothUuidHelper::GetString(BluetoothServiceClass aServiceClassUuid,
aRetUuidStr.AppendInt(aServiceClassUuid, 16);
aRetUuidStr.AppendLiteral("-0000-1000-8000-00805F9B34FB");
}
BluetoothServiceClass
BluetoothUuidHelper::GetBluetoothServiceClass(const nsAString& aUuidStr)
{
// An example of input UUID string: 0000110D-0000-1000-8000-00805F9B34FB
MOZ_ASSERT(aUuidStr.Length() == 36);
/**
* Extract uuid16 from input UUID string and return a value of enum
* BluetoothServiceClass. If we failed to recognize the value,
* BluetoothServiceClass::UNKNOWN is returned.
*/
BluetoothServiceClass retValue = BluetoothServiceClass::UNKNOWN;
nsString uuid(Substring(aUuidStr, 4, 4));
nsresult rv;
int32_t integer = uuid.ToInteger(&rv, 16);
NS_ENSURE_SUCCESS(rv, retValue);
switch (integer) {
case BluetoothServiceClass::A2DP:
case BluetoothServiceClass::HANDSFREE:
case BluetoothServiceClass::HANDSFREE_AG:
case BluetoothServiceClass::HEADSET:
case BluetoothServiceClass::HEADSET_AG:
case BluetoothServiceClass::HID:
case BluetoothServiceClass::OBJECT_PUSH:
retValue = (BluetoothServiceClass)integer;
}
return retValue;
}

View File

@ -22,12 +22,14 @@ BEGIN_BLUETOOTH_NAMESPACE
*/
enum BluetoothServiceClass
{
HEADSET = 0x1108,
HEADSET_AG = 0x1112,
A2DP = 0x110D,
HANDSFREE = 0x111E,
HANDSFREE_AG = 0x111F,
OBJECT_PUSH = 0x1105,
HEADSET = 0x1108,
HEADSET_AG = 0x1112,
HID = 0x1124,
OBJECT_PUSH = 0x1105,
UNKNOWN = 0x0000
};
class BluetoothUuidHelper
@ -42,6 +44,15 @@ public:
*/
static void
GetString(BluetoothServiceClass aServiceClassUuid, nsAString& aRetUuidStr);
/**
* Convert a 128-bit uuid string to a value of BluetoothServiceClass
*
* @param aUuidStr 128-bit uuid string
* @return a value of BluetoothServiceClass
*/
static BluetoothServiceClass
GetBluetoothServiceClass(const nsAString& aUuidStr);
};
// TODO/qdot: Move these back into gonk and make the service handler deal with

View File

@ -206,12 +206,8 @@ BluetoothParent::RecvPBluetoothRequestConstructor(
return actor->DoRequest(aRequest.get_SetPasskeyRequest());
case Request::TConfirmPairingConfirmationRequest:
return actor->DoRequest(aRequest.get_ConfirmPairingConfirmationRequest());
case Request::TConfirmAuthorizationRequest:
return actor->DoRequest(aRequest.get_ConfirmAuthorizationRequest());
case Request::TDenyPairingConfirmationRequest:
return actor->DoRequest(aRequest.get_DenyPairingConfirmationRequest());
case Request::TDenyAuthorizationRequest:
return actor->DoRequest(aRequest.get_DenyAuthorizationRequest());
case Request::TConnectRequest:
return actor->DoRequest(aRequest.get_ConnectRequest());
case Request::TDisconnectRequest:
@ -454,22 +450,6 @@ BluetoothRequestParent::DoRequest(const ConfirmPairingConfirmationRequest&
return true;
}
bool
BluetoothRequestParent::DoRequest(const ConfirmAuthorizationRequest& aRequest)
{
MOZ_ASSERT(mService);
MOZ_ASSERT(mRequestType == Request::TConfirmAuthorizationRequest);
bool result =
mService->SetAuthorizationInternal(aRequest.path(),
true,
mReplyRunnable.get());
NS_ENSURE_TRUE(result, false);
return true;
}
bool
BluetoothRequestParent::DoRequest(const DenyPairingConfirmationRequest&
aRequest)
@ -487,22 +467,6 @@ BluetoothRequestParent::DoRequest(const DenyPairingConfirmationRequest&
return true;
}
bool
BluetoothRequestParent::DoRequest(const DenyAuthorizationRequest& aRequest)
{
MOZ_ASSERT(mService);
MOZ_ASSERT(mRequestType == Request::TDenyAuthorizationRequest);
bool result =
mService->SetAuthorizationInternal(aRequest.path(),
false,
mReplyRunnable.get());
NS_ENSURE_TRUE(result, false);
return true;
}
bool
BluetoothRequestParent::DoRequest(const ConnectRequest& aRequest)
{

View File

@ -162,12 +162,6 @@ protected:
bool
DoRequest(const DenyPairingConfirmationRequest& aRequest);
bool
DoRequest(const ConfirmAuthorizationRequest& aRequest);
bool
DoRequest(const DenyAuthorizationRequest& aRequest);
bool
DoRequest(const ConnectRequest& aRequest);

View File

@ -250,22 +250,6 @@ BluetoothServiceChildProcess::SetPairingConfirmationInternal(
return true;
}
bool
BluetoothServiceChildProcess::SetAuthorizationInternal(
const nsAString& aDeviceAddress,
bool aAllow,
BluetoothReplyRunnable* aRunnable)
{
if(aAllow) {
SendRequest(aRunnable,
ConfirmAuthorizationRequest(nsString(aDeviceAddress)));
} else {
SendRequest(aRunnable,
DenyAuthorizationRequest(nsString(aDeviceAddress)));
}
return true;
}
void
BluetoothServiceChildProcess::Connect(
const nsAString& aDeviceAddress,

View File

@ -111,11 +111,6 @@ public:
BluetoothReplyRunnable* aRunnable)
MOZ_OVERRIDE;
virtual bool
SetAuthorizationInternal(const nsAString& aDeviceAddress,
bool aAllow,
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual void
Connect(const nsAString& aDeviceAddress,
const uint16_t aProfileId,

View File

@ -78,16 +78,6 @@ struct DenyPairingConfirmationRequest
nsString path;
};
struct ConfirmAuthorizationRequest
{
nsString path;
};
struct DenyAuthorizationRequest
{
nsString path;
};
struct PairedDevicePropertiesRequest
{
nsString[] addresses;
@ -171,8 +161,6 @@ union Request
SetPasskeyRequest;
ConfirmPairingConfirmationRequest;
DenyPairingConfirmationRequest;
ConfirmAuthorizationRequest;
DenyAuthorizationRequest;
ConnectedDevicePropertiesRequest;
PairedDevicePropertiesRequest;
ConnectRequest;

View File

@ -34,6 +34,7 @@
#include "nsThreadUtils.h"
#include "nsDebug.h"
#include "nsDataHashtable.h"
#include "nsPrintfCString.h"
#include "mozilla/Atomics.h"
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
#include "mozilla/Hal.h"
@ -173,7 +174,7 @@ static const char* sBluetoothDBusSignals[] =
*/
static nsRefPtr<RawDBusConnection> gThreadConnection;
static nsDataHashtable<nsStringHashKey, DBusMessage* > sPairingReqTable;
static nsDataHashtable<nsStringHashKey, DBusMessage* > sAuthorizeReqTable;
static nsTArray<uint32_t> sAuthorizedServiceClass;
static nsString sAdapterPath;
static Atomic<int32_t> sIsPairing(0);
static int sConnectedDeviceCount = 0;
@ -618,15 +619,9 @@ GetProperty(DBusMessageIter aIter, Properties* aPropertyTypes,
}
if ((receivedType != expectedType) && !convert) {
NS_WARNING("Iterator not type we expect!");
nsCString str;
str.AppendLiteral("Property Name: ");
str.Append(NS_ConvertUTF16toUTF8(propertyName));
str.AppendLiteral(", Property Type Expected: ");
str.AppendInt(expectedType);
str.AppendLiteral(", Property Type Received: ");
str.AppendInt(receivedType);
NS_WARNING(str.get());
NS_WARNING(nsPrintfCString("Iterator not type we expect! Property name: %s,
Property Type Expected: %d, Property Type Received: %d",
NS_ConvertUTF16toUTF8(propertyName).get(), expectedType, receivedType).get());
return false;
}
@ -771,38 +766,6 @@ UnpackManagerPropertiesMessage(DBusMessage* aMsg, DBusError* aErr,
ArrayLength(sManagerProperties));
}
static void
GetManagerPropertiesCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable)
{
RunDBusCallback(aMsg, aBluetoothReplyRunnable,
UnpackManagerPropertiesMessage);
}
static void
GetAdapterPropertiesCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable)
{
RunDBusCallback(aMsg, aBluetoothReplyRunnable,
UnpackAdapterPropertiesMessage);
}
static void
GetDevicePropertiesCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable)
{
RunDBusCallback(aMsg, aBluetoothReplyRunnable,
UnpackDevicePropertiesMessage);
}
static DBusCallback sBluetoothDBusPropCallbacks[] =
{
GetManagerPropertiesCallback,
GetAdapterPropertiesCallback,
GetDevicePropertiesCallback
};
static_assert(
sizeof(sBluetoothDBusPropCallbacks) == sizeof(sBluetoothDBusIfaces),
"DBus Property callback array and DBus interface array must be same size");
static void
ParsePropertyChange(DBusMessage* aMsg, BluetoothValue& aValue,
nsAString& aErrorStr, Properties* aPropertyTypes,
@ -1016,30 +979,43 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
DBUS_TYPE_OBJECT_PATH, &objectPath,
DBUS_TYPE_STRING, &uuid,
DBUS_TYPE_INVALID)) {
BT_WARNING("%s: Invalid arguments for Authorize() method", __FUNCTION__);
errorStr.AssignLiteral("Invalid arguments for Authorize() method");
goto handle_error;
}
nsString deviceAddress =
GetAddressFromObjectPath(NS_ConvertUTF8toUTF16(objectPath));
NS_ConvertUTF8toUTF16 uuidStr(uuid);
BluetoothServiceClass serviceClass =
BluetoothUuidHelper::GetBluetoothServiceClass(uuidStr);
if (serviceClass == BluetoothServiceClass::UNKNOWN) {
errorStr.AssignLiteral("Failed to get service class");
goto handle_error;
}
parameters.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("deviceAddress"), deviceAddress));
parameters.AppendElement(
BluetoothNamedValue(NS_LITERAL_STRING("uuid"),
NS_ConvertUTF8toUTF16(uuid)));
DBusMessage* reply;
int i;
int length = sAuthorizedServiceClass.Length();
for (i = 0; i < length; i++) {
if (serviceClass == sAuthorizedServiceClass[i]) {
reply = dbus_message_new_method_return(msg);
break;
}
}
// Because we may have authorization request and pairing request from the
// same remote device at the same time, we need two tables to keep these
// messages.
sAuthorizeReqTable.Put(deviceAddress, msg);
// The uuid isn't authorized
if (i == length) {
BT_WARNING("Uuid is not authorized.");
reply = dbus_message_new_error(msg, "org.bluez.Error.Rejected",
"The uuid is not authorized");
}
// Increase ref count here because we need this message later.
// It'll be unrefed when setAuthorizationInternal() is called.
dbus_message_ref(msg);
if (!reply) {
errorStr.AssignLiteral("Memory can't be allocated for the message.");
goto handle_error;
}
v = parameters;
dbus_connection_send(conn, reply, NULL);
dbus_message_unref(reply);
return DBUS_HANDLER_RESULT_HANDLED;
} else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE,
"RequestConfirmation")) {
// This method gets called when the service daemon needs to confirm a
@ -1049,7 +1025,6 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
DBUS_TYPE_OBJECT_PATH, &objectPath,
DBUS_TYPE_UINT32, &passkey,
DBUS_TYPE_INVALID)) {
BT_WARNING("%s: Invalid arguments: RequestConfirmation()", __FUNCTION__);
errorStr.AssignLiteral("Invalid arguments: RequestConfirmation()");
goto handle_error;
}
@ -1073,8 +1048,6 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_OBJECT_PATH, &objectPath,
DBUS_TYPE_INVALID)) {
BT_WARNING("%s: Invalid arguments for RequestPinCode() method",
__FUNCTION__);
errorStr.AssignLiteral("Invalid arguments for RequestPinCode() method");
goto handle_error;
}
@ -1096,8 +1069,6 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_OBJECT_PATH, &objectPath,
DBUS_TYPE_INVALID)) {
BT_WARNING("%s: Invalid arguments for RequestPasskey() method",
__FUNCTION__);
errorStr.AssignLiteral("Invalid arguments for RequestPasskey() method");
goto handle_error;
}
@ -1136,7 +1107,7 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
}
if (!errorStr.IsEmpty()) {
NS_WARNING(NS_ConvertUTF16toUTF8(errorStr).get());
BT_WARNING(NS_ConvertUTF16toUTF8(errorStr).get());
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
@ -1160,7 +1131,7 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data)
return DBUS_HANDLER_RESULT_HANDLED;
handle_error:
NS_WARNING(NS_ConvertUTF16toUTF8(errorStr).get());
BT_WARNING(NS_ConvertUTF16toUTF8(errorStr).get());
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
@ -1334,6 +1305,8 @@ public:
}
sAdapterPath = mAdapterPath;
sAuthorizedServiceClass.AppendElement(BluetoothServiceClass::A2DP);
sAuthorizedServiceClass.AppendElement(BluetoothServiceClass::HID);
nsRefPtr<DBusReplyHandler> handler =
new AddReservedServiceRecordsReplyHandler();
@ -1731,10 +1704,6 @@ BluetoothDBusService::StartInternal()
sPairingReqTable.Init();
}
if (!sAuthorizeReqTable.IsInitialized()) {
sAuthorizeReqTable.Init();
}
BluetoothValue v;
nsAutoString replyError;
if (!GetDefaultAdapterPath(v, replyError)) {
@ -1809,12 +1778,11 @@ BluetoothDBusService::StopInternal()
sPairingReqTable.EnumerateRead(UnrefDBusMessages, nullptr);
sPairingReqTable.Clear();
sAuthorizeReqTable.EnumerateRead(UnrefDBusMessages, nullptr);
sAuthorizeReqTable.Clear();
sIsPairing = 0;
sConnectedDeviceCount = 0;
sAuthorizedServiceClass.Clear();
StopDBus();
return NS_OK;
}
@ -2521,52 +2489,6 @@ BluetoothDBusService::SetPairingConfirmationInternal(
return result;
}
bool
BluetoothDBusService::SetAuthorizationInternal(
const nsAString& aDeviceAddress,
bool aAllow,
BluetoothReplyRunnable* aRunnable)
{
nsAutoString errorStr;
BluetoothValue v = true;
DBusMessage *msg;
if (!sAuthorizeReqTable.Get(aDeviceAddress, &msg)) {
BT_WARNING("%s: Couldn't get original request message.", __FUNCTION__);
errorStr.AssignLiteral("Couldn't get original request message.");
DispatchBluetoothReply(aRunnable, v, errorStr);
return false;
}
DBusMessage *reply;
if (aAllow) {
reply = dbus_message_new_method_return(msg);
} else {
reply = dbus_message_new_error(msg, "org.bluez.Error.Rejected",
"User rejected authorization");
}
if (!reply) {
BT_WARNING("%s: Memory can't be allocated for the message.", __FUNCTION__);
dbus_message_unref(msg);
errorStr.AssignLiteral("Memory can't be allocated for the message.");
DispatchBluetoothReply(aRunnable, v, errorStr);
return false;
}
bool result = dbus_func_send(mConnection, nullptr, reply);
if (!result) {
errorStr.AssignLiteral("Can't send message!");
}
dbus_message_unref(msg);
dbus_message_unref(reply);
sAuthorizeReqTable.Remove(aDeviceAddress);
DispatchBluetoothReply(aRunnable, v, errorStr);
return result;
}
void
BluetoothDBusService::Connect(const nsAString& aDeviceAddress,
const uint16_t aProfileId,

View File

@ -100,10 +100,6 @@ public:
SetPairingConfirmationInternal(const nsAString& aDeviceAddress, bool aConfirm,
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual bool
SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow,
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
virtual void
Connect(const nsAString& aDeviceAddress,
const uint16_t aProfileId,

View File

@ -34,9 +34,6 @@ this.SystemMessagePermissionsTable = {
"bluetooth-dialer-command": {
"telephony": []
},
"bluetooth-authorize": {
"bluetooth": []
},
"bluetooth-cancel": {
"bluetooth": []
},

View File

@ -9,14 +9,14 @@ this.PHONE_NUMBER_META_DATA = {
"385": '["HR","00","0",,,"$NP$FG","\\d{6,12}","[1-7]\\d{5,8}|[89]\\d{6,11}",[["(1)(\\d{4})(\\d{3})","$1 $2 $3","1",,],["(6[09])(\\d{4})(\\d{3})","$1 $2 $3","6[09]",,],["(62)(\\d{3})(\\d{3,4})","$1 $2 $3","62",,],["([2-5]\\d)(\\d{3})(\\d{3})","$1 $2 $3","[2-5]",,],["(9\\d)(\\d{3})(\\d{3,4})","$1 $2 $3","9",,],["(9\\d)(\\d{4})(\\d{4})","$1 $2 $3","9",,],["(9\\d)(\\d{3,4})(\\d{3})(\\d{3})","$1 $2 $3 $4","9",,],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3","6[145]|7",,],["(\\d{2})(\\d{3,4})(\\d{3})","$1 $2 $3","6[145]|7",,],["(80[01])(\\d{2})(\\d{2,3})","$1 $2 $3","8",,],["(80[01])(\\d{3,4})(\\d{3})","$1 $2 $3","8",,]]]',
"670": '["TL","00",,,,,"\\d{7,8}","[2-489]\\d{6}|7\\d{6,7}",[["(\\d{3})(\\d{4})","$1 $2","[2-489]",,],["(\\d{4})(\\d{4})","$1 $2","7",,]]]',
"258": '["MZ","00",,,,,"\\d{8,9}","[28]\\d{7,8}",[["([28]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3","2|8[246]",,],["(80\\d)(\\d{3})(\\d{3})","$1 $2 $3","80",,]]]',
"359": '["BG","00","0",,,"$NP$FG","\\d{5,9}","[23567]\\d{5,7}|[489]\\d{6,8}",[["(2)(\\d{5})","$1 $2","29",,],["(2)(\\d{3})(\\d{3,4})","$1 $2 $3","2",,],["(\\d{3})(\\d{4})","$1 $2","43[124-7]|70[1-9]",,],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3","43[124-7]|70[1-9]",,],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3","[78]00",,],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3","[356]|7[1-9]|8[1-6]|9[1-7]",,],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3","48|8[7-9]|9[08]",,]]]',
"359": '["BG","00","0",,,"$NP$FG","\\d{5,9}","[23567]\\d{5,7}|[489]\\d{6,8}",[["(2)(\\d{5})","$1 $2","29",,],["(2)(\\d{3})(\\d{3,4})","$1 $2 $3","2",,],["(\\d{3})(\\d{4})","$1 $2","43[124-7]|70[1-9]",,],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3","43[124-7]|70[1-9]",,],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3","[78]00",,],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3","[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]",,],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3","48|8[7-9]|9[08]",,]]]',
"682": '["CK","00",,,,,"\\d{5}","[2-57]\\d{4}",[["(\\d{2})(\\d{3})","$1 $2",,,]]]',
"852": '["HK","00",,,,,"\\d{5,11}","[235-7]\\d{7}|8\\d{7,8}|9\\d{4,10}",[["(\\d{4})(\\d{4})","$1 $2","[235-7]|[89](?:0[1-9]|[1-9])",,],["(800)(\\d{3})(\\d{3})","$1 $2 $3","800",,],["(900)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4","900",,],["(900)(\\d{2,5})","$1 $2","900",,]]]',
"998": '["UZ","810","8",,,"$NP $FG","\\d{7,9}","[679]\\d{8}",[["([679]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
"291": '["ER","00","0",,,"$NP$FG","\\d{6,7}","[178]\\d{6}",[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",,,]]]',
"95": '["MM","00","0",,,"$NP$FG","\\d{5,10}","[14578]\\d{5,7}|[26]\\d{5,8}|9(?:[258]|3\\d|4\\d{1,2}|[679]\\d?)\\d{6}",[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3","1|2[45]",,],["(2)(\\d{4})(\\d{4})","$1 $2 $3","251",,],["(\\d)(\\d{2})(\\d{3})","$1 $2 $3","16|2",,],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3","67|81",,],["(\\d{2})(\\d{2})(\\d{3,4})","$1 $2 $3","[4-8]",,],["(9)(\\d{3})(\\d{4,5})","$1 $2 $3","9(?:[235-9]|4[13789])",,],["(9)(4\\d{4})(\\d{4})","$1 $2 $3","94[0245]",,]]]',
"266": '["LS","00",,,,,"\\d{8}","[2568]\\d{7}",[["(\\d{4})(\\d{4})","$1 $2",,,]]]',
"245": '["GW","00",,,,,"\\d{7}","[3567]\\d{6}",[["(\\d{3})(\\d{4})","$1 $2",,,]]]',
"245": '["GW","00",,,,,"\\d{7}","[3-79]\\d{6}",[["(\\d{3})(\\d{4})","$1 $2",,,]]]',
"374": '["AM","00","0",,,"($NP$FG)","\\d{5,8}","[1-9]\\d{7}",[["(\\d{2})(\\d{6})","$1 $2","1|47",,],["(\\d{2})(\\d{6})","$1 $2","[5-7]|9[1-9]","$NP$FG",],["(\\d{3})(\\d{5})","$1 $2","[23]",,],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3","8|90","$NP $FG",]]]',
"379": '["VA","00",,,,,"\\d{10}","06\\d{8}",[["(06)(\\d{4})(\\d{4})","$1 $2 $3",,,]]]',
"61": ['["AU","(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,,"\\d{6,10}","[1-578]\\d{5,9}",[["([2378])(\\d{4})(\\d{4})","$1 $2 $3","[2378]","($NP$FG)",],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3","[45]|14","$NP$FG",],["(16)(\\d{3})(\\d{2,4})","$1 $2 $3","16","$NP$FG",],["(1[389]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","1(?:[38]0|90)","$FG",],["(180)(2\\d{3})","$1 $2","180","$FG",],["(19\\d)(\\d{3})","$1 $2","19[13]","$FG",],["(19\\d{2})(\\d{4})","$1 $2","19[67]","$FG",],["(13)(\\d{2})(\\d{2})","$1 $2 $3","13[1-9]","$FG",]]]','["CC","(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,,"\\d{6,10}","[1458]\\d{5,9}",]','["CX","(?:14(?:1[14]|34|4[17]|[56]6|7[47]|88))?001[14-689]","0",,,,"\\d{6,10}","[1458]\\d{5,9}",]'],
@ -41,21 +41,21 @@ this.PHONE_NUMBER_META_DATA = {
"420": '["CZ","00",,,,,"\\d{9,12}","[2-8]\\d{8}|9\\d{8,11}",[["([2-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","[2-8]|9[015-7]",,],["(96\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4","96",,],["(9\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4","9[36]",,]]]',
"216": '["TN","00",,,,,"\\d{8}","[2-57-9]\\d{7}",[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",,,]]]',
"673": '["BN","00",,,,,"\\d{7}","[2-578]\\d{6}",[["([2-578]\\d{2})(\\d{4})","$1 $2",,,]]]',
"290": '["SH","00",,,,,"\\d{4}","[2-9]\\d{3}",]',
"290": ['["SH","00",,,,,"\\d{4,5}","[2-79]\\d{3,4}",]','["TA","00",,,,,"\\d{4}","8\\d{3}",]'],
"882": '["001",,,,,,"\\d{7,12}","[13]\\d{6,11}",[["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3","3[23]",,],["(\\d{2})(\\d{5})","$1 $2","16|342",,],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3","34[57]",,],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3","348",,],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3","1",,],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3","16",,],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3","16",,]]]',
"267": '["BW","00",,,,,"\\d{7,8}","[2-79]\\d{6,7}",[["(\\d{3})(\\d{4})","$1 $2","[2-6]",,],["(7\\d)(\\d{3})(\\d{3})","$1 $2 $3","7",,],["(90)(\\d{5})","$1 $2","9",,]]]',
"94": '["LK","00","0",,,"$NP$FG","\\d{7,9}","[1-9]\\d{8}",[["(\\d{2})(\\d{1})(\\d{6})","$1 $2 $3","[1-689]",,],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","7",,]]]',
"356": '["MT","00",,,,,"\\d{8}","[2579]\\d{7}",[["(\\d{4})(\\d{4})","$1 $2",,,]]]',
"375": '["BY","810","8","80?",,,"\\d{7,11}","[1-4]\\d{8}|[89]\\d{9,10}",[["([1-4]\\d)(\\d{3})(\\d{4})","$1 $2 $3","[1-4]","$NP 0$FG",],["([89]\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","8[01]|9","$NP $FG",],["(8\\d{2})(\\d{4})(\\d{4})","$1 $2 $3","82","$NP $FG",]]]',
"690": '["TK","00",,,,,"\\d{4}","[2-5]\\d{3}",]',
"356": '["MT","00",,,,,"\\d{8}","[2357-9]\\d{7}",[["(\\d{4})(\\d{4})","$1 $2",,,]]]',
"375": '["BY","810","8","8?0?",,,"\\d{7,11}","[1-4]\\d{8}|[89]\\d{9,10}",[["([1-4]\\d)(\\d{3})(\\d{4})","$1 $2 $3","[1-4]","$NP 0$FG",],["([89]\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","8[01]|9","$NP $FG",],["(8\\d{2})(\\d{4})(\\d{4})","$1 $2 $3","82","$NP $FG",]]]',
"690": '["TK","00",,,,,"\\d{4}","[2-9]\\d{3}",]',
"507": '["PA","00",,,,,"\\d{7,8}","[1-9]\\d{6,7}",[["(\\d{3})(\\d{4})","$1-$2","[1-57-9]",,],["(\\d{4})(\\d{4})","$1-$2","6",,]]]',
"692": '["MH","011","1",,,,"\\d{7}","[2-6]\\d{6}",[["(\\d{3})(\\d{4})","$1-$2",,,]]]',
"250": '["RW","00","0",,,,"\\d{8,9}","[027-9]\\d{7,8}",[["(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","2","$FG",],["([7-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","[7-9]","$NP$FG",],["(0\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","0",,]]]',
"81": '["JP","010","0",,,"$NP$FG","\\d{7,16}","[1-9]\\d{8,9}|0(?:[36]\\d{7,14}|7\\d{5,7}|8\\d{7})",[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3","(?:12|57|99)0",,],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3","800",,],["(\\d{3})(\\d{4})","$1-$2","077",,],["(\\d{3})(\\d{2})(\\d{3,4})","$1-$2-$3","077",,],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3","088",,],["(\\d{3})(\\d{3})(\\d{3,4})","$1-$2-$3","0(?:37|66)",,],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3","0(?:37|66)",,],["(\\d{3})(\\d{5})(\\d{5,6})","$1-$2-$3","0(?:37|66)",,],["(\\d{3})(\\d{6})(\\d{6,7})","$1-$2-$3","0(?:37|66)",,],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3","[2579]0|80[1-9]",,],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3","1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])",,],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3","1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-689]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])",,],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3","1|2(?:2[37]|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)",,],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3","2(?:9[14-79]|74|[34]7|[56]9)|82|993",,],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3","3|4(?:2[09]|7[01])|6[1-9]",,],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3","[2479][1-9]",,]]]',
"237": '["CM","00",,,,,"\\d{8}","[237-9]\\d{7}",[["([237-9]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[2379]|88",,],["(800)(\\d{2})(\\d{3})","$1 $2 $3","80",,]]]',
"351": '["PT","00",,,,,"\\d{9}","[2-46-9]\\d{8}",[["([2-46-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",,,]]]',
"237": '["CM","00",,,,,"\\d{8}","[2357-9]\\d{7}",[["([2357-9]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[23579]|88",,],["(800)(\\d{2})(\\d{3})","$1 $2 $3","80",,]]]',
"351": '["PT","00",,,,,"\\d{9}","[2-46-9]\\d{8}",[["(2\\d)(\\d{3})(\\d{4})","$1 $2 $3","2[12]",,],["([2-46-9]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","2[3-9]|[346-9]",,]]]',
"246": '["IO","00",,,,,"\\d{7}","3\\d{6}",[["(\\d{3})(\\d{4})","$1 $2",,,]]]',
"227": '["NE","00",,,,,"\\d{8}","[029]\\d{7}",[["([029]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[29]|09",,],["(08)(\\d{3})(\\d{3})","$1 $2 $3","08",,]]]',
"227": '["NE","00",,,,,"\\d{8}","[0289]\\d{7}",[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[289]|09",,],["(08)(\\d{3})(\\d{3})","$1 $2 $3","08",,]]]',
"27": '["ZA","00","0",,,"$NP$FG","\\d{5,9}","[1-79]\\d{8}|8(?:[067]\\d{7}|[1-4]\\d{3,7})",[["(860)(\\d{3})(\\d{3})","$1 $2 $3","860",,],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","[1-79]|8(?:[0-47]|6[1-9])",,],["(\\d{2})(\\d{3,4})","$1 $2","8[1-4]",,],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3","8[1-4]",,]]]',
"962": '["JO","00","0",,,"$NP$FG","\\d{7,9}","[235-9]\\d{7,8}",[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3","[2356]|87","($NP$FG)",],["(7)(\\d{4})(\\d{4})","$1 $2 $3","7[457-9]",,],["(\\d{3})(\\d{5,6})","$1 $2","70|8[0158]|9",,]]]',
"387": '["BA","00","0",,,"$NP$FG","\\d{6,9}","[3-9]\\d{7,8}",[["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3","[3-5]",,],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","6[1-356]|[7-9]",,],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4","6[047]",,]]]',
@ -73,20 +73,20 @@ this.PHONE_NUMBER_META_DATA = {
"357": '["CY","00",,,,,"\\d{8}","[257-9]\\d{7}",[["(\\d{2})(\\d{6})","$1 $2",,,]]]',
"240": '["GQ","00",,,,,"\\d{9}","[23589]\\d{8}",[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3","[235]",,],["(\\d{3})(\\d{6})","$1 $2","[89]",,]]]',
"506": '["CR","00",,"(19(?:0[0-2468]|19|20|66|77))",,,"\\d{8,10}","[24-9]\\d{7,9}",[["(\\d{4})(\\d{4})","$1 $2","[24-7]|8[3-9]",,],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3","[89]0",,]]]',
"86": '["CN","(1[1279]\\d{3})?00","0","(1[1279]\\d{3})|0",,,"\\d{4,12}","[1-7]\\d{7,11}|8[0-357-9]\\d{6,9}|9(?:5\\d{3}|\\d{9})",[["(80\\d{2})(\\d{4})","$1 $2","80[2678]","$NP$FG",],["([48]00)(\\d{3})(\\d{4})","$1 $2 $3","[48]00",,],["(\\d{5})","$1","95",,],["(\\d{3,4})(\\d{4})","$1 $2","[2-9]",,"NA"],["(21)(\\d{4})(\\d{4,6})","$1 $2 $3","21","$NP$FG",],["([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3","10[1-9]|2[02-9]","$NP$FG",],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3","3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:71|98)","$NP$FG",],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|3|5[1-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])","$NP$FG",],["(1[3-58]\\d)(\\d{4})(\\d{4})","$1 $2 $3","1[3-58]",,],["(10800)(\\d{3})(\\d{4})","$1 $2 $3","108",,]]]',
"86": '["CN","(1[1279]\\d{3})?00","0","(1[1279]\\d{3})|0",,,"\\d{4,12}","[1-7]\\d{6,11}|8[0-357-9]\\d{6,9}|9(?:5\\d{3,4}|\\d{9})",[["(80\\d{2})(\\d{4})","$1 $2","80[2678]","$NP$FG",],["([48]00)(\\d{3})(\\d{4})","$1 $2 $3","[48]00",,],["(\\d{5})","$1","95",,],["(\\d{2})(\\d{5,6})","$1 $2","(?:10|2\\d)9","$NP$FG",],["(\\d{3})(\\d{5,6})","$1 $2","[3-9]","$NP$FG",],["(\\d{3,4})(\\d{4})","$1 $2","[2-9]",,"NA"],["(21)(\\d{4})(\\d{4,6})","$1 $2 $3","21","$NP$FG",],["([12]\\d)(\\d{4})(\\d{4})","$1 $2 $3","10[1-9]|2[02-9]","$NP$FG",],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3","3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1|2[37]|3[12]|51|7[13-79]|9[15])|7(?:31|5[457]|6[09]|91)|8(?:71|98)","$NP$FG",],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","3(?:1[02-9]|35|49|5|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|[35][2-9]|6[4789]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[04-9]|4[3-6]|6[2368])|8(?:1[236-8]|2[5-7]|3|5[1-9]|7[02-9]|8[3678]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])","$NP$FG",],["(1[3-58]\\d)(\\d{4})(\\d{4})","$1 $2 $3","1[3-58]",,],["(10800)(\\d{3})(\\d{4})","$1 $2 $3","108",,]]]',
"257": '["BI","00",,,,,"\\d{8}","[27]\\d{7}",[["([27]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
"683": '["NU","00",,,,,"\\d{4}","[1-5]\\d{3}",]',
"43": '["AT","00","0",,,"$NP$FG","\\d{3,13}","[1-9]\\d{3,12}",[["(1)(\\d{3,12})","$1 $2","1",,],["(5\\d)(\\d{3,5})","$1 $2","5[079]",,],["(5\\d)(\\d{3})(\\d{3,4})","$1 $2 $3","5[079]",,],["(5\\d)(\\d{4})(\\d{4,7})","$1 $2 $3","5[079]",,],["(\\d{3})(\\d{3,10})","$1 $2","316|46|51|732|6(?:44|5[0-3579]|[6-9])|7(?:1|[28]0)|[89]",,],["(\\d{4})(\\d{3,9})","$1 $2","2|3(?:1[1-578]|[3-8])|4[2378]|5[2-6]|6(?:[12]|4[1-35-9]|5[468])|7(?:2[1-8]|35|4[1-8]|[57-9])",,]]]',
"247": '["AC","00",,,,,"\\d{4}","[2-467]\\d{3}",]',
"675": '["PG","00",,,,,"\\d{7,8}","[1-9]\\d{6,7}",[["(\\d{3})(\\d{4})","$1 $2","[1-689]",,],["(7\\d{2})(\\d{2})(\\d{3})","$1 $2 $3","7",,]]]',
"376": '["AD","00",,,,,"\\d{6,8}","(?:[346-9]|180)\\d{5}",[["(\\d{3})(\\d{3})","$1 $2","[346-9]",,],["(180[02])(\\d{4})","$1 $2","1",,]]]',
"63": '["PH","00","0",,,,"\\d{7,13}","[2-9]\\d{7,9}|1800\\d{7,9}",[["(2)(\\d{3})(\\d{4})","$1 $2 $3","2","($NP$FG)",],["(\\d{4})(\\d{5})","$1 $2","3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|5(?:22|44)|642|8(?:62|8[245])","($NP$FG)",],["(\\d{5})(\\d{4})","$1 $2","346|4(?:27|9[35])|883","($NP$FG)",],["([3-8]\\d)(\\d{3})(\\d{4})","$1 $2 $3","[3-8]","($NP$FG)",],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","81|9","$NP$FG",],["(1800)(\\d{3})(\\d{4})","$1 $2 $3","1",,],["(1800)(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4","1",,]]]',
"63": '["PH","00","0",,,,"\\d{5,13}","2\\d{5,7}|[3-9]\\d{7,9}|1800\\d{7,9}",[["(2)(\\d{3})(\\d{4})","$1 $2 $3","2","($NP$FG)",],["(2)(\\d{5})","$1 $2","2","($NP$FG)",],["(\\d{4})(\\d{4,6})","$1 $2","3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|5(?:22|44)|642|8(?:62|8[245])","($NP$FG)",],["(\\d{5})(\\d{4})","$1 $2","346|4(?:27|9[35])|883","($NP$FG)",],["([3-8]\\d)(\\d{3})(\\d{4})","$1 $2 $3","[3-8]","($NP$FG)",],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","81|9","$NP$FG",],["(1800)(\\d{3})(\\d{4})","$1 $2 $3","1",,],["(1800)(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4","1",,]]]',
"236": '["CF","00",,,,,"\\d{8}","[278]\\d{7}",[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
"590": ['["GP","00","0",,,"$NP$FG","\\d{9}","[56]\\d{8}",[["([56]90)(\\d{2})(\\d{4})","$1 $2-$3",,,]]]','["BL","00","0",,,,"\\d{9}","[56]\\d{8}",]','["MF","00","0",,,,"\\d{9}","[56]\\d{8}",]'],
"53": '["CU","119","0",,,"($NP$FG)","\\d{4,8}","[2-57]\\d{5,7}",[["(\\d)(\\d{6,7})","$1 $2","7",,],["(\\d{2})(\\d{4,6})","$1 $2","[2-4]",,],["(\\d)(\\d{7})","$1 $2","5","$NP$FG",]]]',
"64": '["NZ","0(?:0|161)","0",,,"$NP$FG","\\d{7,11}","6[235-9]\\d{6}|[2-57-9]\\d{7,10}",[["([34679])(\\d{3})(\\d{4})","$1-$2 $3","[3467]|9[1-9]",,],["(24099)(\\d{3})","$1 $2","240",,],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","21",,],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3","2(?:1[1-9]|[69]|7[0-35-9])|86",,],["(2\\d)(\\d{3,4})(\\d{4})","$1 $2 $3","2[028]",,],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3","2(?:10|74)|5|[89]0",,]]]',
"965": '["KW","00",,,,,"\\d{7,8}","[12569]\\d{6,7}",[["(\\d{4})(\\d{3,4})","$1 $2","[1269]",,],["(5[015]\\d)(\\d{5})","$1 $2","5",,]]]',
"224": '["GN","00",,,,,"\\d{8,9}","[23567]\\d{7,8}",[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[23567]",,],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","6[02356]",,]]]',
"224": '["GN","00",,,,,"\\d{8,9}","[367]\\d{7,8}",[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","3",,],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[67]",,]]]',
"973": '["BH","00",,,,,"\\d{8}","[136-9]\\d{7}",[["(\\d{4})(\\d{4})","$1 $2",,,]]]',
"32": '["BE","00","0",,,"$NP$FG","\\d{8,9}","[1-9]\\d{7,8}",[["(4[6-9]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","4[6-9]",,],["([2-49])(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4","[23]|[49][23]",,],["([15-8]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[156]|7[0178]|8(?:0[1-9]|[1-79])",,],["([89]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3","(?:80|9)0",,]]]',
"249": '["SD","00","0",,,"$NP$FG","\\d{9}","[19]\\d{8}",[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",,,]]]',
@ -100,7 +100,7 @@ this.PHONE_NUMBER_META_DATA = {
"238": '["CV","0",,,,,"\\d{7}","[259]\\d{6}",[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",,,]]]',
"691": '["FM","00",,,,,"\\d{7}","[39]\\d{6}",[["(\\d{3})(\\d{4})","$1 $2",,,]]]',
"262": ['["RE","00","0",,,"$NP$FG","\\d{9}","[268]\\d{8}",[["([268]\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]','["YT","00","0",,,"$NP$FG","\\d{9}","[268]\\d{8}",]'],
"241": '["GA","00","0",,,,"\\d{7,8}","[01]\\d{6,7}",[["(1)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","1","$NP$FG",],["(0\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","0",,]]]',
"241": '["GA","00",,,,,"\\d{8}","0\\d{7}",[["(0\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
"370": '["LT","00","8","[08]",,"($NP-$FG)","\\d{8}","[3-9]\\d{7}",[["([34]\\d)(\\d{6})","$1 $2","37|4(?:1|5[45]|6[2-4])",,],["([3-6]\\d{2})(\\d{5})","$1 $2","3[148]|4(?:[24]|6[09])|528|6",,],["([7-9]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3","[7-9]","$NP $FG",],["(5)(2\\d{2})(\\d{4})","$1 $2 $3","52[0-79]",,]]]',
"256": '["UG","00[057]","0",,,"$NP$FG","\\d{5,9}","\\d{9}",[["(\\d{3})(\\d{6})","$1 $2","[7-9]|20(?:[013-8]|2[5-9])|4(?:6[45]|[7-9])",,],["(\\d{2})(\\d{7})","$1 $2","3|4(?:[1-5]|6[0-36-9])",,],["(2024)(\\d{5})","$1 $2","2024",,]]]',
"677": '["SB","0[01]",,,,,"\\d{5,7}","[1-9]\\d{4,6}",[["(\\d{3})(\\d{4})","$1 $2","[7-9]",,]]]',
@ -112,11 +112,11 @@ this.PHONE_NUMBER_META_DATA = {
"964": '["IQ","00","0",,,"$NP$FG","\\d{6,10}","[1-7]\\d{7,9}",[["(1)(\\d{3})(\\d{4})","$1 $2 $3","1",,],["([2-6]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3","[2-6]",,],["(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","7",,]]]',
"225": '["CI","00",,,,,"\\d{8}","[02-6]\\d{7}",[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
"992": '["TJ","810","8",,,"($NP) $FG","\\d{3,9}","[3-59]\\d{8}",[["([349]\\d{2})(\\d{2})(\\d{4})","$1 $2 $3","[34]7|91[78]",,],["([459]\\d)(\\d{3})(\\d{4})","$1 $2 $3","4[48]|5|9(?:1[59]|[0235-9])",,],["(331700)(\\d)(\\d{2})","$1 $2 $3","331",,],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3","3[1-5]",,]]]',
"55": '["BR","00(?:1[45]|2[135]|[34]1|43)","0","(?:0|90)(?:(1[245]|2[135]|[34]1)(\\d{10,11}))?","$2",,"\\d{8,11}","[1-46-9]\\d{7,10}|5\\d{8,9}",[["(\\d{4})(\\d{4})","$1-$2","[2-9](?:[1-9]|0[1-9])","$FG","NA"],["(\\d{5})(\\d{4})","$1-$2","9(?:[1-9]|0[1-9])","$FG","NA"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3","1[1-9]9","($FG)",],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3","[1-9][1-9]","($FG)",],["([34]00\\d)(\\d{4})","$1-$2","[34]00",,],["([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3","[3589]00","$NP$FG",]]]',
"55": '["BR","00(?:1[45]|2[135]|[34]1|43)","0","(?:0|90)(?:(1[245]|2[135]|[34]1)(\\d{10,11}))?","$2",,"\\d{8,11}","[1-46-9]\\d{7,10}|5\\d{8,9}",[["(\\d{4})(\\d{4})","$1-$2","[2-9](?:[1-9]|0[1-9])","$FG","NA"],["(\\d{5})(\\d{4})","$1-$2","9(?:[1-9]|0[1-9])","$FG","NA"],["(\\d{3,5})","$1","1[125689]","$FG","NA"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3","(?:1[1-9]|2[12478])9","($FG)",],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3","[1-9][1-9]","($FG)",],["([34]00\\d)(\\d{4})","$1-$2","[34]00",,],["([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3","[3589]00","$NP$FG",]]]',
"674": '["NR","00",,,,,"\\d{7}","[458]\\d{6}",[["(\\d{3})(\\d{4})","$1 $2",,,]]]',
"967": '["YE","00","0",,,"$NP$FG","\\d{6,9}","[1-7]\\d{6,8}",[["([1-7])(\\d{3})(\\d{3,4})","$1 $2 $3","[1-6]|7[24-68]",,],["(7\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","7[0137]",,]]]',
"49": '["DE","00","0",,,"$NP$FG","\\d{2,15}","[1-35-9]\\d{3,14}|4(?:[0-8]\\d{4,12}|9(?:[0-37]\\d|4(?:[1-35-8]|4\\d?)|5\\d{1,2}|6[1-8]\\d?)\\d{2,7})",[["(1\\d{2})(\\d{7,8})","$1 $2","1[67]",,],["(1\\d{3})(\\d{7})","$1 $2","15",,],["(\\d{2})(\\d{4,11})","$1 $2","3[02]|40|[68]9",,],["(\\d{3})(\\d{3,11})","$1 $2","2(?:\\d1|0[2389]|1[24]|28|34)|3(?:[3-9][15]|40)|[4-8][1-9]1|9(?:06|[1-9]1)",,],["(\\d{4})(\\d{2,11})","$1 $2","[24-6]|[7-9](?:\\d[1-9]|[1-9]\\d)|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])",,],["(3\\d{4})(\\d{1,10})","$1 $2","3",,],["(800)(\\d{7,10})","$1 $2","800",,],["(177)(99)(\\d{7,8})","$1 $2 $3","177",,],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3","(?:18|90)0",,],["(1\\d{2})(\\d{5,11})","$1 $2","181",,],["(18\\d{3})(\\d{6})","$1 $2","185",,],["(18\\d{2})(\\d{7})","$1 $2","18[68]",,],["(18\\d)(\\d{8})","$1 $2","18[2-579]",,],["(700)(\\d{4})(\\d{4})","$1 $2 $3","700",,]]]',
"31": '["NL","00","0",,,"$NP$FG","\\d{5,10}","1\\d{4,8}|[2-7]\\d{8}|[89]\\d{6,9}",[["([1-578]\\d)(\\d{3})(\\d{4})","$1 $2 $3","1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[458]",,],["([1-5]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","1[16-8]|2[259]|3[124]|4[17-9]|5[124679]",,],["(6)(\\d{8})","$1 $2","6[0-57-9]",,],["(66)(\\d{7})","$1 $2","66",,],["(14)(\\d{3,4})","$1 $2","14","$FG",],["([89]0\\d)(\\d{4,7})","$1 $2","80|9",,]]]',
"49": '["DE","00","0",,,"$NP$FG","\\d{2,15}","[1-35-9]\\d{3,14}|4(?:[0-8]\\d{4,12}|9(?:[0-37]\\d|4(?:[1-35-8]|4\\d?)|5\\d{1,2}|6[1-8]\\d?)\\d{2,7})",[["(1\\d{2})(\\d{7,8})","$1 $2","1[67]",,],["(1\\d{3})(\\d{7})","$1 $2","15",,],["(\\d{2})(\\d{4,11})","$1 $2","3[02]|40|[68]9",,],["(\\d{3})(\\d{3,11})","$1 $2","2(?:\\d1|0[2389]|1[24]|28|34)|3(?:[3-9][15]|40)|[4-8][1-9]1|9(?:06|[1-9]1)",,],["(\\d{4})(\\d{2,11})","$1 $2","[24-6]|[7-9](?:\\d[1-9]|[1-9]\\d)|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])",,],["(3\\d{4})(\\d{1,10})","$1 $2","3",,],["(800)(\\d{7,12})","$1 $2","800",,],["(177)(99)(\\d{7,8})","$1 $2 $3","177",,],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3","(?:18|90)0",,],["(1\\d{2})(\\d{5,11})","$1 $2","181",,],["(18\\d{3})(\\d{6})","$1 $2","185",,],["(18\\d{2})(\\d{7})","$1 $2","18[68]",,],["(18\\d)(\\d{8})","$1 $2","18[2-579]",,],["(700)(\\d{4})(\\d{4})","$1 $2 $3","700",,]]]',
"31": '["NL","00","0",,,"$NP$FG","\\d{5,10}","1\\d{4,8}|[2-7]\\d{8}|[89]\\d{6,9}",[["([1-578]\\d)(\\d{3})(\\d{4})","$1 $2 $3","1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[4578]",,],["([1-5]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","1[16-8]|2[259]|3[124]|4[17-9]|5[124679]",,],["(6)(\\d{8})","$1 $2","6[0-57-9]",,],["(66)(\\d{7})","$1 $2","66",,],["(14)(\\d{3,4})","$1 $2","14","$FG",],["([89]0\\d)(\\d{4,7})","$1 $2","80|9",,]]]',
"970": '["PS","00","0",,,"$NP$FG","\\d{4,10}","[24589]\\d{7,8}|1(?:[78]\\d{8}|[49]\\d{2,3})",[["([2489])(2\\d{2})(\\d{4})","$1 $2 $3","[2489]",,],["(5[69]\\d)(\\d{3})(\\d{3})","$1 $2 $3","5",,],["(1[78]00)(\\d{3})(\\d{3})","$1 $2 $3","1[78]","$FG",]]]',
"58": '["VE","00","0","(1\\d{2})|0",,"$NP$FG","\\d{7,10}","[24589]\\d{9}",[["(\\d{3})(\\d{7})","$1-$2",,,]]]',
"856": '["LA","00","0",,,"$NP$FG","\\d{6,10}","[2-8]\\d{7,9}",[["(20)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4","20",,],["([2-8]\\d)(\\d{3})(\\d{3})","$1 $2 $3","2[13]|[3-8]",,]]]',
@ -135,7 +135,7 @@ this.PHONE_NUMBER_META_DATA = {
"84": '["VN","00","0",,,"$NP$FG","\\d{7,10}","[17]\\d{6,9}|[2-69]\\d{7,9}|8\\d{6,8}",[["([17]99)(\\d{4})","$1 $2","[17]99",,],["([48])(\\d{4})(\\d{4})","$1 $2 $3","[48]",,],["([235-7]\\d)(\\d{4})(\\d{3})","$1 $2 $3","2[025-79]|3[0136-9]|5[2-9]|6[0-46-8]|7[02-79]",,],["(80)(\\d{5})","$1 $2","80",,],["(69\\d)(\\d{4,5})","$1 $2","69",,],["([235-7]\\d{2})(\\d{4})(\\d{3})","$1 $2 $3","2[1348]|3[25]|5[01]|65|7[18]",,],["(9\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4","9",,],["(1[2689]\\d)(\\d{3})(\\d{4})","$1 $2 $3","1(?:[26]|8[68]|99)",,],["(1[89]00)(\\d{4,6})","$1 $2","1[89]0","$FG",]]]',
"255": '["TZ","00[056]","0",,,"$NP$FG","\\d{7,9}","\\d{9}",[["([24]\\d)(\\d{3})(\\d{4})","$1 $2 $3","[24]",,],["([67]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","[67]",,],["([89]\\d{2})(\\d{2})(\\d{4})","$1 $2 $3","[89]",,]]]',
"222": '["MR","00",,,,,"\\d{8}","[2-48]\\d{7}",[["([2-48]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
"230": '["MU","0(?:[2-7]0|33)",,,,,"\\d{7}","[2-9]\\d{6}",[["([2-9]\\d{2})(\\d{4})","$1 $2",,,]]]',
"230": '["MU","0(?:0|[2-7]0|33)",,,,,"\\d{7,8}","[2-9]\\d{6,7}",[["([2-46-9]\\d{2})(\\d{4})","$1 $2","[2-46-9]",,],["(5\\d{3})(\\d{4})","$1 $2","5",,]]]',
"592": '["GY","001",,,,,"\\d{7}","[2-4679]\\d{6}",[["(\\d{3})(\\d{4})","$1 $2",,,]]]',
"41": '["CH","00","0",,,"$NP$FG","\\d{9}(?:\\d{3})?","[2-9]\\d{8}|860\\d{9}",[["([2-9]\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4","[2-7]|[89]1",,],["([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","8[047]|90",,],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5","860",,]]]',
"39": '["IT","00",,,,,"\\d{6,11}","[01589]\\d{5,10}|3(?:[12457-9]\\d{8}|[36]\\d{7,9})",[["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3","0[26]|55",,],["(0[26])(\\d{4})(\\d{5})","$1 $2 $3","0[26]",,],["(0[26])(\\d{4,6})","$1 $2","0[26]",,],["(0\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3","0[13-57-9][0159]",,],["(\\d{3})(\\d{3,6})","$1 $2","0[13-57-9][0159]|8(?:03|4[17]|9[245])",,],["(0\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","0[13-57-9][2-46-8]",,],["(0\\d{3})(\\d{2,6})","$1 $2","0[13-57-9][2-46-8]",,],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3","[13]|8(?:00|4[08]|9[59])",,],["(\\d{4})(\\d{4})","$1 $2","894",,],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3","3",,]]]',
@ -144,7 +144,7 @@ this.PHONE_NUMBER_META_DATA = {
"353": '["IE","00","0",,,"($NP$FG)","\\d{5,10}","[124-9]\\d{6,9}",[["(1)(\\d{3,4})(\\d{4})","$1 $2 $3","1",,],["(\\d{2})(\\d{5})","$1 $2","2[24-9]|47|58|6[237-9]|9[35-9]",,],["(\\d{3})(\\d{5})","$1 $2","40[24]|50[45]",,],["(48)(\\d{4})(\\d{4})","$1 $2 $3","48",,],["(818)(\\d{3})(\\d{3})","$1 $2 $3","81",,],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3","[24-69]|7[14]",,],["([78]\\d)(\\d{3,4})(\\d{4})","$1 $2 $3","76|8[35-9]","$NP$FG",],["(700)(\\d{3})(\\d{3})","$1 $2 $3","70","$NP$FG",],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3","1(?:8[059]|5)","$FG",]]]',
"966": '["SA","00","0",,,"$NP$FG","\\d{7,10}","1\\d{7,8}|(?:[2-467]|92)\\d{7}|5\\d{8}|8\\d{9}",[["([1-467])(\\d{3})(\\d{4})","$1 $2 $3","[1-467]",,],["(1\\d)(\\d{3})(\\d{4})","$1 $2 $3","1[1-467]",,],["(5\\d)(\\d{3})(\\d{4})","$1 $2 $3","5",,],["(92\\d{2})(\\d{5})","$1 $2","9","$FG",],["(800)(\\d{3})(\\d{4})","$1 $2 $3","80","$FG",],["(811)(\\d{3})(\\d{3,4})","$1 $2 $3","81",,]]]',
"380": '["UA","00","0",,,"$NP$FG","\\d{5,9}","[3-689]\\d{8}",[["([3-689]\\d)(\\d{3})(\\d{4})","$1 $2 $3","[38]9|4(?:[45][0-5]|87)|5(?:0|6[37]|7[37])|6[36-8]|9[1-9]",,],["([3-689]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","3[1-8]2|4[13678]2|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8[0-8]|90",,],["([3-6]\\d{3})(\\d{5})","$1 $2","3(?:5[013-9]|[1-46-8])|4(?:[137][013-9]|6|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6[0135-9]|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])",,]]]',
"98": '["IR","00","0",,,"$NP$FG","\\d{4,10}","[14-8]\\d{6,9}|[23]\\d{5,9}|9(?:[1-4]\\d{8}|9\\d{2,8})",[["(21)(\\d{3,5})","$1 $2","21",,],["(21)(\\d{3})(\\d{3,4})","$1 $2 $3","21",,],["(2[16])(\\d{4})(\\d{4})","$1 $2 $3","2[16]",,],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3","[13-9]|2[02-9]",,]]]',
"98": '["IR","00","0",,,"$NP$FG","\\d{4,10}","[14-8]\\d{6,9}|[23]\\d{4,9}|9(?:[1-4]\\d{8}|9\\d{2,8})",[["(2[15])(\\d{3,5})","$1 $2","2(?:1|5[0-47-9])",,],["(2[15])(\\d{3})(\\d{3,4})","$1 $2 $3","2(?:1|5[0-47-9])",,],["(2\\d)(\\d{4})(\\d{4})","$1 $2 $3","2(?:[16]|5[0-47-9])",,],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3","[13-9]|2[02-57-9]",,],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3","[13-9]|2[02-57-9]",,],["(\\d{3})(\\d{3})","$1 $2","[13-9]|2[02-57-9]",,]]]',
"971": '["AE","00","0",,,"$NP$FG","\\d{5,12}","[2-79]\\d{7,8}|800\\d{2,9}",[["([2-4679])(\\d{3})(\\d{4})","$1 $2 $3","[2-4679][2-8]",,],["(5[0256])(\\d{3})(\\d{4})","$1 $2 $3","5",,],["([479]00)(\\d)(\\d{5})","$1 $2 $3","[479]0","$FG",],["([68]00)(\\d{2,9})","$1 $2","60|8","$FG",]]]',
"30": '["GR","00",,,,,"\\d{10}","[26-9]\\d{9}",[["([27]\\d)(\\d{4})(\\d{4})","$1 $2 $3","21|7",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","2[2-9]1|[689]",,],["(2\\d{3})(\\d{6})","$1 $2","2[2-9][02-9]",,]]]',
"228": '["TG","00",,,,,"\\d{8}","[29]\\d{7}",[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
@ -156,10 +156,10 @@ this.PHONE_NUMBER_META_DATA = {
"502": '["GT","00",,,,,"\\d{8}(?:\\d{3})?","[2-7]\\d{7}|1[89]\\d{9}",[["(\\d{4})(\\d{4})","$1 $2","[2-7]",,],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3","1",,]]]',
"82": '["KR","00(?:[124-68]|[37]\\d{2})","0","0(8[1-46-8]|85\\d{2})?",,"$NP$FG","\\d{4,10}","[1-7]\\d{3,9}|8\\d{8}",[["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3","1(?:0|1[19]|[69]9|5[458])|[57]0",,],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3","1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][1-9]",,],["(\\d{3})(\\d)(\\d{4})","$1-$2-$3","131",,],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3","131",,],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3","13[2-9]",,],["(\\d{2})(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3-$4","30",,],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3","2[1-9]",,],["(\\d)(\\d{3,4})","$1-$2","21[0-46-9]",,],["(\\d{2})(\\d{3,4})","$1-$2","[3-6][1-9]1",,],["(\\d{4})(\\d{4})","$1-$2","1(?:5[46-9]|6[04678])","$FG",]]]',
"253": '["DJ","00",,,,,"\\d{8}","[27]\\d{7}",[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
"91": '["IN","00","0",,,"$NP$FG","\\d{6,13}","1\\d{7,12}|[2-9]\\d{9,10}",[["(\\d{2})(\\d{2})(\\d{6})","$1 $2 $3","7(?:2[0579]|3[057-9]|4[0-389]|5[024-9]|6[0-35-9]|7[0346-9]|8[0-79])|8(?:0[015689]|1[0-57-9]|2[2356-9]|3[0-57-9]|[45]|6[0245789]|7[1-69]|8[0124-9]|9[02-9])|9",,],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3","11|2[02]|33|4[04]|79|80[2-46]",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","1(?:2[0-249]|3[0-25]|4[145]|[569][14]|7[1257]|8[1346]|[68][1-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[126-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:[136][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)",,],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3","1(?:[2-579]|[68][1-9])|[2-8]",,],["(1600)(\\d{2})(\\d{4})","$1 $2 $3","160","$FG",],["(1800)(\\d{4,5})","$1 $2","180","$FG",],["(18[06]0)(\\d{2,4})(\\d{4})","$1 $2 $3","18[06]","$FG",],["(\\d{4})(\\d{3})(\\d{4})(\\d{2})","$1 $2 $3 $4","18[06]","$FG",]]]',
"91": '["IN","00","0",,,"$NP$FG","\\d{6,13}","1\\d{7,12}|[2-9]\\d{9,10}",[["(\\d{2})(\\d{2})(\\d{6})","$1 $2 $3","7(?:2[0579]|3[057-9]|4[0-389]|5[024-9]|6[0-35-9]|7|8[0-79])|8(?:0[015689]|1[0-57-9]|2[2356-9]|3[0-57-9]|[45]|6[0245789]|7[1-69]|8[0124-9]|9[02-9])|9",,],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3","11|2[02]|33|4[04]|79|80[2-46]",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","1(?:2[0-249]|3[0-25]|4[145]|[569][14]|7[1257]|8[1346]|[68][1-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[126-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:[136][25]|22|4[28]|5[12]|[78]1|9[15])|6(?:12|[2345]1|57|6[13]|7[14]|80)",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1|88)",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)",,],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3","1(?:[2-579]|[68][1-9])|[2-8]",,],["(1600)(\\d{2})(\\d{4})","$1 $2 $3","160","$FG",],["(1800)(\\d{4,5})","$1 $2","180","$FG",],["(18[06]0)(\\d{2,4})(\\d{4})","$1 $2 $3","18[06]","$FG",],["(\\d{4})(\\d{3})(\\d{4})(\\d{2})","$1 $2 $3 $4","18[06]","$FG",]]]',
"389": '["MK","00","0",,,"$NP$FG","\\d{8}","[2-578]\\d{7}",[["(2)(\\d{3})(\\d{4})","$1 $2 $3","2",,],["([347]\\d)(\\d{3})(\\d{3})","$1 $2 $3","[347]",,],["([58]\\d{2})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4","[58]",,]]]',
"1": ['["US","011","1",,,,"\\d{7}(?:\\d{3})?","[2-9]\\d{9}",[["(\\d{3})(\\d{4})","$1-$2",,,"NA"],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",,,"$1-$2-$3"]]]','["AI","011","1",,,,"\\d{7}(?:\\d{3})?","[2589]\\d{9}",]','["AS","011","1",,,,"\\d{7}(?:\\d{3})?","[5689]\\d{9}",]','["BB","011","1",,,,"\\d{7}(?:\\d{3})?","[2589]\\d{9}",]','["BM","011","1",,,,"\\d{7}(?:\\d{3})?","[4589]\\d{9}",]','["BS","011","1",,,,"\\d{7}(?:\\d{3})?","[2589]\\d{9}",]','["CA","011","1",,,,"\\d{7}(?:\\d{3})?","[2-9]\\d{9}|3\\d{6}",]','["DM","011","1",,,,"\\d{7}(?:\\d{3})?","[57-9]\\d{9}",]','["DO","011","1",,,,"\\d{7}(?:\\d{3})?","[589]\\d{9}",]','["GD","011","1",,,,"\\d{7}(?:\\d{3})?","[4589]\\d{9}",]','["GU","011","1",,,,"\\d{7}(?:\\d{3})?","[5689]\\d{9}",]','["JM","011","1",,,,"\\d{7}(?:\\d{3})?","[589]\\d{9}",]','["KN","011","1",,,,"\\d{7}(?:\\d{3})?","[589]\\d{9}",]','["KY","011","1",,,,"\\d{7}(?:\\d{3})?","[3589]\\d{9}",]','["LC","011","1",,,,"\\d{7}(?:\\d{3})?","[5789]\\d{9}",]','["MP","011","1",,,,"\\d{7}(?:\\d{3})?","[5689]\\d{9}",]','["MS","011","1",,,,"\\d{7}(?:\\d{3})?","[5689]\\d{9}",]','["PR","011","1",,,,"\\d{7}(?:\\d{3})?","[5789]\\d{9}",]','["SX","011","1",,,,"\\d{7}(?:\\d{3})?","[5789]\\d{9}",]','["TC","011","1",,,,"\\d{7}(?:\\d{3})?","[5689]\\d{9}",]','["TT","011","1",,,,"\\d{7}(?:\\d{3})?","[589]\\d{9}",]','["AG","011","1",,,,"\\d{7}(?:\\d{3})?","[2589]\\d{9}",]','["VC","011","1",,,,"\\d{7}(?:\\d{3})?","[5789]\\d{9}",]','["VG","011","1",,,,"\\d{7}(?:\\d{3})?","[2589]\\d{9}",]','["VI","011","1",,,,"\\d{7}(?:\\d{3})?","[3589]\\d{9}",]'],
"60": '["MY","00","0",,,,"\\d{6,10}","[13-9]\\d{7,9}",[["([4-79])(\\d{3})(\\d{4})","$1-$2 $3","[4-79]","$NP$FG",],["(3)(\\d{4})(\\d{4})","$1-$2 $3","3","$NP$FG",],["([18]\\d)(\\d{3})(\\d{3,4})","$1-$2 $3","1[02-46-9][1-9]|8","$NP$FG",],["(1)([36-8]00)(\\d{2})(\\d{4})","$1-$2-$3-$4","1[36-8]0",,],["(11)(\\d{4})(\\d{4})","$1-$2 $3","11","$NP$FG",],["(154)(\\d{3})(\\d{4})","$1-$2 $3","15","$NP$FG",]]]',
"60": '["MY","00","0",,,,"\\d{6,10}","[13-9]\\d{7,9}",[["([4-79])(\\d{3})(\\d{4})","$1-$2 $3","[4-79]","$NP$FG",],["(3)(\\d{4})(\\d{4})","$1-$2 $3","3","$NP$FG",],["([18]\\d)(\\d{3})(\\d{3,4})","$1-$2 $3","1[02-46-9][1-9]|8","$NP$FG",],["(1)([36-8]00)(\\d{2})(\\d{4})","$1-$2-$3-$4","1[36-8]0",,],["(11)(\\d{4})(\\d{4})","$1-$2 $3","11","$NP$FG",],["(15[49])(\\d{3})(\\d{4})","$1-$2 $3","15","$NP$FG",]]]',
"355": '["AL","00","0",,,"$NP$FG","\\d{5,9}","[2-57]\\d{7}|6\\d{8}|8\\d{5,7}|9\\d{5}",[["(4)(\\d{3})(\\d{4})","$1 $2 $3","4[0-6]",,],["(6[6-9])(\\d{3})(\\d{4})","$1 $2 $3","6",,],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","[2358][2-5]|4[7-9]",,],["(\\d{3})(\\d{3,5})","$1 $2","[235][16-9]|8[016-9]|[79]",,]]]',
"254": '["KE","000","0",,,"$NP$FG","\\d{5,10}","20\\d{6,7}|[4-9]\\d{6,9}",[["(\\d{2})(\\d{4,7})","$1 $2","[24-6]",,],["(\\d{3})(\\d{6,7})","$1 $2","7",,],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3","[89]",,]]]',
"223": '["ML","00",,,,,"\\d{8}","[246-8]\\d{7}",[["([246-8]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
@ -170,7 +170,7 @@ this.PHONE_NUMBER_META_DATA = {
"233": '["GH","00","0",,,"$NP$FG","\\d{7,9}","[235]\\d{8}|8\\d{7}",[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","[235]",,],["(\\d{3})(\\d{5})","$1 $2","8",,]]]',
"593": '["EC","00","0",,,"($NP$FG)","\\d{7,11}","1\\d{9,10}|[2-8]\\d{7}|9\\d{8}",[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3","[247]|[356][2-8]",,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","9","$NP$FG",],["(1800)(\\d{3})(\\d{3,4})","$1 $2 $3","1","$FG",]]]',
"509": '["HT","00",,,,,"\\d{8}","[2-489]\\d{7}",[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",,,]]]',
"54": '["AR","00","0","0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[124-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:1[1568]|2[15]|3[145]|4[13]|5[14-8]|[069]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1","$NP$FG","\\d{6,11}","[1-368]\\d{9}|9\\d{10}",[["([68]\\d{2})(\\d{3})(\\d{4})","$1-$2-$3","[68]",,],["(9)(11)(\\d{4})(\\d{4})","$2 15-$3-$4","911",,"$1 $2 $3-$4"],["(9)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4","9(?:2[234689]|3[3-8])",,"$1 $2 $3-$4"],["(9)(\\d{4})(\\d{3})(\\d{3})","$2 15-$3-$4","93[58]",,],["(9)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4","9[23]",,"$1 $2 $3-$4"],["(11)(\\d{4})(\\d{4})","$1 $2-$3","1",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3","2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578])",,],["(\\d{4})(\\d{3})(\\d{3})","$1 $2-$3","3(?:53|8[78])",,],["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3","[23]",,]]]',
"54": '["AR","00","0","0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[124-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:1[1568]|2[15]|3[145]|4[13]|5[14-8]|[069]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1","$NP$FG","\\d{6,11}","[1-368]\\d{9}|9\\d{10}",[["([68]\\d{2})(\\d{3})(\\d{4})","$1-$2-$3","[68]",,],["(9)(11)(\\d{4})(\\d{4})","$2 15-$3-$4","911",,"$1 $2 $3-$4"],["(9)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4","9(?:2[234689]|3[3-8])",,"$1 $2 $3-$4"],["(9)(\\d{4})(\\d{3})(\\d{3})","$2 15-$3-$4","93[58]",,"$1 $2 $3-$4"],["(9)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4","9[23]",,"$1 $2 $3-$4"],["(11)(\\d{4})(\\d{4})","$1 $2-$3","1",,],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3","2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578])",,],["(\\d{4})(\\d{3})(\\d{3})","$1 $2-$3","3(?:53|8[78])",,],["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3","[23]",,]]]',
"57": '["CO","00[579]|#555|#999","0","0([3579]|4(?:44|56))?",,,"\\d{7,11}","(?:[13]\\d{0,3}|[24-8])\\d{7}",[["(\\d)(\\d{7})","$1 $2","1(?:8[2-9]|9[0-3]|[2-7])|[24-8]","($FG)",],["(\\d{3})(\\d{7})","$1 $2","3",,],["(1)(\\d{3})(\\d{7})","$1-$2-$3","1(?:80|9[04])","$NP$FG","$1 $2 $3"]]]',
"597": '["SR","00",,,,,"\\d{6,7}","[2-8]\\d{5,6}",[["(\\d{3})(\\d{3})","$1-$2","[2-4]|5[2-58]",,],["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3","56",,],["(\\d{3})(\\d{4})","$1-$2","[6-8]",,]]]',
"676": '["TO","00",,,,,"\\d{5,7}","[02-8]\\d{4,6}",[["(\\d{2})(\\d{3})","$1-$2","[1-6]|7[0-4]|8[05]",,],["(\\d{3})(\\d{4})","$1 $2","7[5-9]|8[7-9]",,],["(\\d{4})(\\d{3})","$1 $2","0",,]]]',
@ -179,17 +179,17 @@ this.PHONE_NUMBER_META_DATA = {
"7": ['["RU","810","8",,,"$NP ($FG)","\\d{10}","[3489]\\d{9}",[["(\\d{3})(\\d{2})(\\d{2})","$1-$2-$3","[1-79]","$FG","NA"],["([3489]\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4","[34689]",,],["(7\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","7",,]]]','["KZ","810","8",,,,"\\d{10}","(?:33\\d|7\\d{2}|80[09])\\d{7}",]'],
"268": '["SZ","00",,,,,"\\d{8}","[027]\\d{7}",[["(\\d{4})(\\d{4})","$1 $2","[027]",,]]]',
"501": '["BZ","00",,,,,"\\d{7}(?:\\d{4})?","[2-8]\\d{6}|0\\d{10}",[["(\\d{3})(\\d{4})","$1-$2","[2-8]",,],["(0)(800)(\\d{4})(\\d{3})","$1-$2-$3-$4","0",,]]]',
"252": '["SO","00","0",,,,"\\d{7,9}","[1-79]\\d{6,8}",[["(\\d)(\\d{6})","$1 $2","2[0-79]|[13-5]",,],["(\\d)(\\d{7})","$1 $2","24|[67]",,],["(\\d{2})(\\d{5,7})","$1 $2","15|28|6[178]|9",,],["(69\\d)(\\d{6})","$1 $2","69",,]]]',
"252": '["SO","00","0",,,,"\\d{7,9}","[1-79]\\d{6,8}",[["(\\d)(\\d{6})","$1 $2","2[0-79]|[13-5]",,],["(\\d)(\\d{7})","$1 $2","24|[67]",,],["(\\d{2})(\\d{5,7})","$1 $2","15|28|6[1378]|9",,],["(69\\d)(\\d{6})","$1 $2","69",,]]]',
"229": '["BJ","00",,,,,"\\d{4,8}","[2689]\\d{7}|7\\d{3}",[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,,]]]',
"680": '["PW","01[12]",,,,,"\\d{7}","[2-8]\\d{6}",[["(\\d{3})(\\d{4})","$1 $2",,,]]]',
"263": '["ZW","00","0",,,"$NP$FG","\\d{3,10}","2(?:[012457-9]\\d{3,8}|6\\d{3,6})|[13-79]\\d{4,8}|8[06]\\d{8}",[["([49])(\\d{3})(\\d{2,5})","$1 $2 $3","4|9[2-9]",,],["([179]\\d)(\\d{3})(\\d{3,4})","$1 $2 $3","[19]1|7",,],["(86\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","86[24]",,],["([2356]\\d{2})(\\d{3,5})","$1 $2","2(?:[278]|0[45]|[49]8)|3(?:08|17|3[78]|[78])|5[15][78]|6(?:[29]8|37|[68][78])",,],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3","2(?:[278]|0[45]|48)|3(?:08|17|3[78]|[78])|5[15][78]|6(?:[29]8|37|[68][78])|80",,],["([1-356]\\d)(\\d{3,5})","$1 $2","1[3-9]|2(?:[1-469]|0[0-35-9]|[45][0-79])|3(?:0[0-79]|1[0-689]|[24-69]|3[0-69])|5(?:[02-46-9]|[15][0-69])|6(?:[0145]|[29][0-79]|3[0-689]|[68][0-69])",,],["([1-356]\\d)(\\d{3})(\\d{3})","$1 $2 $3","1[3-9]|2(?:[1-469]|0[0-35-9]|[45][0-79])|3(?:0[0-79]|1[0-689]|[24-69]|3[0-69])|5(?:[02-46-9]|[15][0-69])|6(?:[0145]|[29][0-79]|3[0-689]|[68][0-69])",,],["([25]\\d{3})(\\d{3,5})","$1 $2","(?:25|54)8",,],["([25]\\d{3})(\\d{3})(\\d{3})","$1 $2 $3","(?:25|54)8",,],["(8\\d{3})(\\d{6})","$1 $2","86",,]]]',
"90": '["TR","00","0",,,,"\\d{7,10}","[2-589]\\d{9}|444\\d{4}",[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","[23]|4(?:[0-35-9]|4[0-35-9])","($NP$FG)",],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3","[589]","$NP$FG",],["(444)(\\d{1})(\\d{3})","$1 $2 $3","444",,]]]',
"352": '["LU","00",,"(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)",,,"\\d{4,11}","[24-9]\\d{3,10}|3(?:[0-46-9]\\d{2,9}|5[013-9]\\d{1,8})",[["(\\d{2})(\\d{3})","$1 $2","[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])",,],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3","[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])",,],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3","20",,],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4","2(?:[0367]|4[3-8])",,],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4","20",,],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5","2(?:[0367]|4[3-8])",,],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,4})","$1 $2 $3 $4","2(?:[12589]|4[12])|[3-5]|7[1-9]|[89](?:[1-9]|0[2-9])",,],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3","[89]0[01]|70",,],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3","6",,]]]',
"47": ['["NO","00",,,,,"\\d{5}(?:\\d{3})?","0\\d{4}|[2-9]\\d{7}",[["([489]\\d{2})(\\d{2})(\\d{3})","$1 $2 $3","[489]",,],["([235-7]\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[235-7]",,]]]','["SJ","00",,,,,"\\d{5}(?:\\d{3})?","0\\d{4}|[4789]\\d{7}",]'],
"243": '["CD","00","0",,,"$NP$FG","\\d{7,9}","[2-6]\\d{6}|[18]\\d{6,8}|9\\d{8}",[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","12",,],["([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","8[0-259]|9",,],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3","8[48]",,],["(\\d{2})(\\d{5})","$1 $2","[1-6]",,]]]',
"243": '["CD","00","0",,,"$NP$FG","\\d{7,9}","[2-6]\\d{6}|[18]\\d{6,8}|9\\d{8}",[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3","12",,],["([89]\\d{2})(\\d{3})(\\d{3})","$1 $2 $3","8[0-2459]|9",,],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3","88",,],["(\\d{2})(\\d{5})","$1 $2","[1-6]",,]]]',
"220": '["GM","00",,,,,"\\d{7}","[2-9]\\d{6}",[["(\\d{3})(\\d{4})","$1 $2",,,]]]',
"687": '["NC","00",,,,,"\\d{6}","[2-47-9]\\d{5}",[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",,,]]]',
"995": '["GE","810","8",,,,"\\d{6,9}","[3458]\\d{8}",[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[348]","$NP $FG",],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","5","$FG",]]]',
"995": '["GE","00","0",,,,"\\d{6,9}","[34578]\\d{8}",[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","[348]","$NP$FG",],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3","7","$NP$FG",],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4","5","$FG",]]]',
"961": '["LB","00","0",,,,"\\d{7,8}","[13-9]\\d{6,7}",[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3","[13-6]|7(?:[2-579]|62|8[0-7])|[89][2-9]","$NP$FG",],["([7-9]\\d)(\\d{3})(\\d{3})","$1 $2 $3","[89][01]|7(?:[01]|6[013-9]|8[89]|91)",,]]]',
"40": '["RO","00","0",,,"$NP$FG","\\d{6,9}","2\\d{5,8}|[37-9]\\d{8}",[["([237]\\d)(\\d{3})(\\d{4})","$1 $2 $3","[23]1",,],["(21)(\\d{4})","$1 $2","21",,],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3","[23][3-7]|[7-9]",,],["(2\\d{2})(\\d{3})","$1 $2","2[3-6]",,]]]',
"232": '["SL","00","0",,,"($NP$FG)","\\d{6,8}","[2-578]\\d{7}",[["(\\d{2})(\\d{6})","$1 $2",,,]]]',

View File

@ -1747,7 +1747,7 @@ RILContentHelper.prototype = {
if (changed) {
this._deliverEvent("_voicemailListeners",
"voicemailNotification",
"notifyStatusChanged",
[this.voicemailStatus]);
}
},

View File

@ -4,5 +4,4 @@ browser = false
qemu = true
[test_voicemail_statuschanged.py]
disabled = Bug 806138
[test_voicemail_number.js]

View File

@ -2,10 +2,8 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
let Cu = SpecialPowers.wrap(Components).utils;
let RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
SpecialPowers.Cu.import("resource://gre/modules/ril_consts.js", RIL);
// Only bring in what we need from ril_worker/RadioInterfaceLayer here. Reusing
// that code turns out to be a nightmare, so there is some code duplication.

View File

@ -91,8 +91,6 @@ interface BluetoothAdapter : EventTarget {
DOMRequest setPasskey(DOMString deviceAddress, unsigned long passkey);
[Creator, Throws]
DOMRequest setPairingConfirmation(DOMString deviceAddress, boolean confirmation);
[Creator, Throws]
DOMRequest setAuthorization(DOMString deviceAddress, boolean allow);
/**
* Connect/Disconnect to a specific service of a target remote device.

View File

@ -0,0 +1,174 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[JSImplementation="@mozilla.org/b2g-inputmethod;1",
NavigatorProperty="mozInputMethod"]
interface MozInputMethod : EventTarget {
// Input Method Manager contain a few global methods expose to apps
readonly attribute MozInputMethodManager mgmt;
// Fired when the input context changes, include changes from and to null.
// The new InputContext instance will be available in the event
// object under |inputcontext| property. When it changes to null it
// means the app (the user of this API) no longer has the control of
// the original focused input field.
// Note that if the app saves the original context, it might get
// void; implementation decides when to void the input context.
attribute EventHandler oninputcontextchange;
// An "input context" is mapped to a text field that the app is
// allow to mutate. this attribute should be null when there is no
// text field currently focused.
readonly attribute MozInputContext? inputcontext;
};
// Manages the list of IMEs, enables/disables IME and switches to an
// IME.
[JSImplementation="@mozilla.org/b2g-imm;1"]
interface MozInputMethodManager {
// Ask the OS to show a list of available IMEs for users to switch from.
// OS should ignore this request if the app is currently not the active one.
void showAll();
// Ask the OS to switch away from the current active Keyboard app.
// OS should ignore this request if the app is currently not the active one.
void next();
// To know if the OS supports IME switching or not.
// Use case: let the keyboard app knows if it is necessary to show the "IME switching"
// (globe) button. We have a use case that when there is only one IME enabled, we
// should not show the globe icon.
boolean supportsSwitching();
// Ask the OS to hide the current active Keyboard app. (was: |removeFocus()|)
// OS should ignore this request if the app is currently not the active one.
// The OS will void the current input context (if it exists).
// This method belong to |mgmt| because we would like to allow Keyboard to access to
// this method w/o a input context.
void hide();
};
// The input context, which consists of attributes and information of current input field.
// It also hosts the methods available to the keyboard app to mutate the input field represented.
// An "input context" gets void when the app is no longer allowed to interact with the text field,
// e.g., the text field does no longer exist, the app is being switched to background, and etc.
[JSImplementation="@mozilla.org/b2g-inputcontext;1"]
interface MozInputContext: EventTarget {
// The tag name of input field, which is enum of "input", "textarea", or "contenteditable"
readonly attribute DOMString type;
// The type of the input field, which is enum of text, number, password, url, search, email, and so on.
// See http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#states-of-the-type-attribute
readonly attribute DOMString inputType;
/*
* The inputmode string, representing the input mode.
* See http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#input-modalities:-the-inputmode-attribute
*/
readonly attribute DOMString inputMode;
/*
* The primary language for the input field.
* It is the value of HTMLElement.lang.
* See http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlelement
*/
readonly attribute DOMString lang;
/*
* Get the whole text content of the input field.
* @return DOMString
*/
Promise getText(optional long offset, optional long length);
// The start and stop position of the selection.
readonly attribute long selectionStart;
readonly attribute long selectionEnd;
/*
* Set the selection range of the the editable text.
* Note: This method cannot be used to move the cursor during composition. Calling this
* method will cancel composition.
* @param start The beginning of the selected text.
* @param length The length of the selected text.
*
* Note that the start position should be less or equal to the end position.
* To move the cursor, set the start and end position to the same value.
*
* @return boolean
*/
Promise setSelectionRange(long start, long length);
/* User moves the cursor, or changes the selection with other means. If the text around
* cursor has changed, but the cursor has not been moved, the IME won't get notification.
*/
attribute EventHandler onselectionchange;
/*
* Commit text to current input field and replace text around
* cursor position. It will clear the current composition.
*
* @param text The string to be replaced with.
* @param offset The offset from the cursor position where replacing starts. Defaults to 0.
* @param length The length of text to replace. Defaults to 0.
* @return boolean
*/
Promise replaceSurroundingText(DOMString text, optional long offset, optional long length);
/*
*
* Delete text around the cursor.
* @param offset The offset from the cursor position where deletion starts.
* @param length The length of text to delete.
* TODO: maybe updateSurroundingText(DOMString beforeText, DOMString afterText); ?
* @return boolean
*/
Promise deleteSurroundingText(long offset, long length);
/*
* Notifies when the text around the cursor is changed, due to either text
* editing or cursor movement. If the cursor has been moved, but the text around has not
* changed, the IME won't get notification.
*
* The event handler function is specified as:
* @param beforeString Text before and including cursor position.
* @param afterString Text after and excluing cursor position.
* function(DOMString beforeText, DOMString afterText) {
* ...
* }
*/
attribute EventHandler onsurroundingtextchange;
/*
* send a character with its key events.
* @param modifiers see http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMWindowUtils.idl#206
* @return true if succeeds. Otherwise false if the input context becomes void.
* Alternative: sendKey(KeyboardEvent event), but we will likely
* waste memory for creating the KeyboardEvent object.
*/
Promise sendKey(long keyCode, long charCode, long modifiers);
/*
* Set current composition. It will start or update composition.
* @param cursor Position in the text of the cursor.
*
* The API implementation should automatically ends the composition
* session (with event and confirm the current composition) if
* endComposition is never called. Same apply when the inputContext is lost
* during a unfinished composition session.
*/
Promise setComposition(DOMString text, long cursor);
/*
* End composition and actually commit the text. (was |commitText(text, offset, length)|)
* Ending the composition with an empty string will not send any text.
* Note that if composition always ends automatically (with the current composition committed)
* if the composition did not explicitly with |endComposition()| but was interrupted with
* |sendKey()|, |setSelectionRange()|, user moving the cursor, or remove the focus, etc.
*
* @param text The text
*/
Promise endComposition(DOMString text);
};

View File

@ -527,3 +527,8 @@ else
test_webidl_files := $(NULL)
endif
ifdef MOZ_B2G
webidl_files += \
InputMethod.webidl \
$(NULL)
endif