fix returning of error
parent
c76389629a
commit
4d6791d432
|
@ -246,7 +246,11 @@ class Android < Extension
|
|||
request = Packet.create_request('activity_start')
|
||||
request.add_tlv(TLV_TYPE_URI_STRING, uri)
|
||||
response = client.send_request(request)
|
||||
response.get_tlv(TLV_TYPE_ACTIVITY_START_RESULT).value
|
||||
if response.get_tlv(TLV_TYPE_ACTIVITY_START_RESULT).value
|
||||
return nil
|
||||
else
|
||||
return response.get_tlv(TLV_TYPE_ACTIVITY_START_ERROR).value
|
||||
end
|
||||
end
|
||||
|
||||
def send_sms(dest, body, dr)
|
||||
|
|
|
@ -78,6 +78,7 @@ TLV_TYPE_CELL_SYSTEM_ID = TLV_META_TYPE_UINT | (TLV_EXTENSIONS
|
|||
|
||||
TLV_TYPE_URI_STRING = TLV_META_TYPE_STRING | (TLV_EXTENSIONS + 9101)
|
||||
TLV_TYPE_ACTIVITY_START_RESULT = TLV_META_TYPE_BOOL | (TLV_EXTENSIONS + 9102)
|
||||
TLV_TYPE_ACTIVITY_START_ERROR = TLV_META_TYPE_STRING | (TLV_EXTENSIONS + 9103)
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -538,7 +538,12 @@ class Console::CommandDispatcher::Android
|
|||
end
|
||||
|
||||
uri = args[0]
|
||||
client.android.activity_start(uri)
|
||||
result = client.android.activity_start(uri)
|
||||
if result.nil?
|
||||
print_status("Intent started")
|
||||
else
|
||||
print_error("Error: #{result}")
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue