fix(diagnostics): fixes constants and other minor issues

fix(diagnostic): Some fixes regarding objects
This commit is contained in:
Ibrahim Hadeed 2016-08-30 23:51:43 -04:00 committed by GitHub
commit 210346e1e3

View File

@ -36,68 +36,74 @@ import {Cordova, Plugin} from './plugin';
export class Diagnostic {
static permission = {
'READ_CALENDAR': 'READ_CALENDAR',
'WRITE_CALENDAR': 'WRITE_CALENDAR',
'CAMERA': 'CAMERA',
'READ_CONTACTS': 'READ_CONTACTS',
'WRITE_CONTACTS': 'WRITE_CONTACTS',
'GET_ACCOUNTS': 'GET_ACCOUNTS',
'ACCESS_FINE_LOCATION': 'ACCESS_FINE_LOCATION',
'ACCESS_COARSE_LOCATION': 'ACCESS_COARSE_LOCATION',
'RECORD_AUDIO': 'RECORD_AUDIO',
'READ_PHONE_STATE': 'READ_PHONE_STATE',
'CALL_PHONE': 'CALL_PHONE',
'ADD_VOICEMAIL': 'ADD_VOICEMAIL',
'USE_SIP': 'USE_SIP',
'PROCESS_OUTGOING_CALLS': 'PROCESS_OUTGOING_CALLS',
'READ_CALL_LOG': 'READ_CALL_LOG',
'WRITE_CALL_LOG': 'WRITE_CALL_LOG',
'SEND_SMS': 'SEND_SMS',
'RECEIVE_SMS': 'RECEIVE_SMS',
'READ_SMS': 'READ_SMS',
'RECEIVE_WAP_PUSH': 'RECEIVE_WAP_PUSH',
'RECEIVE_MMS': 'RECEIVE_MMS',
'WRITE_EXTERNAL_STORAGE': 'WRITE_EXTERNAL_STORAGE',
'READ_EXTERNAL_STORAGE': 'READ_EXTERNAL_STORAGE',
'BODY_SENSORS': 'BODY_SENSORS'
READ_CALENDAR: 'READ_CALENDAR',
WRITE_CALENDAR: 'WRITE_CALENDAR',
CAMERA: 'CAMERA',
READ_CONTACTS: 'READ_CONTACTS',
WRITE_CONTACTS: 'WRITE_CONTACTS',
GET_ACCOUNTS: 'GET_ACCOUNTS',
ACCESS_FINE_LOCATION: 'ACCESS_FINE_LOCATION',
ACCESS_COARSE_LOCATION: 'ACCESS_COARSE_LOCATION',
RECORD_AUDIO: 'RECORD_AUDIO',
READ_PHONE_STATE: 'READ_PHONE_STATE',
CALL_PHONE: 'CALL_PHONE',
ADD_VOICEMAIL: 'ADD_VOICEMAIL',
USE_SIP: 'USE_SIP',
PROCESS_OUTGOING_CALLS: 'PROCESS_OUTGOING_CALLS',
READ_CALL_LOG: 'READ_CALL_LOG',
WRITE_CALL_LOG: 'WRITE_CALL_LOG',
SEND_SMS: 'SEND_SMS',
RECEIVE_SMS: 'RECEIVE_SMS',
READ_SMS: 'READ_SMS',
RECEIVE_WAP_PUSH: 'RECEIVE_WAP_PUSH',
RECEIVE_MMS: 'RECEIVE_MMS',
WRITE_EXTERNAL_STORAGE: 'WRITE_EXTERNAL_STORAGE',
READ_EXTERNAL_STORAGE: 'READ_EXTERNAL_STORAGE',
BODY_SENSORS: 'BODY_SENSORS'
};
static permissionStatus = {
'NOT_REQUESTED': 'not_determined',
'DENIED': 'denied',
'RESTRICTED': 'restricted',
'GRANTED': 'authorized',
'GRANTED_WHEN_IN_USE': 'authorized_when_in_use'
GRANTED: 'GRANTED',
GRANTED_WHEN_IN_USE: 'GRANTED_WHEN_IN_USE', // iOS
RESTRICTED: 'RESTRICTED', // iOS
DENIED: 'DENIED',
DENIED_ALWAYS: 'DENIED_ALWAYS', // android
NOT_REQUESTED: 'NOT_REQUESTED'
};
static locationAuthorizationMode = {
'ALWAYS': 'always',
'WHEN_IN_USE': 'when_in_use'
ALWAYS: 'ALWAYS',
WHEN_IN_USE: 'WHEN_IN_USE'
};
static permissionGroups = {
'GRANTED': 'GRANTED',
'DENIED': 'DENIED',
'NOT_REQUESTED': 'NOT_REQUESTED',
'DENIED_ALWAYS': 'DENIED_ALWAYS'
CALENDAR: ['READ_CALENDAR', 'WRITE_CALENDAR'],
CAMERA: ['CAMERA'],
CONTACTS: ['READ_CONTACTS', 'WRITE_CONTACTS', 'GET_ACCOUNTS'],
LOCATION: ['ACCESS_FINE_LOCATION', 'ACCESS_COARSE_LOCATION'],
MICROPHONE: ['RECORD_AUDIO'],
PHONE: ['READ_PHONE_STATE', 'CALL_PHONE', 'ADD_VOICEMAIL', 'USE_SIP', 'PROCESS_OUTGOING_CALLS', 'READ_CALL_LOG', 'WRITE_CALL_LOG'],
SENSORS: ['BODY_SENSORS'],
SMS: ['SEND_SMS', 'RECEIVE_SMS', 'READ_SMS', 'RECEIVE_WAP_PUSH', 'RECEIVE_MMS'],
STORAGE: ['READ_EXTERNAL_STORAGE', 'WRITE_EXTERNAL_STORAGE']
};
static locationMode = {
'HIGH_ACCURACY': 'high_accuracy',
'DEVICE_ONLY': 'device_only',
'BATTERY_SAVING': 'battery_saving',
'LOCATION_OFF': 'location_off'
HIGH_ACCURACY: 'high_accuracy',
DEVICE_ONLY: 'device_only',
BATTERY_SAVING: 'battery_saving',
LOCATION_OFF: 'location_off'
};
static bluetoothState = {
'UNKNOWN': 'unknown',
'RESETTING': 'resetting', // iOS
'UNSUPPORTED': 'unsupported', // iOS
'UNAUTHORIZED': 'unauthorized', // iOS
'POWERED_OFF': 'powered_off',
'POWERED_ON': 'powered_on',
'POWERING_OFF': 'powering_off',
'POWERING_ON': 'powering_on'
UNKNOWN: 'unknown',
RESETTING: 'resetting', // iOS
UNSUPPORTED: 'unsupported', // iOS
UNAUTHORIZED: 'unauthorized', // iOS
POWERED_OFF: 'powered_off',
POWERED_ON: 'powered_on',
POWERING_OFF: 'powering_off',
POWERING_ON: 'powering_on'
};