Skip to content

Commit 43b131b

Browse files
committed
Upload file
1 parent 05eb7e6 commit 43b131b

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ class BgTaskThread(private var process: Process) : Thread() {
2626
}
2727

2828
class ServiceShellHandler(private val context: Context, private val runnableNode: RunnableNode, private val notificationID: Int) : ShellHandlerBase() {
29+
30+
init {
31+
super.context = context
32+
}
33+
2934
private var notificationManager: NotificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
3035
private val notificationTitle = runnableNode.title
3136
private var notificationMessageRows = ArrayList<String>()

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class HiddenTaskThread(private var process: Process) : Thread() {
1717
}
1818

1919
class ServiceShellHandler(private val context: Context) : ShellHandlerBase() {
20+
21+
init {
22+
super.context = context
23+
}
24+
2025
private var errorRows = ArrayList<String>()
2126
private var notificationMShortMsg = ""
2227
private var progressCurrent = 0

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
public abstract class ShellHandlerBase extends Handler {
2121

2222
protected Context context;
23-
24-
// ✅ THÊM: getter, KHÔNG abstract
23+
2524
protected Context getContext() {
2625
return context;
2726
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ class DialogLogFragment : androidx.fragment.app.DialogFragment() {
180180
private var shellProgress: ProgressBar?
181181
) : ShellHandlerBase() {
182182

183+
init {
184+
super.context = context
185+
}
186+
183187
private val context = logView?.context
184188
private val errorColor = getColor(R.color.kr_shell_log_error)
185189
private val basicColor = getColor(R.color.kr_shell_log_basic)

0 commit comments

Comments
 (0)