Skip to content

Commit 359c71a

Browse files
committed
Upload file
1 parent 68858ed commit 359c71a

4 files changed

Lines changed: 8 additions & 14 deletions

File tree

krscript/src/main/java/com/omarea/krscript/BgTaskThread.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ class BgTaskThread(private var process: Process) : Thread() {
153153
updateNotification()
154154
}
155155

156-
override fun getContext(): Context {
157-
return context
158-
}
159-
160156
override fun onToast(text: String) {
161157
synchronized(notificationMessageRows) {
162158
notificationMessageRows.add(text)

krscript/src/main/java/com/omarea/krscript/HiddenTaskThread.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ class HiddenTaskThread(private var process: Process) : Thread() {
6363
progressTotal = total
6464
}
6565

66-
override fun getContext(): Context {
67-
return context
68-
}
69-
7066
override fun onToast(text: String) {
7167
Toast.makeText(context, text, Toast.LENGTH_LONG).show()
7268
}

krscript/src/main/java/com/omarea/krscript/model/ShellHandlerBase.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
*/
1919

2020
public abstract class ShellHandlerBase extends Handler {
21+
22+
protected Context context;
23+
24+
// ✅ THÊM: getter, KHÔNG abstract
25+
protected Context getContext() {
26+
return context;
27+
}
28+
2129
/**
2230
* 处理启动信息
2331
*/
@@ -42,8 +50,6 @@ public abstract class ShellHandlerBase extends Handler {
4250
* 处理Exitvalue
4351
*/
4452
public static final int EVENT_EXIT = -2;
45-
46-
protected abstract Context getContext();
4753

4854
protected abstract void onToast(String text);
4955

krscript/src/main/java/com/omarea/krscript/ui/DialogLogFragment.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ class DialogLogFragment : androidx.fragment.app.DialogFragment() {
195195
}
196196
}
197197

198-
override fun getContext(): Context {
199-
return context
200-
}
201-
202198
override fun handleMessage(msg: Message) {
203199
when (msg.what) {
204200
EVENT_EXIT -> onExit(msg.obj)

0 commit comments

Comments
 (0)