Skip to content

Commit 084ff4d

Browse files
committed
Merge pull request #907 from NativeScript/totev/delayed-restart
Remove obsoleted code
2 parents d97d99b + 5c3d5e8 commit 084ff4d

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

lib/services/usb-livesync-service.ts

+4-11
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
1313
"app_resources"
1414
];
1515

16-
constructor(private $commandsService: ICommandsService,
17-
$devicesServices: Mobile.IDevicesServices,
16+
constructor($devicesServices: Mobile.IDevicesServices,
1817
$fs: IFileSystem,
1918
$mobileHelper: Mobile.IMobileHelper,
2019
$localToDevicePathDataFactory: Mobile.ILocalToDevicePathDataFactory,
@@ -42,10 +41,10 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
4241
let platformLowerCase = platform ? platform.toLowerCase() : null;
4342
let platformData = this.$platformsData.getPlatformData(platformLowerCase);
4443

45-
if(platformLowerCase === this.$devicePlatformsConstants.Android.toLowerCase()) {
44+
if (platformLowerCase === this.$devicePlatformsConstants.Android.toLowerCase()) {
4645
this.$projectDataService.initialize(this.$projectData.projectDir);
4746
let frameworkVersion = this.$projectDataService.getValue(platformData.frameworkPackageName).wait().version;
48-
if(semver.lt(frameworkVersion, "1.2.1")) {
47+
if (semver.lt(frameworkVersion, "1.2.1")) {
4948
let shouldUpdate = this.$prompter.confirm(
5049
"You need Android Runtime 1.2.1 or later for LiveSync to work properly. Do you want to update your runtime now?"
5150
).wait();
@@ -61,11 +60,6 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
6160

6261
let projectFilesPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME);
6362

64-
let restartAppOnDeviceAction = (device: Mobile.IDevice, deviceAppData: Mobile.IDeviceAppData, localToDevicePaths?: Mobile.ILocalToDevicePathData[]): IFuture<void> => {
65-
let platformSpecificUsbLiveSyncService = this.resolveUsbLiveSyncService(platform || this.$devicesServices.platform, device);
66-
return platformSpecificUsbLiveSyncService.restartApplication(deviceAppData, localToDevicePaths);
67-
};
68-
6963
let notInstalledAppOnDeviceAction = (device: Mobile.IDevice): IFuture<void> => {
7064
return this.$platformService.deployOnDevice(platform);
7165
};
@@ -76,7 +70,7 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
7670

7771
let beforeLiveSyncAction = (device: Mobile.IDevice, deviceAppData: Mobile.IDeviceAppData): IFuture<void> => {
7872
let platformSpecificUsbLiveSyncService = this.resolveUsbLiveSyncService(platform || this.$devicesServices.platform, device);
79-
if(platformSpecificUsbLiveSyncService.beforeLiveSyncAction) {
73+
if (platformSpecificUsbLiveSyncService.beforeLiveSyncAction) {
8074
return platformSpecificUsbLiveSyncService.beforeLiveSyncAction(deviceAppData);
8175
}
8276
return Future.fromResult();
@@ -109,7 +103,6 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
109103
this.excludedProjectDirsAndFiles,
110104
watchGlob,
111105
platformSpecificLiveSyncServices,
112-
restartAppOnDeviceAction,
113106
notInstalledAppOnDeviceAction,
114107
notRunningiOSSimulatorAction,
115108
localProjectRootPath,

0 commit comments

Comments
 (0)