コード例 #1
0
ファイル: SyncClient.cs プロジェクト: yunmiha/TizenFX
        /// <summary>
        /// Requests the sync manager to perform periodic sync operations.
        /// </summary>
        /// <since_tizen> 4 </since_tizen>
        /// <param name="request"> The sync job information of the sync job request. </param>
        /// <param name="period"> Determines the time interval of the periodic sync. The periodic sync operation can be triggered in that interval, but it does not guarantee the exact time. The minimum value is 30 minutes. </param>
        /// <param name="syncOptions"> Sync options determine a way to operate the sync job and can be used as ORing. </param>
        /// <privilege>http://tizen.org/privilege/alarm.set</privilege>
        /// <exception cref="UnauthorizedAccessException"> In case of a privilege not defined. </exception>
        /// <exception cref="ArgumentNullException"> Thrown when any of the arguments are null. </exception>
        /// <exception cref="InvalidOperationException"> Thrown when the application calling this API doesn't have a sync adapter. </exception>
        /// <returns> A unique value which can manage sync jobs. The number of sync job IDs is limited as it is less than hundred. </returns>
        public static int AddPeriodicSyncJob(SyncJobData request, SyncPeriod period, SyncOption syncOptions)
        {
            if (request == null || request.SyncJobName == null)
            {
                throw new ArgumentNullException();
            }

            SafeAccountHandle accountHandle = (request.Account != null) ? request.Account.SafeAccountHandle : new SafeAccountHandle();
            SafeBundleHandle  bundleHandle  = (request.UserData != null) ? request.UserData.SafeBundleHandle : new SafeBundleHandle();

            int id  = 0;
            int ret = Interop.Manager.AddPeriodicSyncJob(accountHandle, request.SyncJobName, (int)period, (int)syncOptions, bundleHandle, out id);

            if (ret != (int)SyncManagerErrorCode.None)
            {
                Log.Error(ErrorFactory.LogTag, "Failed to add periodic sync job");
                throw ErrorFactory.GetException(ret);
            }
            return(id);
        }
コード例 #2
0
 internal static extern int SetAccountDomainName(SafeAccountHandle handle, string domainName);
コード例 #3
0
 internal static extern int GetAccountSercet(SafeAccountHandle handle, out int secretType);
コード例 #4
0
 internal static extern int AddDataChangeSyncJob(SafeAccountHandle account, string syncCapability, int syncOption, SafeBundleHandle syncJobUserData, out int syncJobId);
コード例 #5
0
 internal static extern int RequestOnDemandSyncJob(SafeAccountHandle account, string syncJobName, int syncOption, SafeBundleHandle syncJobUserData, out int syncJobId);
コード例 #6
0
 internal static extern int QueryAccountById(int accountId, ref SafeAccountHandle handle);
コード例 #7
0
 internal static extern int SetAccountUserInt(SafeAccountHandle handle, int index, int value);
コード例 #8
0
 internal static extern int SetAccountAccessToken(SafeAccountHandle handle, string accessToken);
コード例 #9
0
 internal static extern int Create(out SafeAccountHandle handle);
コード例 #10
0
 internal static extern int GetAllAccountCustomValues(SafeAccountHandle handle, AccountCustomCallback callback, IntPtr userData);
コード例 #11
0
 internal static extern int GetAllAccountCapabilities(SafeAccountHandle handle, AccountCapabilityCallback callback, IntPtr userData);
コード例 #12
0
 internal static extern int SetAccountCustomValue(SafeAccountHandle handle, string key, string value);
コード例 #13
0
 internal static extern int SetAccountSource(SafeAccountHandle handle, string source);
コード例 #14
0
 internal static extern int SetAccountSyncSupport(SafeAccountHandle handle, int syncType);
コード例 #15
0
 internal static extern int SetAccountSecret(SafeAccountHandle handle, int secretType);
コード例 #16
0
 internal static extern int SetAccountEmail(SafeAccountHandle handle, string email);
コード例 #17
0
 internal static extern int SetAccountPackageName(SafeAccountHandle handle, string name);
コード例 #18
0
 internal static extern int GetAccountId(SafeAccountHandle data, out int accountId);
コード例 #19
0
 internal static extern int SetAccountUserText(SafeAccountHandle handle, int index, string userText);
コード例 #20
0
 internal static extern int GetAccountUserName(SafeAccountHandle data, out string userName);
コード例 #21
0
 internal static extern int UpdateAccountToDBById(SafeAccountHandle handle, int id);
コード例 #22
0
 internal static extern int SetAccountUserName(SafeAccountHandle handle, string userName);
コード例 #23
0
 internal static extern int AddAccount(SafeAccountHandle handle, out int accountId);
コード例 #24
0
 internal static extern int SetAccountDisplayName(SafeAccountHandle handle, string displayName);
コード例 #25
0
 internal static extern int AddPeriodicSyncJob(SafeAccountHandle account, string syncJobName, int syncPeriod, int syncOption, SafeBundleHandle syncJobUserData, out int syncJobId);
コード例 #26
0
 internal static extern int SetAccountCapability(SafeAccountHandle handle, string capabilityType, int capabilityValue);
コード例 #27
0
 internal static extern int SetAccountIconPath(SafeAccountHandle handle, string iconPath);
コード例 #28
0
 internal static extern int SetAccountAuthType(SafeAccountHandle handle, int authType);