• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package android.processor.property_cache.test;
17 
18 import android.os.IpcDataCache;
19 
20 /**
21  * This class is auto-generated
22  *
23  * @hide
24  **/
25 public class CustomCache {
26     private static final Object sBirthdayLock = new Object();
27     private static IpcDataCache<java.lang.Integer, java.util.Date> sBirthday;
28 
29 
30     /**
31      * This method is auto-generated
32      *
33      * @param binderCall      - lambda for remote call
34      *                        {@link  android.processor.property_cache.test.Custom#getBirthday }
35      * @param bypassPredicate - lambda to bypass remote call
36      * @param query           - parameter to call remote lambda
37      * @hide
38      */
getBirthday( IpcDataCache.RemoteCall<java.lang.Integer, java.util.Date> binderCall, IpcDataCache.BypassCall<java.lang.Integer> bypassPredicate, java.lang.Integer query)39     public static java.util.Date getBirthday(
40             IpcDataCache.RemoteCall<java.lang.Integer, java.util.Date> binderCall,
41             IpcDataCache.BypassCall<java.lang.Integer> bypassPredicate, java.lang.Integer query) {
42         if (sBirthday != null) {
43             return sBirthday.query(query);
44         }
45         synchronized (sBirthdayLock) {
46             if (sBirthday == null) {
47                 sBirthday = new IpcDataCache(
48                         new IpcDataCache.Config(4, "bluetooth", "custom_birthday", "Birthday"),
49                         binderCall, bypassPredicate);
50 
51             }
52         }
53         return sBirthday.query(query);
54     }
55 
56     /**
57      * This method is auto-generated
58      *
59      * @param binderCall - lambda for remote call
60      *                   {@link  android.processor.property_cache.test.Custom#getBirthday }
61      * @param query      - parameter to call remote lambda
62      * @hide
63      */
getBirthday( IpcDataCache.RemoteCall<java.lang.Integer, java.util.Date> binderCall, java.lang.Integer query)64     public static java.util.Date getBirthday(
65             IpcDataCache.RemoteCall<java.lang.Integer, java.util.Date> binderCall,
66             java.lang.Integer query) {
67         if (sBirthday != null) {
68             return sBirthday.query(query);
69         }
70         synchronized (sBirthdayLock) {
71             if (sBirthday == null) {
72                 sBirthday = new IpcDataCache(
73                         new IpcDataCache.Config(4, "bluetooth", "custom_birthday", "Birthday"),
74                         binderCall);
75             }
76         }
77         return sBirthday.query(query);
78     }
79 
80     /**
81      * This method is auto-generated- invalidate cache for
82      * {@link  android.processor.property_cache.test.Custom#getBirthday}
83      *
84      * @hide
85      */
invalidateBirthday()86     public static final void invalidateBirthday() {
87         IpcDataCache.invalidateCache("bluetooth", "custom_birthday");
88     }
89 
90     private static final Object sDaysTillBirthdayLock = new Object();
91     private static IpcDataCache<java.lang.Integer, java.lang.Integer> sDaysTillBirthday;
92 
93 
94     /**
95      * This method is auto-generated
96      *
97      * @param binderCall      - lambda for remote call
98      *                        {@link
99      *                        android.processor.property_cache.test.Custom#getDaysTillBirthday }
100      * @param bypassPredicate - lambda to bypass remote call
101      * @param query           - parameter to call remote lambda
102      * @hide
103      */
getDaysTillBirthday( IpcDataCache.RemoteCall<java.lang.Integer, java.lang.Integer> binderCall, IpcDataCache.BypassCall<java.lang.Integer> bypassPredicate, java.lang.Integer query)104     public static java.lang.Integer getDaysTillBirthday(
105             IpcDataCache.RemoteCall<java.lang.Integer, java.lang.Integer> binderCall,
106             IpcDataCache.BypassCall<java.lang.Integer> bypassPredicate, java.lang.Integer query) {
107         if (sDaysTillBirthday != null) {
108             return sDaysTillBirthday.query(query);
109         }
110         synchronized (sDaysTillBirthdayLock) {
111             if (sDaysTillBirthday == null) {
112                 sDaysTillBirthday = new IpcDataCache(
113                         new IpcDataCache.Config(4, "bluetooth", "custom_days_till_birthday",
114                                 "DaysTillBirthday"), binderCall, bypassPredicate);
115 
116             }
117         }
118         return sDaysTillBirthday.query(query);
119     }
120 
121 
122     /**
123      * This method is auto-generated
124      *
125      * @param binderCall - lambda for remote call
126      *                   {@link  android.processor.property_cache.test.Custom#getDaysTillBirthday }
127      * @param query      - parameter to call remote lambda
128      * @hide
129      */
getDaysTillBirthday( IpcDataCache.RemoteCall<java.lang.Integer, java.lang.Integer> binderCall, java.lang.Integer query)130     public static java.lang.Integer getDaysTillBirthday(
131             IpcDataCache.RemoteCall<java.lang.Integer, java.lang.Integer> binderCall,
132             java.lang.Integer query) {
133         if (sDaysTillBirthday != null) {
134             return sDaysTillBirthday.query(query);
135         }
136         synchronized (sDaysTillBirthdayLock) {
137             if (sDaysTillBirthday == null) {
138                 sDaysTillBirthday = new IpcDataCache(
139                         new IpcDataCache.Config(4, "bluetooth", "custom_days_till_birthday",
140                                 "DaysTillBirthday"), binderCall);
141 
142             }
143         }
144         return sDaysTillBirthday.query(query);
145     }
146 
147     /**
148      * This method is auto-generated- invalidate cache for
149      * {@link  android.processor.property_cache.test.Custom#getDaysTillBirthday}
150      *
151      * @hide
152      */
invalidateDaysTillBirthday()153     public static final void invalidateDaysTillBirthday() {
154         IpcDataCache.invalidateCache("bluetooth", "custom_days_till_birthday");
155     }
156 
157     private final Object mDaysSinceBirthdayLock = new Object();
158     private IpcDataCache<java.lang.Integer, java.lang.Integer> mDaysSinceBirthday;
159 
160 
161     /**
162      * This method is auto-generated
163      *
164      * @param binderCall      - lambda for remote call
165      *                        {@link
166      *                        android.processor.property_cache.test.Custom#getDaysSinceBirthday }
167      * @param bypassPredicate - lambda to bypass remote call
168      * @param query           - parameter to call remote lambda
169      * @hide
170      */
getDaysSinceBirthday( IpcDataCache.RemoteCall<java.lang.Integer, java.lang.Integer> binderCall, IpcDataCache.BypassCall<java.lang.Integer> bypassPredicate, java.lang.Integer query)171     public java.lang.Integer getDaysSinceBirthday(
172             IpcDataCache.RemoteCall<java.lang.Integer, java.lang.Integer> binderCall,
173             IpcDataCache.BypassCall<java.lang.Integer> bypassPredicate, java.lang.Integer query) {
174         if (mDaysSinceBirthday != null) {
175             return mDaysSinceBirthday.query(query);
176         }
177         synchronized (mDaysSinceBirthdayLock) {
178             if (mDaysSinceBirthday == null) {
179                 mDaysSinceBirthday = new IpcDataCache(
180                         new IpcDataCache.Config(4, "bluetooth", "custom_days_since_birthday",
181                                 "DaysSinceBirthday"), binderCall, bypassPredicate);
182 
183             }
184         }
185         return mDaysSinceBirthday.query(query);
186     }
187 
188 
189     /**
190      * This method is auto-generated
191      *
192      * @param binderCall - lambda for remote call
193      *                   {@link  android.processor.property_cache.test.Custom#getDaysSinceBirthday
194      *                   }
195      * @param query      - parameter to call remote lambda
196      * @hide
197      */
getDaysSinceBirthday( IpcDataCache.RemoteCall<java.lang.Integer, java.lang.Integer> binderCall, java.lang.Integer query)198     public java.lang.Integer getDaysSinceBirthday(
199             IpcDataCache.RemoteCall<java.lang.Integer, java.lang.Integer> binderCall,
200             java.lang.Integer query) {
201         if (mDaysSinceBirthday != null) {
202             return mDaysSinceBirthday.query(query);
203         }
204         synchronized (mDaysSinceBirthdayLock) {
205             if (mDaysSinceBirthday == null) {
206                 mDaysSinceBirthday = new IpcDataCache(
207                         new IpcDataCache.Config(4, "bluetooth", "custom_days_since_birthday",
208                                 "DaysSinceBirthday"), binderCall);
209 
210             }
211         }
212         return mDaysSinceBirthday.query(query);
213     }
214 
215     /**
216      * This method is auto-generated- invalidate cache for
217      * {@link  android.processor.property_cache.test.Custom#getDaysSinceBirthday}
218      *
219      * @hide
220      */
invalidateDaysSinceBirthday()221     public static final void invalidateDaysSinceBirthday() {
222         IpcDataCache.invalidateCache("bluetooth", "custom_days_since_birthday");
223     }
224 
225     private static final Object sDaysTillMyBirthdayLock = new Object();
226     private static IpcDataCache<java.lang.Void, java.lang.Integer> sDaysTillMyBirthday;
227 
228 
229     /**
230      * This method is auto-generated
231      *
232      * @param binderCall - lambda for remote call
233      *                   {@link  android.processor.property_cache.test.Custom#getDaysTillMyBirthday
234      *                   }
235      * @hide
236      */
getDaysTillMyBirthday( IpcDataCache.RemoteCall<java.lang.Void, java.lang.Integer> binderCall)237     public static java.lang.Integer getDaysTillMyBirthday(
238             IpcDataCache.RemoteCall<java.lang.Void, java.lang.Integer> binderCall) {
239         if (sDaysTillMyBirthday != null) {
240             return sDaysTillMyBirthday.query(null);
241         }
242         synchronized (sDaysTillMyBirthdayLock) {
243             if (sDaysTillMyBirthday == null) {
244                 sDaysTillMyBirthday = new IpcDataCache(
245                         new IpcDataCache.Config(1, "bluetooth", "custom_days_till_my_birthday",
246                                 "DaysTillMyBirthday"), binderCall);
247 
248             }
249         }
250         return sDaysTillMyBirthday.query(null);
251     }
252 
253     /**
254      * This method is auto-generated- invalidate cache for
255      * {@link  android.processor.property_cache.test.Custom#getDaysTillMyBirthday}
256      *
257      * @hide
258      */
invalidateDaysTillMyBirthday()259     public static final void invalidateDaysTillMyBirthday() {
260         IpcDataCache.invalidateCache("bluetooth", "custom_days_till_my_birthday");
261     }
262 
263     private final Object mDaysSinceMyBirthdayLock = new Object();
264     private IpcDataCache<java.lang.Void, java.lang.Integer> mDaysSinceMyBirthday;
265 
266 
267     /**
268      * This method is auto-generated
269      *
270      * @param binderCall - lambda for remote call
271      *                   {@link  android.processor.property_cache.test.Custom#getDaysSinceMyBirthday
272      *                   }
273      * @hide
274      */
getDaysSinceMyBirthday( IpcDataCache.RemoteCall<java.lang.Void, java.lang.Integer> binderCall)275     public java.lang.Integer getDaysSinceMyBirthday(
276             IpcDataCache.RemoteCall<java.lang.Void, java.lang.Integer> binderCall) {
277         if (mDaysSinceMyBirthday != null) {
278             return mDaysSinceMyBirthday.query(null);
279         }
280         synchronized (mDaysSinceMyBirthdayLock) {
281             if (mDaysSinceMyBirthday == null) {
282                 mDaysSinceMyBirthday = new IpcDataCache(
283                         new IpcDataCache.Config(1, "bluetooth", "my_unique_key",
284                                 "DaysSinceMyBirthday"), binderCall);
285 
286             }
287         }
288         return mDaysSinceMyBirthday.query(null);
289     }
290 
291     /**
292      * This method is auto-generated- invalidate cache for
293      * {@link  android.processor.property_cache.test.Custom#getDaysSinceMyBirthday}
294      *
295      * @hide
296      */
invalidateDaysSinceMyBirthday()297     public static final void invalidateDaysSinceMyBirthday() {
298         IpcDataCache.invalidateCache("bluetooth", "my_unique_key");
299     }
300 
301     private static final Object sBirthdayWishesFromUserLock = new Object();
302     private static IpcDataCache<java.lang.Integer, java.lang.String> sBirthdayWishesFromUser;
303 
304 
305     /**
306      * This method is auto-generated
307      *
308      * @param binderCall      - lambda for remote call
309      *                        {@link
310      *                        android.processor.property_cache.test.Custom#getBirthdayWishesFromUser
311      *                        }
312      * @param bypassPredicate - lambda to bypass remote call
313      * @param query           - parameter to call remote lambda
314      * @hide
315      */
getBirthdayWishesFromUser( IpcDataCache.RemoteCall<java.lang.Integer, java.lang.String> binderCall, IpcDataCache.BypassCall<java.lang.Integer> bypassPredicate, java.lang.Integer query)316     public static java.lang.String getBirthdayWishesFromUser(
317             IpcDataCache.RemoteCall<java.lang.Integer, java.lang.String> binderCall,
318             IpcDataCache.BypassCall<java.lang.Integer> bypassPredicate, java.lang.Integer query) {
319         if (sBirthdayWishesFromUser != null) {
320             return sBirthdayWishesFromUser.query(query);
321         }
322         synchronized (sBirthdayWishesFromUserLock) {
323             if (sBirthdayWishesFromUser == null) {
324                 sBirthdayWishesFromUser = new IpcDataCache(
325                         new IpcDataCache.Config(4, "telephony", "custom_birthday_wishes_from_user",
326                                 "BirthdayWishesFromUser"), binderCall, bypassPredicate);
327 
328             }
329         }
330         return sBirthdayWishesFromUser.query(query);
331     }
332 
333 
334     /**
335      * This method is auto-generated
336      *
337      * @param binderCall - lambda for remote call
338      *                   {@link
339      *                   android.processor.property_cache.test.Custom#getBirthdayWishesFromUser }
340      * @param query      - parameter to call remote lambda
341      * @hide
342      */
getBirthdayWishesFromUser( IpcDataCache.RemoteCall<java.lang.Integer, java.lang.String> binderCall, java.lang.Integer query)343     public static java.lang.String getBirthdayWishesFromUser(
344             IpcDataCache.RemoteCall<java.lang.Integer, java.lang.String> binderCall,
345             java.lang.Integer query) {
346         if (sBirthdayWishesFromUser != null) {
347             return sBirthdayWishesFromUser.query(query);
348         }
349         synchronized (sBirthdayWishesFromUserLock) {
350             if (sBirthdayWishesFromUser == null) {
351                 sBirthdayWishesFromUser = new IpcDataCache(
352                         new IpcDataCache.Config(4, "telephony", "custom_birthday_wishes_from_user",
353                                 "BirthdayWishesFromUser"), binderCall);
354 
355             }
356         }
357         return sBirthdayWishesFromUser.query(query);
358     }
359 
360     /**
361      * This method is auto-generated- invalidate cache for
362      * {@link  android.processor.property_cache.test.Custom#getBirthdayWishesFromUser}
363      *
364      * @hide
365      */
invalidateBirthdayWishesFromUser()366     public static final void invalidateBirthdayWishesFromUser() {
367         IpcDataCache.invalidateCache("telephony", "custom_birthday_wishes_from_user");
368     }
369 
370 
371     /**
372      * This method is auto-generated - initialise all caches for class CustomCache
373      *
374      * @hide
375      */
initCache()376     public static void initCache() {
377         CustomCache.invalidateBirthday();
378         CustomCache.invalidateDaysTillBirthday();
379         CustomCache.invalidateDaysSinceBirthday();
380         CustomCache.invalidateDaysTillMyBirthday();
381         CustomCache.invalidateDaysSinceMyBirthday();
382         CustomCache.invalidateBirthdayWishesFromUser();
383     }
384 }
385