Skip to content

Commit 10b3713

Browse files
committed
Merge remote-tracking branch 'upstream/master' into toggle_wifi_mobile
# Conflicts: # src/main/kotlin/com/developerphil/adbidea/adb/AdbFacade.kt
2 parents e441ed2 + 72e1acb commit 10b3713

File tree

5 files changed

+25
-1
lines changed

5 files changed

+25
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.developerphil.adbidea.action
2+
3+
import com.developerphil.adbidea.adb.AdbFacade
4+
import com.developerphil.adbidea.adb.AdbUtil
5+
import com.intellij.openapi.actionSystem.AnActionEvent
6+
import com.intellij.openapi.project.Project
7+
8+
class ClearDataAndRestartWithDebuggerAction : AdbAction() {
9+
override fun actionPerformed(e: AnActionEvent, project: Project) = AdbFacade.clearDataAndRestartWithDebugger(project)
10+
11+
override fun update(e: AnActionEvent) {
12+
e.presentation.isEnabled = AdbUtil.isDebuggingAvailable
13+
}
14+
}

src/main/kotlin/com/developerphil/adbidea/adb/AdbFacade.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ object AdbFacade {
2323
fun restartDefaultActivityWithDebugger(project: Project) = executeOnDevice(project, CommandList(KillCommand(), StartDefaultActivityCommand(true)))
2424
fun clearData(project: Project) = executeOnDevice(project, ClearDataCommand())
2525
fun clearDataAndRestart(project: Project) = executeOnDevice(project, ClearDataAndRestartCommand())
26+
fun clearDataAndRestartWithDebugger(project: Project) = executeOnDevice(project, ClearDataAndRestartWithDebuggerCommand())
2627
fun enableWifi(project: Project) = executeOnDevice(project, ToggleSvcCommand(WIFI, true))
2728
fun disableWifi(project: Project) = executeOnDevice(project, ToggleSvcCommand(WIFI, false))
2829
fun enableMobile(project: Project) = executeOnDevice(project, ToggleSvcCommand(MOBILE, true))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package com.developerphil.adbidea.adb.command
22

3-
class ClearDataAndRestartCommand : CommandList(ClearDataCommand(), StartDefaultActivityCommand(false))
3+
class ClearDataAndRestartCommand : CommandList(ClearDataCommand(), StartDefaultActivityCommand(false))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.developerphil.adbidea.adb.command
2+
3+
class ClearDataAndRestartWithDebuggerCommand : CommandList(ClearDataCommand(), StartDefaultActivityCommand(true))

src/main/resources/META-INF/plugin.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@
201201
text="ADB Restart App With Debugger"
202202
description="Restarts the current application and attach the debugger">
203203
</action>
204+
205+
<action id="com.developerphil.adbidea.action.ClearDataAndRestartWithDebuggerAction"
206+
class="com.developerphil.adbidea.action.ClearDataAndRestartWithDebuggerAction"
207+
text="ADB Clear App Data and Restart App With Debugger"
208+
description="Clears the private storage of the app and restarts it, and attach the debugger">
209+
</action>
204210
<add-to-group group-id="AndroidToolsGroup" anchor="first"/>
205211
<separator/>
206212

0 commit comments

Comments
 (0)