summaryrefslogtreecommitdiff
path: root/android/src
diff options
context:
space:
mode:
Diffstat (limited to 'android/src')
-rw-r--r--android/src/org/rockbox/RockboxActivity.java4
-rw-r--r--android/src/org/rockbox/RockboxFramebuffer.java21
-rw-r--r--android/src/org/rockbox/RockboxPCM.java3
-rw-r--r--android/src/org/rockbox/RockboxService.java6
4 files changed, 14 insertions, 20 deletions
diff --git a/android/src/org/rockbox/RockboxActivity.java b/android/src/org/rockbox/RockboxActivity.java
index e50ff59df3..b4ca9a6d2a 100644
--- a/android/src/org/rockbox/RockboxActivity.java
+++ b/android/src/org/rockbox/RockboxActivity.java
@@ -52,7 +52,7 @@ public class RockboxActivity extends Activity
52 /* Now it gets a bit tricky: 52 /* Now it gets a bit tricky:
53 * The service is started in the same thread as we are now, 53 * The service is started in the same thread as we are now,
54 * but the service also initializes the framebuffer 54 * but the service also initializes the framebuffer
55 * Unforunately, this happens *after* any of the default 55 * Unfortunately, this happens *after* any of the default
56 * startup methods of an activity, so we need to poll for it 56 * startup methods of an activity, so we need to poll for it
57 * 57 *
58 * In order to get the fb, we need to let the Service start up 58 * In order to get the fb, we need to let the Service start up
@@ -71,7 +71,7 @@ public class RockboxActivity extends Activity
71 } 71 }
72 /* drawing needs to happen in ui thread */ 72 /* drawing needs to happen in ui thread */
73 runOnUiThread(new Runnable() 73 runOnUiThread(new Runnable()
74 { @Override 74 {
75 public void run() { 75 public void run() {
76 loadingdialog.dismiss(); 76 loadingdialog.dismiss();
77 setContentView(RockboxService.fb); 77 setContentView(RockboxService.fb);
diff --git a/android/src/org/rockbox/RockboxFramebuffer.java b/android/src/org/rockbox/RockboxFramebuffer.java
index 070ef5cbc9..e90eb86dbd 100644
--- a/android/src/org/rockbox/RockboxFramebuffer.java
+++ b/android/src/org/rockbox/RockboxFramebuffer.java
@@ -36,37 +36,34 @@ public class RockboxFramebuffer extends View
36 private Bitmap btm; 36 private Bitmap btm;
37 private ByteBuffer native_buf; 37 private ByteBuffer native_buf;
38 38
39 public RockboxFramebuffer(Context c) 39 public RockboxFramebuffer(Context c, int lcd_width,
40 int lcd_height, ByteBuffer native_fb)
40 { 41 {
41 super(c); 42 super(c);
42 btm = null;
43 43
44 /* Needed so we can catch KeyEvents */ 44 /* Needed so we can catch KeyEvents */
45 setFocusable(true); 45 setFocusable(true);
46 setFocusableInTouchMode(true); 46 setFocusableInTouchMode(true);
47 setClickable(true); 47 setClickable(true);
48 btm = Bitmap.createBitmap(lcd_width, lcd_height, Bitmap.Config.RGB_565);
49 native_buf = native_fb;
48 requestFocus(); 50 requestFocus();
49 } 51 }
50 52
51 public void onDraw(Canvas c) 53 public void onDraw(Canvas c)
52 { 54 {
53 if (btm != null) 55 c.drawBitmap(btm, 0.0f, 0.0f, null);
54 c.drawBitmap(btm, 0.0f, 0.0f, null);
55 } 56 }
56 57
57 public void java_lcd_init(int lcd_width, int lcd_height, ByteBuffer native_fb) 58 @SuppressWarnings("unused")
58 { 59 private void java_lcd_update()
59 btm = Bitmap.createBitmap(lcd_width, lcd_height, Bitmap.Config.RGB_565);
60 native_buf = native_fb;
61 }
62
63 public void java_lcd_update()
64 { 60 {
65 btm.copyPixelsFromBuffer(native_buf); 61 btm.copyPixelsFromBuffer(native_buf);
66 postInvalidate(); 62 postInvalidate();
67 } 63 }
68 64
69 public void java_lcd_update_rect(int x, int y, int w, int h) 65 @SuppressWarnings("unused")
66 private void java_lcd_update_rect(int x, int y, int w, int h)
70 { 67 {
71 /* can't copy a partial buffer */ 68 /* can't copy a partial buffer */
72 btm.copyPixelsFromBuffer(native_buf); 69 btm.copyPixelsFromBuffer(native_buf);
diff --git a/android/src/org/rockbox/RockboxPCM.java b/android/src/org/rockbox/RockboxPCM.java
index a3d09a43eb..46bdd121f0 100644
--- a/android/src/org/rockbox/RockboxPCM.java
+++ b/android/src/org/rockbox/RockboxPCM.java
@@ -148,7 +148,7 @@ public class RockboxPCM extends AudioTrack
148 buf = new byte[max_len*3/4]; 148 buf = new byte[max_len*3/4];
149 refill_mark = max_len - buf.length; 149 refill_mark = max_len - buf.length;
150 } 150 }
151 @Override 151
152 public void onMarkerReached(AudioTrack track) 152 public void onMarkerReached(AudioTrack track)
153 { 153 {
154 /* push new data to the hardware */ 154 /* push new data to the hardware */
@@ -186,7 +186,6 @@ public class RockboxPCM extends AudioTrack
186 } 186 }
187 } 187 }
188 188
189 @Override
190 public void onPeriodicNotification(AudioTrack track) 189 public void onPeriodicNotification(AudioTrack track)
191 { 190 {
192 } 191 }
diff --git a/android/src/org/rockbox/RockboxService.java b/android/src/org/rockbox/RockboxService.java
index 964404c745..be02342768 100644
--- a/android/src/org/rockbox/RockboxService.java
+++ b/android/src/org/rockbox/RockboxService.java
@@ -64,6 +64,7 @@ public class RockboxService extends Service
64 private Object[] mStopForegroundArgs = new Object[1]; 64 private Object[] mStopForegroundArgs = new Object[1];
65 private IntentFilter itf; 65 private IntentFilter itf;
66 private BroadcastReceiver batt_monitor; 66 private BroadcastReceiver batt_monitor;
67 @SuppressWarnings("unused")
67 private int battery_level; 68 private int battery_level;
68 69
69 @Override 70 @Override
@@ -118,7 +119,6 @@ public class RockboxService extends Service
118 private void startservice() 119 private void startservice()
119 { 120 {
120 final int BUFFER = 8*1024; 121 final int BUFFER = 8*1024;
121 final Context me = this;
122 Thread rb = new Thread(new Runnable() 122 Thread rb = new Thread(new Runnable()
123 { 123 {
124 public void run() 124 public void run()
@@ -135,7 +135,7 @@ public class RockboxService extends Service
135 ZipEntry entry; 135 ZipEntry entry;
136 File file = new File("/data/data/org.rockbox/" + 136 File file = new File("/data/data/org.rockbox/" +
137 "lib/libmisc.so"); 137 "lib/libmisc.so");
138 /* use arbitary file to determine whether extracting is needed */ 138 /* use arbitrary file to determine whether extracting is needed */
139 File file2 = new File("/data/data/org.rockbox/" + 139 File file2 = new File("/data/data/org.rockbox/" +
140 "app_rockbox/rockbox/codecs/mpa.codec"); 140 "app_rockbox/rockbox/codecs/mpa.codec");
141 if (!file2.exists() || (file.lastModified() > file2.lastModified())) 141 if (!file2.exists() || (file.lastModified() > file2.lastModified()))
@@ -184,8 +184,6 @@ public class RockboxService extends Service
184 } 184 }
185 185
186 System.loadLibrary("rockbox"); 186 System.loadLibrary("rockbox");
187
188 fb = new RockboxFramebuffer(me);
189 main(); 187 main();
190 } 188 }
191 },"Rockbox thread"); 189 },"Rockbox thread");