|
|
|
@ -5,17 +5,24 @@ import android.content.ComponentName; |
|
|
|
import android.content.Context; |
|
|
|
import android.content.Intent; |
|
|
|
import android.graphics.Bitmap; |
|
|
|
import android.graphics.Rect; |
|
|
|
import android.net.Uri; |
|
|
|
import android.os.Build; |
|
|
|
import android.os.RemoteException; |
|
|
|
import android.os.signwaymanager.SignwayManager; |
|
|
|
import android.util.Log; |
|
|
|
import android.os.Build.VERSION; |
|
|
|
import android.view.View; |
|
|
|
|
|
|
|
import androidx.core.content.FileProvider; |
|
|
|
|
|
|
|
import com.sdkapi.api.SdkApi; |
|
|
|
import com.sdkapi.common.ResultCallback; |
|
|
|
import com.sdkapi.common.ResultInfo; |
|
|
|
import com.tclsy.extmanager.device.TDeviceManager; |
|
|
|
import com.tclsy.extmanager.installer.TInstallerManager; |
|
|
|
import com.tclsy.extmanager.installer.callback.PackageStatusListener; |
|
|
|
import com.tclsy.extmanager.power.TPowerManager; |
|
|
|
import com.ys.rkapi.MyManager; |
|
|
|
import com.zcapi; |
|
|
|
|
|
|
|
@ -65,6 +72,12 @@ public class SignWayUtil { |
|
|
|
}else if(Constant.androidBoardType.equals("huidu")){ |
|
|
|
HuiduTech helper = new HuiduTech(MyApplication.getInstance()); |
|
|
|
helper.shutdown(); |
|
|
|
}else if(Constant.androidBoardType.equals("tcl")){ |
|
|
|
try{ |
|
|
|
TPowerManager.getInstance().shutDown(); |
|
|
|
}catch (Exception e){ |
|
|
|
LoggerUtil.e("TCL:", e.getMessage()); |
|
|
|
} |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.shutdown"); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent); |
|
|
|
@ -105,6 +118,12 @@ public class SignWayUtil { |
|
|
|
}else if(Constant.androidBoardType.equals("huidu")){ |
|
|
|
HuiduTech helper = new HuiduTech(MyApplication.getInstance()); |
|
|
|
helper.reboot(); |
|
|
|
}else if(Constant.androidBoardType.equals("tcl")){ |
|
|
|
try{ |
|
|
|
TPowerManager.getInstance().reboot(); |
|
|
|
}catch (Exception e){ |
|
|
|
LoggerUtil.e("TCL:", e.getMessage()); |
|
|
|
} |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.reboot"); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent); |
|
|
|
@ -161,6 +180,18 @@ public class SignWayUtil { |
|
|
|
HuiduTech helper = new HuiduTech(MyApplication.getInstance()); |
|
|
|
helper.install(path); |
|
|
|
//helper.installAndStart(path,"qianmu.container","qianmu.container.activity.H5.UpdateFileActivity");
|
|
|
|
}else if(Constant.androidBoardType.equals("tcl")){ |
|
|
|
try{ |
|
|
|
TInstallerManager.getInstance().startActivityAfterInstall("qianmu.container","qianmu.container.activity.H5.UpdateFileActivity"); |
|
|
|
TInstallerManager.getInstance().installSilentApp(path, new PackageStatusListener() { |
|
|
|
@Override |
|
|
|
public void result(boolean b) { |
|
|
|
LoggerUtil.e("App更新:", String.valueOf(b)); |
|
|
|
} |
|
|
|
}); |
|
|
|
}catch (Exception e){ |
|
|
|
LoggerUtil.e("TCL:", e.getMessage()); |
|
|
|
} |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.apkinstall"); |
|
|
|
intent.putExtra("path", path); |
|
|
|
@ -280,6 +311,11 @@ public class SignWayUtil { |
|
|
|
Intent intent2 = new Intent("android.poweroff.cancel"); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent1); |
|
|
|
MyApplication.getInstance().sendBroadcast(intent2); |
|
|
|
}else if(Constant.androidBoardType.equals("tcl")){ |
|
|
|
// boolean isAlarmEnable = TPowerManager.getInstance().isAlarmEnable();
|
|
|
|
// if(isAlarmEnable){
|
|
|
|
// TPowerManager.getInstance().deleteAlarm();
|
|
|
|
// }
|
|
|
|
}else if(Constant.androidBoardType.equals("zc")){ |
|
|
|
int[] timeoffArray = {1970, 1, 1, 0, 0}; |
|
|
|
int[] timeonArray = {1970, 1, 1, 0, 0}; |
|
|
|
@ -322,6 +358,13 @@ public class SignWayUtil { |
|
|
|
}catch(Exception exp){ |
|
|
|
LoggerUtil.e("screenShot",exp.getMessage()); |
|
|
|
} |
|
|
|
}else if(Constant.androidBoardType.equals("tcl")){ |
|
|
|
final View decorView = MyApplication.getInstance().getCurrentActivity().getWindow().getDecorView(); |
|
|
|
Rect rect = new Rect(); |
|
|
|
decorView.getWindowVisibleDisplayFrame(rect); |
|
|
|
int w = rect.width(); |
|
|
|
int h = rect.height(); |
|
|
|
TDeviceManager.getInstance().screenShot(path,0,0, w, h, w, h); |
|
|
|
}else if(Constant.androidBoardType.equals("ctf")){ |
|
|
|
Intent intent = new Intent("android.intent.action.screenshoot"); |
|
|
|
intent.putExtra("path", path); |
|
|
|
|