import { AbilityConstant, AbilityStage, Configuration, Want } from "@kit.AbilityKit";
import { StringUtils } from "../util/StringUtils";
import { hilog } from "@kit.PerformanceAnalysisKit";
import { AppCache } from "./AppCache";
import { UserCache } from "./UserCache";
// import { tdvision } from "@kit.TdosVisionKit";

export class RuanseeAbilityStag  extends AbilityStage{
  public static appCache:AppCache;
  public static userCache:UserCache;


  onCreate(): void {
    hilog.info(0x0000, 'RuanseeAbitityStag', '%{public}s', 'AbilityStage onCreate()');
    RuanseeAbilityStag.appCache = AppCache.getAppCache();
    RuanseeAbilityStag.appCache.setIpOrPort("20.90.2.2", "80","/pcenter_app_out/");
    RuanseeAbilityStag.userCache = UserCache.getUserCache();
    // tdvision.setup()
  }

  onAcceptWant(want: Want): string {
    hilog.info(0x0000, 'RuanseeAbitityStag', '%{public}s', 'AbilityStage onAcceptWant()');
    return StringUtils.get(want.abilityName,"");

  }

  onNewProcessRequest(want: Want): string {
    hilog.info(0x0000, 'RuanseeAbitityStag', '%{public}s', 'AbilityStage onNewProcessRequest()');
    return StringUtils.get(want.abilityName,"");

  }

  onMemoryLevel(level: AbilityConstant.MemoryLevel): void {
    hilog.info(0x0000, 'RuanseeAbitityStag', '%{public}s', 'AbilityStage onMemoryLevel()');

  }

  onConfigurationUpdate(newConfig: Configuration): void {
    hilog.info(0x0000, 'RuanseeAbitityStag', '%{public}s', 'AbilityStage onConfigurationUpdate()');

  }

}