Home
last modified time | relevance | path

Searched refs:context (Results 1 – 25 of 607) sorted by relevance

12345678910>>...25

/developers/build/prebuilts/gradle/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/settings/
DMyPreferences.kt31 private fun getPrefs(context: Context): SharedPreferences { in getPrefs()
32 … return context.applicationContext.getSharedPreferences(SHARED_PREF_KEY, Context.MODE_PRIVATE) in getPrefs()
38 fun isResponseAuth(context: Context): Boolean { in isResponseAuth()
39 return getPrefs(context).getBoolean(RESPONSE_AUTH_KEY, false) in isResponseAuth()
42 fun setResponseAuth(context: Context, responseAuth: Boolean) { in setResponseAuth()
43 getPrefs(context).edit().putBoolean(RESPONSE_AUTH_KEY, responseAuth).apply() in setResponseAuth()
49 fun isDatasetAuth(context: Context): Boolean { in isDatasetAuth()
50 return getPrefs(context).getBoolean(DATASET_AUTH_KEY, false) in isDatasetAuth()
53 fun setDatasetAuth(context: Context, datasetAuth: Boolean) { in setDatasetAuth()
54 getPrefs(context).edit().putBoolean(DATASET_AUTH_KEY, datasetAuth).apply() in setDatasetAuth()
[all …]
/developers/samples/android/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/settings/
DMyPreferences.kt31 private fun getPrefs(context: Context): SharedPreferences { in getPrefs()
32 … return context.applicationContext.getSharedPreferences(SHARED_PREF_KEY, Context.MODE_PRIVATE) in getPrefs()
38 fun isResponseAuth(context: Context): Boolean { in isResponseAuth()
39 return getPrefs(context).getBoolean(RESPONSE_AUTH_KEY, false) in isResponseAuth()
42 fun setResponseAuth(context: Context, responseAuth: Boolean) { in setResponseAuth()
43 getPrefs(context).edit().putBoolean(RESPONSE_AUTH_KEY, responseAuth).apply() in setResponseAuth()
49 fun isDatasetAuth(context: Context): Boolean { in isDatasetAuth()
50 return getPrefs(context).getBoolean(DATASET_AUTH_KEY, false) in isDatasetAuth()
53 fun setDatasetAuth(context: Context, datasetAuth: Boolean) { in setDatasetAuth()
54 getPrefs(context).edit().putBoolean(DATASET_AUTH_KEY, datasetAuth).apply() in setDatasetAuth()
[all …]
/developers/samples/android/tv/ChannelsPrograms/Application/src/main/java/com/example/android/tv/channelsprograms/model/
DMockDatabase.java42 public static Subscription getTvShowSubscription(Context context) { in getTvShowSubscription() argument
45 context, in getTvShowSubscription()
57 public static Subscription getVideoSubscription(Context context) { in getVideoSubscription() argument
60 context, in getVideoSubscription()
72 public static Subscription getCatVideosSubscription(Context context) { in getCatVideosSubscription() argument
75 context, in getCatVideosSubscription()
82 Context context, in findOrCreateSubscription() argument
87 String title = context.getString(titleResource); in findOrCreateSubscription()
89 Subscription subscription = findSubscriptionByTitle(context, title); in findOrCreateSubscription()
96 context.getString(descriptionResource), in findOrCreateSubscription()
[all …]
/developers/build/prebuilts/gradle/Notifications/Wearable/src/main/java/com/example/android/support/wearable/notifications/
DNotificationPresets.java53 private static Notification.Builder buildBasicNotification(Context context) { in buildBasicNotification() argument
54 return new Notification.Builder(context) in buildBasicNotification()
55 .setContentTitle(context.getString(R.string.example_content_title)) in buildBasicNotification()
56 .setContentText(context.getString(R.string.example_content_text)) in buildBasicNotification()
58 .setContentIntent(PendingIntent.getActivity(context, 0, in buildBasicNotification()
59 new Intent(context, MainActivity.class), 0)) in buildBasicNotification()
69 public Notification buildNotification(Context context) { in buildNotification() argument
70 PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, in buildNotification()
71 new Intent(context, MainActivity.class), 0); in buildNotification()
73 Notification page2 = buildBasicNotification(context) in buildNotification()
[all …]
/developers/samples/android/deprecated/wearable/wear/Notifications/Wearable/src/main/java/com/example/android/support/wearable/notifications/
DNotificationPresets.java53 private static Notification.Builder buildBasicNotification(Context context) { in buildBasicNotification() argument
54 return new Notification.Builder(context) in buildBasicNotification()
55 .setContentTitle(context.getString(R.string.example_content_title)) in buildBasicNotification()
56 .setContentText(context.getString(R.string.example_content_text)) in buildBasicNotification()
58 .setContentIntent(PendingIntent.getActivity(context, 0, in buildBasicNotification()
59 new Intent(context, MainActivity.class), 0)) in buildBasicNotification()
69 public Notification buildNotification(Context context) { in buildNotification() argument
70 PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, in buildNotification()
71 new Intent(context, MainActivity.class), 0); in buildNotification()
73 Notification page2 = buildBasicNotification(context) in buildNotification()
[all …]
/developers/samples/android/input/autofill/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/datasource/
DSharedPrefsAutofillRepository.kt37 private fun getPrefs(context: Context): SharedPreferences { in <lambda>()
38 … return context.applicationContext.getSharedPreferences(SHARED_PREF_KEY, Context.MODE_PRIVATE) in <lambda>()
41 …override fun getFilledAutofillFieldCollection(context: Context, focusedAutofillHints: List<String>, in <lambda>()
45 val clientFormDataStringSet = getAllAutofillDataStringSet(context) in <lambda>()
71 …override fun saveFilledAutofillFieldCollection(context: Context, filledAutofillFieldCollection: Fi… in <lambda>()
72 val datasetName = "dataset-" + getDatasetNumber(context) in <lambda>()
74 val allAutofillData = getAllAutofillDataStringSet(context) in <lambda>()
77 saveAllAutofillDataStringSet(context, allAutofillData) in <lambda>()
78 incrementDatasetNumber(context) in <lambda>()
81 override fun clear(context: Context) { in <lambda>()
[all …]
/developers/build/prebuilts/gradle/AutofillFramework/kotlinApp/Application/src/main/java/com/example/android/autofillframework/multidatasetservice/datasource/
DSharedPrefsAutofillRepository.kt37 private fun getPrefs(context: Context): SharedPreferences { in <lambda>()
38 … return context.applicationContext.getSharedPreferences(SHARED_PREF_KEY, Context.MODE_PRIVATE) in <lambda>()
41 …override fun getFilledAutofillFieldCollection(context: Context, focusedAutofillHints: List<String>, in <lambda>()
45 val clientFormDataStringSet = getAllAutofillDataStringSet(context) in <lambda>()
71 …override fun saveFilledAutofillFieldCollection(context: Context, filledAutofillFieldCollection: Fi… in <lambda>()
72 val datasetName = "dataset-" + getDatasetNumber(context) in <lambda>()
74 val allAutofillData = getAllAutofillDataStringSet(context) in <lambda>()
77 saveAllAutofillDataStringSet(context, allAutofillData) in <lambda>()
78 incrementDatasetNumber(context) in <lambda>()
81 override fun clear(context: Context) { in <lambda>()
[all …]
/developers/samples/android/deprecated/wearable/wear/Notifications/Application/src/main/java/com/example/android/support/wearable/notifications/
DNotificationPresets.java70 private static NotificationCompat.Builder applyBasicOptions(Context context, in applyBasicOptions() argument
77 context, R.string.example_notification_deleted)); in applyBasicOptions()
78 options.actionsPreset.apply(context, builder, wearableOptions); in applyBasicOptions()
82 context.getResources(), R.drawable.example_large_icon)); in applyBasicOptions()
88 builder.setContentIntent(NotificationUtil.getExamplePendingIntent(context, in applyBasicOptions()
104 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument
105 NotificationCompat.Builder builder = new NotificationCompat.Builder(context); in buildNotifications()
108 applyBasicOptions(context, builder, wearableOptions, options); in buildNotifications()
121 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument
158 NotificationCompat.Builder builder = new NotificationCompat.Builder(context) in buildNotifications()
[all …]
DActionsPresets.java45 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
56 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
59 context.getString(R.string.example_action), in apply()
60 NotificationUtil.getExamplePendingIntent(context, in apply()
72 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
75 context.getString(R.string.example_action_long_title), in apply()
76 NotificationUtil.getExamplePendingIntent(context, in apply()
88 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
91 .setLabel(context.getString(R.string.example_reply_label)) in apply()
95 context.getString(R.string.example_reply_action), in apply()
[all …]
/developers/build/prebuilts/gradle/Notifications/Application/src/main/java/com/example/android/support/wearable/notifications/
DNotificationPresets.java70 private static NotificationCompat.Builder applyBasicOptions(Context context, in applyBasicOptions() argument
77 context, R.string.example_notification_deleted)); in applyBasicOptions()
78 options.actionsPreset.apply(context, builder, wearableOptions); in applyBasicOptions()
82 context.getResources(), R.drawable.example_large_icon)); in applyBasicOptions()
88 builder.setContentIntent(NotificationUtil.getExamplePendingIntent(context, in applyBasicOptions()
104 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument
105 NotificationCompat.Builder builder = new NotificationCompat.Builder(context); in buildNotifications()
108 applyBasicOptions(context, builder, wearableOptions, options); in buildNotifications()
121 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument
158 NotificationCompat.Builder builder = new NotificationCompat.Builder(context) in buildNotifications()
[all …]
DActionsPresets.java45 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
56 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
59 context.getString(R.string.example_action), in apply()
60 NotificationUtil.getExamplePendingIntent(context, in apply()
72 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
75 context.getString(R.string.example_action_long_title), in apply()
76 NotificationUtil.getExamplePendingIntent(context, in apply()
88 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument
91 .setLabel(context.getString(R.string.example_reply_label)) in apply()
95 context.getString(R.string.example_reply_action), in apply()
[all …]
/developers/build/prebuilts/gradle/WearMessagingApp/Wearable/src/main/java/com/example/android/wearable/wear/messaging/mock/
DMockDatabase.java63 public static Chat createChat(Context context, Collection<Profile> participants, Profile user) { in createChat() argument
84 Collection<Chat> allChats = getAllChats(context); in createChat()
92 persistsChats(context, allChats); in createChat()
97 private static void persistsChats(Context context, Collection<Chat> chats) { in persistsChats() argument
98 SharedPreferencesHelper.writeChatsToJsonPref(context, new ArrayList<>(chats)); in persistsChats()
118 public static Collection<Chat> getAllChats(Context context) { in getAllChats() argument
120 return SharedPreferencesHelper.readChatsFromJsonPref(context); in getAllChats()
134 public static Chat findChatById(Context context, String id) { in findChatById() argument
135 return findChat(getAllChats(context), id); in findChatById()
144 private static void updateLastMessage(Context context, Chat chat, Message lastMessage) { in updateLastMessage() argument
[all …]
/developers/samples/android/deprecated/wearable/wear/WearMessagingApp/Wearable/src/main/java/com/example/android/wearable/wear/messaging/mock/
DMockDatabase.java63 public static Chat createChat(Context context, Collection<Profile> participants, Profile user) { in createChat() argument
84 Collection<Chat> allChats = getAllChats(context); in createChat()
92 persistsChats(context, allChats); in createChat()
97 private static void persistsChats(Context context, Collection<Chat> chats) { in persistsChats() argument
98 SharedPreferencesHelper.writeChatsToJsonPref(context, new ArrayList<>(chats)); in persistsChats()
118 public static Collection<Chat> getAllChats(Context context) { in getAllChats() argument
120 return SharedPreferencesHelper.readChatsFromJsonPref(context); in getAllChats()
134 public static Chat findChatById(Context context, String id) { in findChatById() argument
135 return findChat(getAllChats(context), id); in findChatById()
144 private static void updateLastMessage(Context context, Chat chat, Message lastMessage) { in updateLastMessage() argument
[all …]
/developers/samples/android/admin/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/
DDeviceOwnerReceiver.java36 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument
39 (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); in onProfileProvisioningComplete()
40 ComponentName componentName = getComponentName(context); in onProfileProvisioningComplete()
41 manager.setProfileName(componentName, context.getString(R.string.profile_name)); in onProfileProvisioningComplete()
43 Intent launch = new Intent(context, MainActivity.class); in onProfileProvisioningComplete()
45 context.startActivity(launch); in onProfileProvisioningComplete()
52 public static ComponentName getComponentName(Context context) { in getComponentName() argument
53 return new ComponentName(context.getApplicationContext(), DeviceOwnerReceiver.class); in getComponentName()
/developers/build/prebuilts/gradle/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/
DDeviceOwnerReceiver.java36 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument
39 (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); in onProfileProvisioningComplete()
40 ComponentName componentName = getComponentName(context); in onProfileProvisioningComplete()
41 manager.setProfileName(componentName, context.getString(R.string.profile_name)); in onProfileProvisioningComplete()
43 Intent launch = new Intent(context, MainActivity.class); in onProfileProvisioningComplete()
45 context.startActivity(launch); in onProfileProvisioningComplete()
52 public static ComponentName getComponentName(Context context) { in getComponentName() argument
53 return new ComponentName(context.getApplicationContext(), DeviceOwnerReceiver.class); in getComponentName()
/developers/samples/android/deprecated/wearable/wear/WearMessagingApp/Wearable/src/main/java/com/example/android/wearable/wear/messaging/util/
DSharedPreferencesHelper.java52 public static Profile readUserFromJsonPref(Context context) { in readUserFromJsonPref() argument
53 SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.PREFS_NAME, 0); in readUserFromJsonPref()
72 public static void writeUserToJsonPref(Context context, Profile user) { in writeUserToJsonPref() argument
73 SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.PREFS_NAME, 0); in writeUserToJsonPref()
85 public static List<Profile> readContactsFromJsonPref(Context context) { in readContactsFromJsonPref() argument
87 return getList(context, Profile.class, Constants.PREFS_CONTACTS_KEY); in readContactsFromJsonPref()
102 public static void writeContactsToJsonPref(Context context, List<Profile> contacts) { in writeContactsToJsonPref() argument
103 setList(context, contacts, Constants.PREFS_CONTACTS_KEY); in writeContactsToJsonPref()
113 public static List<Chat> readChatsFromJsonPref(Context context) throws IOException { in readChatsFromJsonPref() argument
115 return getList(context, Chat.class, Constants.PREFS_CHATS_KEY); in readChatsFromJsonPref()
[all …]
/developers/build/prebuilts/gradle/WearMessagingApp/Wearable/src/main/java/com/example/android/wearable/wear/messaging/util/
DSharedPreferencesHelper.java52 public static Profile readUserFromJsonPref(Context context) { in readUserFromJsonPref() argument
53 SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.PREFS_NAME, 0); in readUserFromJsonPref()
72 public static void writeUserToJsonPref(Context context, Profile user) { in writeUserToJsonPref() argument
73 SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.PREFS_NAME, 0); in writeUserToJsonPref()
85 public static List<Profile> readContactsFromJsonPref(Context context) { in readContactsFromJsonPref() argument
87 return getList(context, Profile.class, Constants.PREFS_CONTACTS_KEY); in readContactsFromJsonPref()
102 public static void writeContactsToJsonPref(Context context, List<Profile> contacts) { in writeContactsToJsonPref() argument
103 setList(context, contacts, Constants.PREFS_CONTACTS_KEY); in writeContactsToJsonPref()
113 public static List<Chat> readChatsFromJsonPref(Context context) throws IOException { in readChatsFromJsonPref() argument
115 return getList(context, Chat.class, Constants.PREFS_CHATS_KEY); in readChatsFromJsonPref()
[all …]
/developers/build/prebuilts/gradle/MessagingService/Application/src/main/java/com/example/android/messagingservice/
DMessageLogger.java39 public static void logMessage(Context context, String message) { in logMessage() argument
40 SharedPreferences prefs = getPrefs(context); in logMessage()
47 public static SharedPreferences getPrefs(Context context) { in getPrefs() argument
48 return context.getSharedPreferences(PREF_MESSAGE, Context.MODE_PRIVATE); in getPrefs()
51 public static String getAllMessages(Context context) { in getAllMessages() argument
52 return getPrefs(context).getString(LOG_KEY, ""); in getAllMessages()
55 public static void clear(Context context) { in clear() argument
56 getPrefs(context).edit().remove(LOG_KEY).apply(); in clear()
/developers/samples/android/notification/MessagingService/Application/src/main/java/com/example/android/messagingservice/
DMessageLogger.java39 public static void logMessage(Context context, String message) { in logMessage() argument
40 SharedPreferences prefs = getPrefs(context); in logMessage()
47 public static SharedPreferences getPrefs(Context context) { in getPrefs() argument
48 return context.getSharedPreferences(PREF_MESSAGE, Context.MODE_PRIVATE); in getPrefs()
51 public static String getAllMessages(Context context) { in getAllMessages() argument
52 return getPrefs(context).getString(LOG_KEY, ""); in getAllMessages()
55 public static void clear(Context context) { in clear() argument
56 getPrefs(context).edit().remove(LOG_KEY).apply(); in clear()
/developers/samples/android/ui/activityscenetransition/ActivitySceneTransitionBasic/Application/src/main/java/com/example/android/activityscenetransitionbasic/
DSquareFrameLayout.java28 public SquareFrameLayout(Context context) { in SquareFrameLayout() argument
29 super(context); in SquareFrameLayout()
32 public SquareFrameLayout(Context context, AttributeSet attrs) { in SquareFrameLayout() argument
33 super(context, attrs); in SquareFrameLayout()
36 public SquareFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) { in SquareFrameLayout() argument
37 super(context, attrs, defStyleAttr); in SquareFrameLayout()
40 public SquareFrameLayout(Context context, AttributeSet attrs, in SquareFrameLayout() argument
42 super(context, attrs, defStyleAttr, defStyleRes); in SquareFrameLayout()
/developers/build/prebuilts/gradle/ActivitySceneTransitionBasic/Application/src/main/java/com/example/android/activityscenetransitionbasic/
DSquareFrameLayout.java28 public SquareFrameLayout(Context context) { in SquareFrameLayout() argument
29 super(context); in SquareFrameLayout()
32 public SquareFrameLayout(Context context, AttributeSet attrs) { in SquareFrameLayout() argument
33 super(context, attrs); in SquareFrameLayout()
36 public SquareFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) { in SquareFrameLayout() argument
37 super(context, attrs, defStyleAttr); in SquareFrameLayout()
40 public SquareFrameLayout(Context context, AttributeSet attrs, in SquareFrameLayout() argument
42 super(context, attrs, defStyleAttr, defStyleRes); in SquareFrameLayout()
/developers/build/prebuilts/androidtv/leanback/app/src/main/java/com/example/android/leanback/
DUtils.java44 public static Point getDisplaySize(Context context) { in getDisplaySize() argument
45 WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); in getDisplaySize()
61 public static final void showErrorDialog(Context context, String errorString) { in showErrorDialog() argument
62 new AlertDialog.Builder(context).setTitle(R.string.error) in showErrorDialog()
80 public static void showToast(Context context, String msg) { in showToast() argument
81 Toast.makeText(context, msg, Toast.LENGTH_LONG).show(); in showToast()
90 public static void showToast(Context context, int resourceId) { in showToast() argument
91 Toast.makeText(context, context.getString(resourceId), Toast.LENGTH_LONG).show(); in showToast()
/developers/build/prebuilts/gradle/AsymmetricFingerprintDialog/Application/src/main/java/com/example/android/asymmetricfingerprintdialog/
DFingerprintModule.java51 public FingerprintModule(Context context) { in FingerprintModule() argument
52 mContext = context; in FingerprintModule()
61 public FingerprintManager providesFingerprintManager(Context context) { in providesFingerprintManager() argument
62 return context.getSystemService(FingerprintManager.class); in providesFingerprintManager()
66 public KeyguardManager providesKeyguardManager(Context context) { in providesKeyguardManager() argument
67 return context.getSystemService(KeyguardManager.class); in providesKeyguardManager()
98 public InputMethodManager providesInputMethodManager(Context context) { in providesInputMethodManager() argument
99 return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); in providesInputMethodManager()
103 public SharedPreferences providesSharedPreferences(Context context) { in providesSharedPreferences() argument
104 return PreferenceManager.getDefaultSharedPreferences(context); in providesSharedPreferences()
/developers/samples/android/security/AsymmetricFingerprintDialog/Application/src/main/java/com/example/android/asymmetricfingerprintdialog/
DFingerprintModule.java51 public FingerprintModule(Context context) { in FingerprintModule() argument
52 mContext = context; in FingerprintModule()
61 public FingerprintManager providesFingerprintManager(Context context) { in providesFingerprintManager() argument
62 return context.getSystemService(FingerprintManager.class); in providesFingerprintManager()
66 public KeyguardManager providesKeyguardManager(Context context) { in providesKeyguardManager() argument
67 return context.getSystemService(KeyguardManager.class); in providesKeyguardManager()
98 public InputMethodManager providesInputMethodManager(Context context) { in providesInputMethodManager() argument
99 return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); in providesInputMethodManager()
103 public SharedPreferences providesSharedPreferences(Context context) { in providesSharedPreferences() argument
104 return PreferenceManager.getDefaultSharedPreferences(context); in providesSharedPreferences()
/developers/samples/android/wearable/wear/WearAccessibilityApp/Wearable/src/main/java/com/example/android/wearable/wear/wearaccessibilityapp/
DMockDatabase.java38 public static MessagingStyleCommsAppData getMessagingStyleData(Context context) { in getMessagingStyleData() argument
39 return MessagingStyleCommsAppData.getInstance(context); in getMessagingStyleData()
60 public static MessagingStyleCommsAppData getInstance(Context context) { in getInstance() argument
62 sInstance = getSync(context); in getInstance()
67 private static synchronized MessagingStyleCommsAppData getSync(Context context) { in getSync() argument
69 sInstance = new MessagingStyleCommsAppData(context); in getSync()
75 private MessagingStyleCommsAppData(Context context) { in MessagingStyleCommsAppData() argument
93 IconCompat.createWithResource(context, R.drawable.me_macdonald)) in MessagingStyleCommsAppData()
102 IconCompat.createWithResource(context, R.drawable.famous_fryer)) in MessagingStyleCommsAppData()
110 .setIcon(IconCompat.createWithResource(context, R.drawable.wendy_wonda)) in MessagingStyleCommsAppData()
[all …]

12345678910>>...25