Commit f278bd17 authored by Piyush Aggarwal's avatar Piyush Aggarwal 🎱

fix docs and little maintenance

parent 9c51f1e8
...@@ -56,6 +56,9 @@ public class TelephonyPlugin extends Plugin { ...@@ -56,6 +56,9 @@ public class TelephonyPlugin extends Plugin {
* It contains the key "event" which maps to a string indicating the type of event: * It contains the key "event" which maps to a string indicating the type of event:
* - "ringing" - A phone call is incoming * - "ringing" - A phone call is incoming
* - "missedCall" - An incoming call was not answered * - "missedCall" - An incoming call was not answered
* - "sms" - An incoming SMS message
* - Note: As of this writing (15 May 2018) the SMS interface is being improved and this type of event
* is no longer the preferred way of handling SMS. Use the packets defined by the SMS plugin instead.
* <p> * <p>
* Depending on the event, other fields may be defined * Depending on the event, other fields may be defined
*/ */
...@@ -64,8 +67,15 @@ public class TelephonyPlugin extends Plugin { ...@@ -64,8 +67,15 @@ public class TelephonyPlugin extends Plugin {
/** /**
* Old-style packet sent to request a simple telephony action * Old-style packet sent to request a simple telephony action
* <p> * <p>
* The two possible events used the be to request a message be sent or request the device * The events handled were:
* silence its ringer * - to request the device to mute its ringer
* - to request an SMS to be sent.
* <p>
* In case an SMS was being requested, the body was like so:
* { "sendSms": true,
* "phoneNumber": "542904563213",
* "messageBody": "Hi mom!"
* }
* <p> * <p>
* In case a ringer muted was requested, the body looked like so: * In case a ringer muted was requested, the body looked like so:
* { "action": "mute" } * { "action": "mute" }
...@@ -304,7 +314,7 @@ public class TelephonyPlugin extends Plugin { ...@@ -304,7 +314,7 @@ public class TelephonyPlugin extends Plugin {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return new String[]{ return new String[]{
Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_CALL_LOG Manifest.permission.READ_CALL_LOG,
}; };
} else { } else {
return new String[0]; return new String[0];
...@@ -313,7 +323,9 @@ public class TelephonyPlugin extends Plugin { ...@@ -313,7 +323,9 @@ public class TelephonyPlugin extends Plugin {
@Override @Override
public String[] getOptionalPermissions() { public String[] getOptionalPermissions() {
return new String[]{Manifest.permission.READ_CONTACTS}; return new String[]{
Manifest.permission.READ_CONTACTS,
};
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment