Browse Source

channelBackup, channelRestore tested

Yuping Liang 1 year ago
parent
commit
171e6d5497
2 changed files with 9 additions and 22 deletions
  1. 2 2
      app/build.gradle
  2. 7 20
      app/src/main/java/com/tcl/customerapi/IService.java

+ 2 - 2
app/build.gradle

@@ -18,8 +18,8 @@ android {
         applicationId "com.tcl.customerapi"
         minSdkVersion 29
         targetSdkVersion 29
-        versionCode 1101
-        versionName "1.1.01"
+        versionCode 1102
+        versionName "1.1.02"
 
         multiDexEnabled true
     }

+ 7 - 20
app/src/main/java/com/tcl/customerapi/IService.java

@@ -2,7 +2,6 @@ package com.tcl.customerapi;
 
 import android.app.Instrumentation;
 import android.content.ComponentName;
-import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
@@ -27,7 +26,6 @@ import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
 
 import com.tcl.appassistsdk.appupdate.AppUpdateManager;
-import com.tcl.device.authentication.SqlCommon;
 import com.tcl.deviceinfo.TDeviceInfo;
 import com.tcl.factory.FactoryManager;
 import com.tcl.factory.bsp.TCL;
@@ -267,7 +265,6 @@ public class IService extends android.app.Service {
 
         @Override
         public int getCurrentTVChannel() {
-
             int channel = ThirdParty.getCurrentChannelNumber();
             Log.i(TAG, "getCurrentTVChannel  " + channel);
             return channel;
@@ -592,24 +589,23 @@ public class IService extends android.app.Service {
         @Override
         public void channelBackup(String value) {
             Log.i(TAG, "channelBackup   path  " + value);
-            TvManager.getInstance(ctx).getProperty().set("memory.factory.hotel.userpath", value);
-
             if (null == value || ("".equals(value))) {
                 ThirdParty.mContext.sendBroadcast(new Intent(defs.MSG_NO_USB_MOUNT));
                 return;
             }
+            TvManager.getInstance(ctx).getProperty().set("memory.factory.hotel.userpath", value);
             ThirdParty.NVM2USB_ChannelDate(1);
         }
 
         @Override
         public void channelRestore(String value) {
             Log.i(TAG, "channelBackup   path  " + value);
-            TvManager.getInstance(ctx).getProperty().set("memory.factory.hotel.userpath", value);
             if (null == value || ("".equals(value))) {
                 Intent intent = new Intent(defs.MSG_NO_USB_MOUNT);
                 ThirdParty.mContext.sendBroadcast(intent);
                 return;
             }
+            TvManager.getInstance(ctx).getProperty().set("memory.factory.hotel.userpath", value);
             ThirdParty.USB2NVM_ChannelDate(1);
         }
 
@@ -1252,13 +1248,11 @@ public class IService extends android.app.Service {
         @Override
         public boolean channelData2System(String path) {
             Log.i(TAG, "channelData2System  " + path);
-            ThirdParty.setRootSeek("tclsu");
-
-            ThirdParty.setRootSeek("cp /" + path + "/AtvData.db  " + "/userdata/AtvData.db");
-            ThirdParty.setRootSeek("cp /" + path + "/DtvData.db  " + "/userdata/DtvData.db");
+            ThirdParty.setRootSeek("cp -f /" + path + "/AtvData.db /userdata/AtvData.db");
+            ThirdParty.setRootSeek("cp -f /" + path + "/DtvData.db /userdata/DtvData.db");
 
-            ThirdParty.setRootSeek("chmod 666  " + "/userdata/AtvData.db");
-            ThirdParty.setRootSeek("chmod 666  " + "/userdata/DtvData.db");
+            ThirdParty.setRootSeek("chmod 666 " + "/userdata/AtvData.db");
+            ThirdParty.setRootSeek("chmod 666 " + "/userdata/DtvData.db");
             ThirdParty.setRootSeek("sync");
             return true;
         }
@@ -1505,8 +1499,6 @@ public class IService extends android.app.Service {
 
         @Override
         public void clearPatchBootanimation() {
-            ThirdParty.setRootSeek("rm -rf " + defs.USER_LOGO + defs.ADBOOTANIMATION);
-            ThirdParty.setRootSeek("rm -rf " + defs.USER_LOGO + defs.ANIMTTEMPLET);
         }
 
         @Override
@@ -1636,11 +1628,6 @@ public class IService extends android.app.Service {
 
         @Override
         public boolean setScreenOrientation(int value) {
-            Log.i(TAG, "setScreenOrientation  " + value);
-            if (value == 0 || value == 90 || value == 180 || value == 270) {
-                SystemProperties.set(defs.PERSIST_SYS_ROTATE, value + "");
-                return true;
-            }
             return false;
         }
 
@@ -2156,7 +2143,7 @@ public class IService extends android.app.Service {
 
                         if (FileUtil.isFile(defs.userBootanimation)) {
                             Log.i(TAG, "start copy userBootanimation");
-                            ThirdParty.setLogoApi(handlePathStr(defs.LOGO_FILE_PATH));
+                            ThirdParty.setLogoApi(defs.LOGO_FILE_PATH);
                             ThirdParty.setUserBootAnimation(defs.LOGO_FILE_PATH);
                             myIBinder.setPowerOnAdbootanimation(defs.LOGO_FILE_PATH + "adbootanimation.zip");
                             myIBinder.setPowerOnAnimtemplet(defs.LOGO_FILE_PATH + "animtemplet.zip");