Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
cb6d2ed2
Kaydet (Commit)
cb6d2ed2
authored
Eyl 03, 2012
tarafından
Andrzej J.R. Hunt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Repeat bluetooth discovery periodically.
Change-Id: I2cccc3118a06b2202a249ae8ed116d2c3bc85395
üst
e11ae67c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
43 deletions
+12
-43
BluetoothFinder.java
...reoffice/impressremote/communication/BluetoothFinder.java
+12
-43
No files found.
android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothFinder.java
Dosyayı görüntüle @
cb6d2ed2
...
@@ -11,6 +11,7 @@ import android.content.BroadcastReceiver;
...
@@ -11,6 +11,7 @@ import android.content.BroadcastReceiver;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.content.IntentFilter
;
import
android.os.Handler
;
import
android.support.v4.content.LocalBroadcastManager
;
import
android.support.v4.content.LocalBroadcastManager
;
public
class
BluetoothFinder
{
public
class
BluetoothFinder
{
...
@@ -18,8 +19,6 @@ public class BluetoothFinder {
...
@@ -18,8 +19,6 @@ public class BluetoothFinder {
// TODO: add removal of cached items
// TODO: add removal of cached items
private
Context
mContext
;
private
Context
mContext
;
private
static
final
String
CHARSET
=
"UTF-8"
;
BluetoothAdapter
mAdapter
;
BluetoothAdapter
mAdapter
;
public
BluetoothFinder
(
Context
aContext
)
{
public
BluetoothFinder
(
Context
aContext
)
{
...
@@ -64,8 +63,6 @@ public class BluetoothFinder {
...
@@ -64,8 +63,6 @@ public class BluetoothFinder {
@Override
@Override
public
void
onReceive
(
Context
context
,
Intent
aIntent
)
{
public
void
onReceive
(
Context
context
,
Intent
aIntent
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
System
.
out
.
print
(
"Received intent<<<"
);
System
.
out
.
println
(
aIntent
.
getAction
());
if
(
aIntent
.
getAction
().
equals
(
BluetoothDevice
.
ACTION_FOUND
))
{
if
(
aIntent
.
getAction
().
equals
(
BluetoothDevice
.
ACTION_FOUND
))
{
BluetoothDevice
aDevice
=
(
BluetoothDevice
)
aIntent
.
getExtras
()
BluetoothDevice
aDevice
=
(
BluetoothDevice
)
aIntent
.
getExtras
()
.
get
(
BluetoothDevice
.
EXTRA_DEVICE
);
.
get
(
BluetoothDevice
.
EXTRA_DEVICE
);
...
@@ -79,45 +76,17 @@ public class BluetoothFinder {
...
@@ -79,45 +76,17 @@ public class BluetoothFinder {
CommunicationService
.
MSG_SERVERLIST_CHANGED
);
CommunicationService
.
MSG_SERVERLIST_CHANGED
);
LocalBroadcastManager
.
getInstance
(
mContext
).
sendBroadcast
(
LocalBroadcastManager
.
getInstance
(
mContext
).
sendBroadcast
(
aNIntent
);
aNIntent
);
// System.out.println("Found " + aDevice.getName());
}
else
if
(
aIntent
.
getAction
().
equals
(
// try {
BluetoothAdapter
.
ACTION_DISCOVERY_FINISHED
))
{
// // "f36d0a20-e876-11e1-aff1-0800200c9a66"
// Start discovery again after a small delay.
// BluetoothSocket aSocket = aDevice
Handler
aHandler
=
new
Handler
();
// .createRfcommSocketToServiceRecord(UUID
aHandler
.
postDelayed
(
new
Runnable
()
{
// .fromString("00001101-0000-1000-8000-00805F9B34FB"));
@Override
// aSocket.connect();
public
void
run
()
{
// } catch (IOException e) {
mAdapter
.
startDiscovery
();
// // TODO Auto-generated catch block
}
// e.printStackTrace();
},
1000
*
15
);
// System.out.println("Fallback");
;
// Method m;
// try {
// m = aDevice.getClass().getMethod("createRfcommSocket",
// new Class[] { int.class });
// BluetoothSocket aFSocket = (BluetoothSocket) m.invoke(
// aDevice, 1);
//
// mAdapter.cancelDiscovery();
// aFSocket.connect();
// } catch (NoSuchMethodException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// } catch (IllegalArgumentException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// } catch (IllegalAccessException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// } catch (InvocationTargetException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// } catch (IOException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
// System.out.println("Fallback complete");
//
// }
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment