Import of the watch repository from Pebble

This commit is contained in:
Matthieu Jeanson 2024-12-12 16:43:03 -08:00 committed by Katharine Berry
commit 3b92768480
10334 changed files with 2564465 additions and 0 deletions

View file

@ -0,0 +1,27 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "SS1BTPS.h"
int HCI_Command_Supported(unsigned int BluetoothStackID, unsigned int SupportedCommandBitNumber) {
return 1;
}
int HCI_Write_Default_Link_Policy_Settings(unsigned int BluetoothStackID, Word_t Link_Policy_Settings, Byte_t *StatusResult) {
return 0;
}

View file

@ -0,0 +1,21 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
int L2CA_Set_Link_Connection_Configuration(unsigned int BluetoothStackID, L2CA_Link_Connect_Params_t *L2CA_Link_Connect_Params) {
return 0;
}

View file

@ -0,0 +1,44 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "services/common/accel_manager.h"
AccelManagerState* sys_accel_manager_data_subscribe(
AccelSamplingRate rate, AccelDataReadyCallback data_cb, void* context,
PebbleTask handler_task) {
return NULL;
}
bool sys_accel_manager_data_unsubscribe(AccelManagerState *state) {
return false;
}
uint32_t accel_manager_set_jitterfree_sampling_rate(AccelManagerState *state, uint32_t min_rate_mhz) {
return 0;
}
int sys_accel_manager_set_sample_buffer(AccelManagerState *state, AccelRawData *buffer,
uint32_t samples_per_update) {
return 0;
}
uint32_t sys_accel_manager_get_num_samples(AccelManagerState *state, uint64_t *timestamp_ms) {
return 0;
}
bool sys_accel_manager_consume_samples(AccelManagerState *state, uint32_t samples) {
return false;
}

View file

@ -0,0 +1,38 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/accel_service_private.h"
void accel_service_state_init(AccelServiceState *state) {
}
void accel_data_service_subscribe(uint32_t samples_per_update, AccelDataHandler handler) {
}
void accel_raw_data_service_subscribe(uint32_t samples_per_update, AccelRawDataHandler handler) {
}
void accel_data_service_unsubscribe(void) {
}
AccelServiceState* accel_service_private_get_session(PebbleTask task) {
return NULL;
}
void accel_service_cleanup_task_session(PebbleTask task) {
}

View file

@ -0,0 +1,26 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "services/normal/notifications/action_chaining_window.h"
void action_chaining_window_push(WindowStack *window_stack, const char *title,
TimelineItemActionGroup *action_group,
ActionChainingMenuSelectCb select_cb,
void *select_cb_context,
ActionChainingMenuClosedCb closed_cb,
void *closed_cb_context) {
return;
}

View file

@ -0,0 +1,96 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/ui/action_menu_window.h"
#include "applib/ui/action_menu_hierarchy.h"
void *action_menu_get_context(ActionMenu *action_menu) {
return NULL;
}
ActionMenuLevel *action_menu_get_root_level(ActionMenu *action_menu) {
return NULL;
}
ActionMenu *action_menu_open(WindowStack *window_stack, ActionMenuConfig *config) {
return NULL;
}
ActionMenu *app_action_menu_open(ActionMenuConfig *config) {
return NULL;
}
void action_menu_freeze(ActionMenu *action_menu) {
return;
}
void action_menu_unfreeze(ActionMenu *action_menu) {
return;
}
bool action_menu_is_frozen(ActionMenu *action_menu) {
return false;
}
void action_menu_set_result_window(ActionMenu *action_menu, Window *result_window) {
return;
}
void action_menu_set_align(ActionMenuConfig *config, ActionMenuAlign align) {
return;
}
void action_menu_close(ActionMenu *action_menu, bool animated) {
return;
}
char *action_menu_item_get_label(const ActionMenuItem *item) {
return NULL;
}
void *action_menu_item_get_action_data(const ActionMenuItem *item) {
return NULL;
}
ActionMenuLevel *action_menu_level_create(uint16_t max_items) {
return NULL;
}
void action_menu_level_set_display_mode(ActionMenuLevel *level,
ActionMenuLevelDisplayMode display_mode) {
return;
}
ActionMenuItem *action_menu_level_add_action(ActionMenuLevel *level,
const char *label,
ActionMenuPerformActionCb cb,
void *action_data) {
return NULL;
}
ActionMenuItem *action_menu_level_add_child(ActionMenuLevel *level,
ActionMenuLevel *child,
const char *label) {
return NULL;
}
void action_menu_hierarchy_destroy(const ActionMenuLevel *root,
ActionMenuEachItemCb each_cb,
void *context) {
return;
}

View file

@ -0,0 +1,94 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/activity/activity_private.h"
#include "util/attributes.h"
bool WEAK activity_tracking_on(void) {
return true;
}
bool WEAK activity_get_metric(ActivityMetric metric, uint32_t history_len, int32_t *history) {
return false;
}
bool WEAK activity_get_sessions(uint32_t *session_entries, ActivitySession *sessions) {
return false;
}
bool WEAK activity_get_step_averages(DayInWeek day_of_week, ActivityMetricAverages *averages) {
return false;
}
void WEAK activity_metrics_prv_set_metric(ActivityMetric metric, DayInWeek day, int32_t value) {}
bool WEAK activity_prefs_tracking_is_enabled(void) {
return false;
}
uint8_t WEAK activity_prefs_get_age_years(void) {
return 30; // This is our current default
}
bool WEAK activity_prefs_heart_rate_is_enabled(void) {
return true;
}
bool activity_get_metric_typical(ActivityMetric metric, DayInWeek day, int32_t *value_out) {
return false;
}
bool activity_get_metric_monthly_avg(ActivityMetric metric, int32_t *value_out) {
return false;
}
uint32_t activity_private_compute_distance_mm(uint32_t steps, uint32_t ms) {
return 0;
}
uint32_t activity_private_compute_active_calories(uint32_t distance_mm, uint32_t ms) {
return 0;
}
uint32_t activity_private_compute_resting_calories(uint32_t elapsed_minutes) {
return 0;
}
uint8_t activity_prefs_heart_get_resting_hr(void) {
return 70;
}
uint8_t activity_prefs_heart_get_elevated_hr(void) {
return 100;
}
uint8_t activity_prefs_heart_get_max_hr(void) {
return 190;
}
uint8_t activity_prefs_heart_get_zone1_threshold(void) {
return 130;
}
uint8_t activity_prefs_heart_get_zone2_threshold(void) {
return 154;
}
uint8_t activity_prefs_heart_get_zone3_threshold(void) {
return 172;
}

View file

@ -0,0 +1,54 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <stdint.h>
#include "util/time/time.h"
void activity_insights_recalculate_stats(void) {
return;
}
void activity_insights_init(time_t now_utc) {
return;
}
void activity_insights_process_sleep_data(time_t now_utc) {
return;
}
void activity_insights_process_minute_data(time_t now_utc) {
return;
}
void activity_insights_start_activity_session(time_t start_utc, uint32_t distance_mm,
uint32_t calories) {
return;
}
void activity_insights_push_activity_session(time_t start_utc, uint32_t elapsed_min, int32_t steps,
uint32_t distance_mm, uint32_t calories) {
return;
}
void activity_insights_push_activity_session_notification(time_t notif_time,
ActivitySession *session,
int32_t avg_hr,
int32_t *hr_zone_time_s) {
return;
}

30
tests/stubs/stubs_alarm.h Normal file
View file

@ -0,0 +1,30 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "util/attributes.h"
#include "util/time/time.h"
#include <stdbool.h>
bool WEAK alarm_get_next_enabled_alarm(time_t *next_alarm_time_out) {
return false;
}
bool WEAK alarm_is_next_enabled_alarm_smart(void) {
return false;
}

View file

@ -0,0 +1,28 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/timeline/alarm_layout.h"
#include "util/attributes.h"
LayoutLayer * WEAK alarm_layout_create(const LayoutLayerConfig *config) {
return NULL;
}
bool WEAK alarm_layout_verify(bool existing_attributes[]) {
return false;
}

View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "util/uuid.h"
#include "services/normal/alarms/alarm.h"
void alarm_pin_add(time_t alarm_time, AlarmId id, AlarmType type, AlarmKind kind, Uuid *uuid_out) {
}
void alarm_pin_remove(Uuid *alarm_id) {
}

View file

@ -0,0 +1,50 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/notifications/alerts_private.h"
#include "util/attributes.h"
AlertMask s_alert_mask;
AlertMask WEAK alerts_get_mask(void) {
return s_alert_mask;
}
void WEAK alerts_set_mask(AlertMask mask) {
s_alert_mask = mask;
}
uint32_t WEAK alerts_get_notification_window_timeout_ms(void) {
return 0;
}
void WEAK alerts_incoming_alert_analytics() {}
void WEAK alerts_set_notification_vibe_timestamp() {}
bool WEAK alerts_should_enable_backlight_for_type(AlertType type) {
return false;
}
bool WEAK alerts_should_notify_for_type(AlertType type) {
return false;
}
bool WEAK alerts_should_vibrate_for_type(AlertType type) {
return false;
}

View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/notifications/alerts_preferences_private.h"
#include "services/normal/vibes/vibe_intensity.h"
VibeIntensity alerts_preferences_get_vibe_intensity(void) {
return DEFAULT_VIBE_INTENSITY;
}

View file

@ -0,0 +1,33 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
void ambient_light_init(void) {
}
uint32_t ambient_light_get_light_level(void) {
return 0;
}
void command_als_read(void) {
}
uint32_t ambient_light_get_dark_threshold(void) {
return 0;
}
void ambient_light_set_dark_threshold(uint32_t new_threshold) {
}
bool ambient_light_is_light(void) {
return false;
}

View file

@ -0,0 +1,65 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/common/analytics/analytics.h"
void analytics_init(void) {}
void analytics_set(AnalyticsMetric metric, int64_t val, AnalyticsClient client) {}
void analytics_set_for_uuid(AnalyticsMetric metric, int64_t val, const Uuid *uuid) {}
// TODO: Remove this, and add analytics_append_array or something. See PBL-5333
void analytics_set_entire_array(AnalyticsMetric metric, const void *data, AnalyticsClient client) {}
void analytics_inc(AnalyticsMetric metric, AnalyticsClient client) {}
void analytics_inc_for_uuid(AnalyticsMetric metric, const Uuid *uuid) {}
void analytics_add(AnalyticsMetric metric, int64_t amount, AnalyticsClient client) {}
void analytics_add_for_uuid(AnalyticsMetric metric, int64_t amount, const Uuid *uuid) {}
void analytics_stopwatch_start(AnalyticsMetric metric, AnalyticsClient client) {}
void analytics_stopwatch_stop(AnalyticsMetric metric) {}
void analytics_stopwatch_start_at_rate(AnalyticsMetric metric, uint32_t count_per_sec, AnalyticsClient client) {}
void analytics_event_app_launch(const Uuid *uuid) {}
void analytics_event_bt_error(AnalyticsEvent type, uint32_t error) {}
void analytics_event_pin_created(time_t timestamp, const Uuid *parent_id) {}
void analytics_event_pin_updated(time_t timestamp, const Uuid *parent_id) {}
void analytics_event_pin_open(time_t timestamp, const Uuid *parent_id) {}
void analytics_event_pin_action(time_t timestamp, const Uuid *parent_id,
TimelineItemActionType action_type) {}
void analytics_event_pin_app_launch(time_t timestamp, const Uuid *parent_id) {}
void analytics_event_canned_response(const char *response, bool successfully_sent) {}
void analytics_event_health_insight_created(time_t timestamp,
ActivityInsightType insight_type,
PercentTier pct_tier) {}
void analytics_event_health_insight_response(time_t timestamp, ActivityInsightType insight_type,
ActivitySessionType activity_type,
ActivityInsightResponseType response_id) {}
void analytics_event_alarm(AnalyticsEvent event_type, const AlarmInfo *info) {}
void analytics_event_PPoGATT_disconnect(time_t timestamp, bool successful_reconnect) {}
void analytics_event_ble_hrm(BleHrmEventSubtype subtype) {}

View file

@ -0,0 +1,23 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
void analytics_external_update(void) {}
void analytics_external_battery_init(void) {}
void analytics_external_collect_app_cpu_stats(void) {}
void analytics_external_collect_app_flash_read_stats(void) {}
void analytics_external_collect_kernel_heap_stats(void) {}

21
tests/stubs/stubs_ancs.h Normal file
View file

@ -0,0 +1,21 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "comm/ble/kernel_le_client/ancs/ancs.h"
void ancs_perform_action(uint32_t notification_uid, uint8_t action_id) { }

View file

@ -0,0 +1,25 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/blob_db/ios_notif_pref_db.h"
#include "services/normal/notifications/alerts_preferences.h"
#include "util/attributes.h"
uint8_t WEAK ancs_filtering_get_mute_type(const iOSNotifPrefs *app_notif_prefs) {
return MuteBitfield_None;
}

View file

@ -0,0 +1,25 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/notifications/ancs/ancs_notifications.h"
void ancs_notifications_enable_bulk_action_mode(bool enable) { }
bool ancs_notifications_is_bulk_action_mode_enabled(void) {
return false;
}

View file

@ -0,0 +1,272 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "applib/ui/animation.h"
#include "applib/ui/animation_private.h"
#include "applib/ui/property_animation.h"
#include "applib/ui/property_animation_private.h"
#include "util/attributes.h"
Animation *WEAK animation_create(void) {
Animation *animation = malloc(sizeof(AnimationPrivate));
memset(animation, 0, sizeof(AnimationPrivate));
return animation;
}
bool WEAK animation_destroy(Animation *animation) {
if (!animation) {
return false;
}
free(animation);
return true;
}
bool WEAK animation_set_elapsed(Animation *animation, uint32_t elapsed_ms) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->abs_start_time_ms += elapsed_ms;
return true;
}
bool WEAK animation_get_progress(Animation *animation, AnimationProgress *progress) {
if (!animation) {
return false;
}
// For use in this stub, start time is 0, so anything past 0 is elapsed
*progress = ((AnimationPrivate*)animation)->duration_ms * ANIMATION_NORMALIZED_MAX /
((AnimationPrivate*)animation)->abs_start_time_ms;
return true;
}
bool WEAK animation_get_elapsed(Animation *animation, int32_t *elapsed_ms) {
if (!animation) {
return false;
}
// For use in this stub, start time is 0, so anything past 0 is elapsed
*elapsed_ms = ((AnimationPrivate*)animation)->abs_start_time_ms;
return true;
}
bool WEAK animation_set_delay(Animation *animation, uint32_t delay_ms) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->delay_ms = delay_ms;
return true;
}
bool WEAK animation_set_immutable(Animation *animation) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->immutable = true;
return true;
}
bool WEAK animation_is_immutable(Animation *animation) {
if (!animation) {
return false;
}
return ((AnimationPrivate*)animation)->immutable;
}
bool WEAK animation_set_reverse(Animation *animation, bool reverse) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->reverse = reverse;
return true;
}
bool WEAK animation_get_reverse(Animation *animation) {
if (!animation) {
return false;
}
return ((AnimationPrivate*)animation)->reverse;
}
bool WEAK animation_set_play_count(Animation *animation, uint32_t play_count) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->play_count = play_count;
return true;
}
bool WEAK animation_set_duration(Animation *animation, uint32_t duration_ms) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->duration_ms = duration_ms;
return true;
}
uint32_t WEAK animation_get_duration(Animation *animation, bool include_delay, bool include_play_count) {
if (!animation) {
return 0;
}
return ((AnimationPrivate*)animation)->duration_ms;
}
bool WEAK animation_set_curve(Animation *animation, AnimationCurve curve) { return true; }
bool WEAK animation_set_custom_interpolation(Animation *animation_h,
InterpolateInt64Function interpolate_function) {
return true;
}
bool WEAK animation_set_handlers(Animation *animation, AnimationHandlers callbacks,
void *context) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->context = context;
return true;
}
void *WEAK animation_get_context(Animation *animation) {
if (!animation) {
return false;
}
return ((AnimationPrivate*)animation)->context;
}
bool WEAK animation_schedule(Animation *animation) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->abs_start_time_ms = 0;
((AnimationPrivate*)animation)->scheduled = true;
return true;
}
bool WEAK animation_unschedule(Animation *animation) {
if (!animation) {
return false;
}
((AnimationPrivate*)animation)->scheduled = false;
return true;
}
void WEAK animation_unschedule_all(void) {}
bool WEAK animation_set_implementation(Animation *animation,
const AnimationImplementation *implementation) {
return true;
}
bool WEAK animation_is_scheduled(Animation *animation) {
return animation ? ((AnimationPrivate*)animation)->scheduled : false;
}
Animation *WEAK animation_sequence_create(Animation *animation_a, Animation *animation_b,
Animation *animation_c, ...) {
return animation_create();
}
Animation *WEAK animation_sequence_create_from_array(Animation **animation_array,
uint32_t array_len) {
return animation_create();
}
Animation *WEAK animation_spawn_create(Animation *animation_a, Animation *animation_b,
Animation *animation_c, ...) {
return animation_create();
}
Animation *WEAK animation_spawn_create_from_array(Animation **animation_array,
uint32_t array_len) {
return animation_create();
}
bool WEAK animation_set_auto_destroy(Animation *animation, bool auto_destroy) {
return false;
}
PropertyAnimation *WEAK property_animation_create_layer_frame(
struct Layer *layer, GRect *from_frame, GRect *to_frame) {
return property_animation_create(NULL, layer, from_frame, to_frame);
}
PropertyAnimation *WEAK property_animation_create(
const PropertyAnimationImplementation *implementation, void *subject, void *from_value,
void *to_value) {
PropertyAnimationPrivate *animation = malloc(sizeof(PropertyAnimationPrivate));
property_animation_init((PropertyAnimation *)animation, implementation, subject, from_value,
to_value);
return (PropertyAnimation *)animation;
}
void WEAK property_animation_destroy(PropertyAnimation* property_animation_h) {
animation_destroy((Animation *)property_animation_h);
}
bool WEAK property_animation_init(PropertyAnimation *animation,
const PropertyAnimationImplementation *implementation,
void *subject, void *from_value, void *to_value) {
if (!animation) {
return false;
}
*(PropertyAnimationPrivate *)animation = (PropertyAnimationPrivate){
.animation.implementation = (const AnimationImplementation *)implementation,
.subject = subject,
};
return true;
}
bool WEAK property_animation_subject(PropertyAnimation *property_animation, void **subject,
bool set) {
if (!property_animation) {
return false;
}
if (set) {
((PropertyAnimationPrivate *)property_animation)->subject = *subject;
} else {
*subject = ((PropertyAnimationPrivate *)property_animation)->subject;
}
return true;
}
bool WEAK property_animation_to(PropertyAnimation *property_animation, void *to, size_t size,
bool set) {
if (!property_animation) {
return false;
}
void *field = &((PropertyAnimationPrivate *)property_animation)->values.to;
memcpy((set ? field : to), (set ? to : field), size);
return true;
}
void WEAK property_animation_update_gpoint(PropertyAnimation *property_animation,
const uint32_t distance_normalized) {}
Animation *WEAK property_animation_get_animation(PropertyAnimation *property_animation) {
return (Animation *)property_animation;
}
InterpolateInt64Function WEAK animation_private_current_interpolate_override(void) { return NULL; }
void WEAK property_animation_update_int16(PropertyAnimation *property_animation,
const uint32_t distance_normalized) {}

View file

@ -0,0 +1,32 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
void animation_service_cleanup(PebbleTask task) {
}
void animation_service_timer_event_received(void) {
}
void animation_service_timer_schedule(uint32_t ms) {
}
void animation_service_pause(void) {
}
void animation_service_resume(void) {
}

View file

@ -0,0 +1,38 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/ui/animation_timing.h"
#include "util/attributes.h"
AnimationProgress WEAK animation_timing_segmented(
AnimationProgress time_normalized, int32_t index, uint32_t num_segments,
Fixed_S32_16 duration_fraction) {
return time_normalized;
}
AnimationProgress WEAK animation_timing_curve(AnimationProgress time_normalized,
AnimationCurve curve) {
return time_normalized;
}
AnimationProgress WEAK animation_timing_scaled(AnimationProgress time_normalized,
AnimationProgress interval_start,
AnimationProgress interval_end) {
return interval_end;
}

24
tests/stubs/stubs_app.h Normal file
View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/app.h"
#include "util/attributes.h"
void WEAK app_request_render(void) {}
void WEAK app_event_loop(void) {}

View file

@ -0,0 +1,47 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "process_management/app_install_types.h"
AppInstallId app_cache_get_next_eviction(void) {
return 0;
}
void app_cache_init(void) {
return;
}
status_t app_cache_add_entry(AppInstallId app_id) {
return 0;
}
status_t app_cache_entry_exists(AppInstallId app_id) {
return true;
}
status_t app_cache_app_launched(AppInstallId app_id) {
return 0;
}
status_t app_cache_remove_entry(AppInstallId app_id) {
return 0;
}
void app_cache_flush(void) {
return;
}

View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "process_management/app_custom_icon.h"
#include "util/attributes.h"
const char *WEAK app_custom_get_title(AppInstallId app_id) {
return "";
}

View file

@ -0,0 +1,41 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
void app_db_init(void) {
return;
}
status_t app_db_insert(const uint8_t *key, int key_len, const uint8_t *val, int val_len) {
return S_SUCCESS;
}
int app_db_get_len(const uint8_t *key, int key_len) {
return 1;
}
status_t app_db_read(const uint8_t *key, int key_len, uint8_t *val_out, int val_len) {
return S_SUCCESS;
}
status_t app_db_delete(const uint8_t *key, int key_len) {
return S_SUCCESS;
}
status_t app_db_flush(void) {
return S_SUCCESS;
}

View file

@ -0,0 +1,29 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/app_event_service.h"
void app_event_service_subscribe(EventServiceInfo * service_info) {
return;
}
void app_event_service_unsubscribe(EventServiceInfo * service_info) {
return;
}
void app_event_service_handle_event(ListNode *list, PebbleEvent *e) {
return;
}

View file

@ -0,0 +1,27 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/app_fetch_endpoint.h"
#include "util/attributes.h"
bool WEAK app_fetch_in_progress(void) {
return false;
}
void WEAK app_fetch_cancel_from_system_task(AppInstallId app_id) {}

View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_app_install_manager.h"

View file

@ -0,0 +1,75 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "process_management/app_install_manager.h"
#include "process_management/app_install_types.h"
#include "util/attributes.h"
#include "util/uuid.h"
AppInstallId WEAK app_install_get_id_for_uuid(const Uuid *uuid) {
return 1;
}
AppInstallId WEAK app_get_install_id_for_uuid_from_registry(const Uuid *uuid) {
return INSTALL_ID_INVALID;
}
bool WEAK app_install_get_entry_for_install_id(AppInstallId install_id, AppInstallEntry *entry) {
return true;
}
bool WEAK app_install_get_uuid_for_install_id(AppInstallId install_id, Uuid *uuid_out) {
return true;
}
bool WEAK app_install_is_watchface(AppInstallId app_id) {
return false;
}
bool WEAK app_install_id_from_system(AppInstallId id) {
return (id < INSTALL_ID_INVALID);
}
bool WEAK app_install_id_from_app_db(AppInstallId id) {
return (id > INSTALL_ID_INVALID);
}
void WEAK app_install_enumerate_entries(AppInstallEnumerateCb cb, void *data) {
return;
}
bool WEAK app_install_entry_is_watchface(const AppInstallEntry *entry) {
return false;
}
bool WEAK app_install_entry_is_hidden(const AppInstallEntry *entry) {
return false;
}
bool WEAK app_install_entry_is_SDK_compatible(const AppInstallEntry *entry) {
return true;
}
const WEAK PebbleProcessMd *app_install_get_md(AppInstallId id, bool worker) {
return NULL;
}
ResAppNum WEAK app_install_get_app_icon_bank(const AppInstallEntry *entry) {
return SYSTEM_APP;
}

View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/app_launch_reason.h"
#include "util/attributes.h"
uint32_t WEAK app_launch_get_args(void) {
return 0;
}

View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_app_manager.h"

View file

@ -0,0 +1,84 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "process_management/app_manager.h"
#include "process_management/pebble_process_md.h"
#include "process_management/process_manager.h"
#include "util/attributes.h"
bool WEAK app_manager_is_initialized(void) {
return true;
}
static int s_app_manager_launch_new_app__callcount;
static AppLaunchConfig s_app_manager_launch_new_app__config;
bool WEAK app_manager_launch_new_app(const AppLaunchConfig *config) {
s_app_manager_launch_new_app__callcount++;
s_app_manager_launch_new_app__config = *config;
return true;
}
void WEAK app_manager_put_launch_app_event(const AppLaunchEventConfig *config) {
return;
}
ProcessContext *WEAK app_manager_get_task_context(void) {
return NULL;
}
void WEAK app_manager_close_current_app(bool gracefully) {
return;
}
AppInstallId WEAK app_manager_get_current_app_id(void) {
return 0;
}
AppInstallId WEAK sys_app_manager_get_current_app_id(void) {
return 0;
}
bool WEAK app_manager_is_watchface_running(void) {
return false;
}
WakeupInfo WEAK app_manager_get_app_wakeup_state(void) {
return (WakeupInfo) {};
}
AppLaunchReason WEAK app_manager_get_launch_reason(void) {
return 0;
}
ButtonId WEAK app_manager_get_launch_button(void) {
return 0;
}
const PebbleProcessMd *WEAK app_manager_get_current_app_md(void) {
return NULL;
}
bool WEAK app_manager_is_app_supported(const PebbleProcessMd *app_md) {
return true;
}
Version sys_get_current_app_sdk_version(void) {
return (Version) {PROCESS_INFO_CURRENT_SDK_VERSION_MAJOR, PROCESS_INFO_CURRENT_SDK_VERSION_MINOR};
}
void WEAK app_manager_get_framebuffer_size(GSize *size) {}

View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_app_menu_data_source.h"

View file

@ -0,0 +1,54 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "process_management/app_menu_data_source.h"
#include "util/attributes.h"
WEAK void app_menu_data_source_init(AppMenuDataSource *source,
const AppMenuDataSourceCallbacks *handlers,
void *callback_context) {
}
WEAK void app_menu_data_source_deinit(AppMenuDataSource *source) {
}
WEAK void app_menu_data_source_enable_icons(AppMenuDataSource *source, uint32_t fallback_icon_id) {}
WEAK AppMenuNode* app_menu_data_source_get_node_at_index(AppMenuDataSource *source,
uint16_t row_index) {
return NULL;
}
WEAK uint16_t app_menu_data_source_get_count(AppMenuDataSource *source) {
return 0;
}
WEAK uint16_t app_menu_data_source_get_index_of_app_with_install_id(AppMenuDataSource *source,
AppInstallId install_id) {
return 0;
}
WEAK void app_menu_data_source_draw_row(AppMenuDataSource *source, GContext *ctx, Layer *cell_layer,
MenuIndex *cell_index) {}
WEAK void app_menu_data_source_set_default_icon(AppMenuDataSource *source, uint32_t icon_id) {}
WEAK GBitmap *app_menu_data_source_get_node_icon(AppMenuDataSource *source, AppMenuNode *node) {
return NULL;
}

View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_app_state.h"

View file

@ -0,0 +1,182 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/app_smartstrap_private.h"
#include "applib/graphics/graphics.h"
#include "applib/ui/animation_private.h"
#include "applib/ui/click_internal.h"
#include "applib/ui/layer.h"
#include "applib/ui/window_stack_private.h"
#include "applib/unobstructed_area_service_private.h"
#include "process_state/app_state/app_state.h"
#include "services/normal/app_glances/app_glance_service.h"
#include "util/attributes.h"
#include "util/heap.h"
static Heap s_app_heap;
bool app_state_configure(MemorySegment *app_state_ram,
ProcessAppSDKType sdk_type,
int16_t obstruction_origin_y) {
return true;
}
void app_state_init(void) {
}
void app_state_deinit(void) {
}
struct tm *app_state_get_gmtime_tm(void) {
static struct tm gmtime_tm = {0};
return &gmtime_tm;
}
struct tm *app_state_get_localtime_tm(void) {
static struct tm localtime_tm = {0};
return &localtime_tm;
}
char *app_state_get_localtime_zone(void) {
static char localtime_zone[TZ_LEN] = {0};
return localtime_zone;
}
LocaleInfo *app_state_get_locale_info(void) {
return NULL;
}
GContext *s_app_state_get_graphics_context;
GContext* app_state_get_graphics_context(void) {
return s_app_state_get_graphics_context;
}
Heap* app_state_get_heap(void) {
return &s_app_heap;
}
static AnimationState s_stub_app_animation_state;
AnimationState* app_state_get_animation_state(void) {
return &s_stub_app_animation_state;
}
static AnimationState s_stub_kernel_animation_state;
AnimationState* kernel_applib_get_animation_state(void) {
return &s_stub_kernel_animation_state;
}
GBitmap* app_state_legacy2_get_2bit_framebuffer(void) {
// Shouldn't be used, only for backwards compatibility
return NULL;
}
static Layer *s_layer_tree_stack[LAYER_TREE_STACK_SIZE];
Layer** app_state_get_layer_tree_stack(void) {
return s_layer_tree_stack;
}
Layer** kernel_applib_get_layer_tree_stack(void) {
return s_layer_tree_stack;
}
static WindowStack s_window_stack;
WindowStack *app_state_get_window_stack(void) {
return &s_window_stack;
}
static SmartstrapConnectionState s_smartstrap_state;
SmartstrapConnectionState *app_state_get_smartstrap_state(void) {
return &s_smartstrap_state;
}
static ClickManager click_manager;
ClickManager *app_state_get_click_manager(void) {
return &click_manager;
}
static void *s_user_data;
void app_state_set_user_data(void *data) {
s_user_data = data;
}
void *app_state_get_user_data(void) {
return s_user_data;
}
static RockyRuntimeContext *s_rocky_runtime_context = NULL;
static uint8_t *s_runtime_context_buffer = NULL;
void app_state_set_rocky_runtime_context(uint8_t *unaligned_buffer,
RockyRuntimeContext *rocky_runtime_context) {
s_rocky_runtime_context = rocky_runtime_context;
s_runtime_context_buffer = unaligned_buffer;
}
uint8_t *app_state_get_rocky_runtime_context_buffer(void) {
return s_runtime_context_buffer;
}
RockyRuntimeContext *app_state_get_rocky_runtime_context(void) {
return s_rocky_runtime_context;
}
static RockyMemoryAPIContext *s_rocky_memory_api_context = NULL;
void app_state_set_rocky_memory_api_context(RockyMemoryAPIContext *context) {
s_rocky_memory_api_context = context;
}
RockyMemoryAPIContext *app_state_get_rocky_memory_api_context(void) {
return s_rocky_memory_api_context;
}
UnobstructedAreaState s_stub_unobstructed_area_state;
UnobstructedAreaState *app_state_get_unobstructed_area_state(void) {
return &s_stub_unobstructed_area_state;
}
AppGlance s_app_glance;
AppGlance *app_state_get_glance(void) {
return &s_app_glance;
}
static bool s_text_perimeter_debugging_enabled;
bool app_state_get_text_perimeter_debugging_enabled(void) {
return s_text_perimeter_debugging_enabled;
}
void app_state_set_text_perimeter_debugging_enabled(bool enabled) {
s_text_perimeter_debugging_enabled = enabled;
}
TextRenderState *app_state_get_text_render_state(void) {
static TextRenderState s_state = {0};
return &s_state;
}
FrameBuffer *s_app_state_framebuffer;
FrameBuffer * WEAK app_state_get_framebuffer(void) {
return s_app_state_framebuffer;
}

View file

@ -0,0 +1,37 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/app_timer.h"
AppTimer* app_timer_register(uint32_t timeout_ms, AppTimerCallback callback, void* callback_data) {
return NULL;
}
AppTimer* app_timer_register_repeatable(uint32_t timeout_ms,
AppTimerCallback callback,
void* callback_data,
bool repeating) {
return NULL;
}
bool app_timer_reschedule(AppTimer *timer, uint32_t new_timeout_ms) {
return true;
}
void app_timer_cancel(AppTimer *timer) {
}

View file

@ -0,0 +1,36 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/ui/window.h"
#include "util/attributes.h"
Window * WEAK app_window_stack_pop(bool animated) {
return NULL;
}
void WEAK app_window_stack_pop_all(const bool animated) {}
void WEAK app_window_stack_push(Window *window, bool animated) {}
Window * WEAK app_window_stack_get_top_window(void) {
return NULL;
}
bool WEAK app_window_stack_contains_window(Window *window) {
return false;
}

View file

@ -0,0 +1,44 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
bool applib_resource_track_mmapped(const void *bytes) {
return false;
}
bool applib_resource_is_mmapped(const void *bytes) {
return false;
}
bool applib_resource_munmap(const void *bytes) {
return false;
}
bool applib_resource_munmap_all() {
return false;
}
void applib_resource_munmap_or_free(void *bytes) {
free(bytes);
}
// this is just a stub, if you need proper resource handling
// link against fake_applib_resource.c in your test
void *applib_resource_mmap_or_load(ResAppNum app_num, uint32_t resource_id,
size_t offset, size_t num_bytes, bool used_aligned) {
return NULL;
}

View file

@ -0,0 +1,63 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/timeline/attribute.h"
const char *attribute_get_string(const AttributeList *attr_list, AttributeId id,
char *default_value) {
return NULL;
}
uint8_t attribute_get_uint8(const AttributeList *attr_list, AttributeId id,
uint8_t default_value) {
return 0;
}
uint32_t attribute_get_uint32(const AttributeList *attr_list, AttributeId id,
uint32_t default_value) {
return 0;
}
void attribute_list_add_cstring(AttributeList *list, AttributeId id, const char *cstring) {
return;
}
void attribute_list_add_uint32(AttributeList *list, AttributeId id, uint32_t uint32) {
return;
}
void attribute_list_add_string_list(AttributeList *list, AttributeId id, StringList *string_list) {
return;
}
void attribute_list_add_uint32_list(AttributeList *list, AttributeId id, Uint32List *uint32_list) {
return;
}
void attribute_list_add_resource_id(AttributeList *list, AttributeId id,
uint32_t resource_id) {
return;
}
void attribute_list_add_uint8(AttributeList *list, AttributeId id, uint8_t uint8) {
return;
}
void attribute_list_destroy_list(AttributeList *list) {
return;
}

View file

@ -0,0 +1,19 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
bool battery_is_usb_connected(void) {
return false;
}

View file

@ -0,0 +1,20 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
bool battery_monitor_critical_lockout(void) {
return false;
}

View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/battery_state_service.h"
#include "util/attributes.h"
BatteryChargeState WEAK battery_state_service_peek(void) {
return (BatteryChargeState) {};
}

View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_bitblt.h"

View file

@ -0,0 +1,27 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/graphics/gtypes.h"
WEAK void bitblt_bitmap_into_bitmap(GBitmap* dest_bitmap, const GBitmap* src_bitmap,
GPoint dest_offset, GCompOp compositing_mode,
GColor tint_color) {}
WEAK void bitblt_bitmap_into_bitmap_tiled(GBitmap* dest_bitmap, const GBitmap* src_bitmap,
GRect dest_rect, GPoint src_origin_offset,
GCompOp compositing_mode, GColor8 tint_color) {}

38
tests/stubs/stubs_ble.h Normal file
View file

@ -0,0 +1,38 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "stubs_bluetooth_pairing_ui.h"
#include "stubs_events.h"
#include "stubs_HCIAPI.h"
#include "stubs_L2CAPAPI.h"
#include "stubs_hexdump.h"
#include "stubs_queue.h"
#include <inttypes.h>
#include <stdbool.h>
bool gaps_init(void) {
return true;
}
bool gaps_deinit(uint32_t stack_id) {
return true;
}
void comm_handle_paired_devices_changed(void) {
}

View file

@ -0,0 +1,23 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
void ble_init_app_state(void) {
}
void ble_app_cleanup(void) {
}

View file

@ -0,0 +1,23 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <stdint.h>
int8_t sys_ble_get_advertising_tx_power(void) {
return -55;
}

View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_blob_db.h"

View file

@ -0,0 +1,29 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "kernel/events.h"
#include "services/normal/blob_db/api.h"
#include "util/attributes.h"
status_t WEAK blob_db_delete(BlobDBId db_id, const uint8_t *key, int key_len) {
return S_SUCCESS;
}
void WEAK blob_db_event_put(enum BlobDBEventType type, BlobDBId db_id, const uint8_t *key,
int key_len) {}

View file

@ -0,0 +1,41 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "services/normal/blob_db/sync.h"
status_t blob_db_sync_db(BlobDBId db_id) {
return S_SUCCESS;
}
status_t blob_db_sync_record(BlobDBId db_id, const void *key, int key_len, time_t last_updated) {
return S_SUCCESS;
}
BlobDBSyncSession *blob_db_sync_get_session_for_id(BlobDBId db_id) {
return NULL;
}
BlobDBSyncSession *blob_db_sync_get_session_for_token(BlobDBToken token) {
return NULL;
}
void blob_db_sync_next(BlobDBSyncSession *session) {
return;
}
void blob_db_sync_cancel(BlobDBSyncSession *session) {
return;
}

View file

@ -0,0 +1,28 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/blob_db/api.h"
#include "services/normal/settings/settings_file.h"
bool sync_util_is_dirty_cb(SettingsFile *file, SettingsRecordInfo *info, void *context) {
return false;
}
bool sync_util_build_dirty_list_cb(SettingsFile *file, SettingsRecordInfo *info, void *context) {
return false;
}

View file

@ -0,0 +1,41 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "GAPAPI.h"
#include <stdbool.h>
void bluetooth_analytics_get_param_averages(uint16_t *params) {
}
void bluetooth_analytics_handle_connection_params_update(
const GAP_LE_Current_Connection_Parameters_t *params) {
}
void bluetooth_analytics_handle_connect(unsigned int stack_id,
const GAP_LE_Connection_Complete_Event_Data_t *event) {
}
void bluetooth_analytics_handle_disconnect(bool local_is_master) {
}
void bluetooth_analytics_handle_encryption_change(void) {
}
void bluetooth_analytics_handle_no_intent_for_connection(void) {
}

View file

@ -0,0 +1,23 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "util/attributes.h"
bool WEAK bt_ctl_is_airplane_mode_on(void) {
return false;
}

View file

@ -0,0 +1,23 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "kernel/events.h"
void bluetooth_pairing_ui_handle_event(PebbleBluetoothPairEvent *event) {
}

View file

@ -0,0 +1,27 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/common/comm_session/session_remote_version.h"
#include "util/attributes.h"
void WEAK bt_persistent_storage_get_cached_system_capabilities(
PebbleProtocolCapabilities *capabilities_out) {
if (capabilities_out) {
capabilities_out->flags = 0;
}
}

View file

@ -0,0 +1,33 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <bluetooth/bluetooth_types.h>
#include <bluetooth/sm_types.h>
#include <btutil/sm_util.h>
void bluetooth_persistent_storage_debug_dump_ble_pairing_info(
char *display_buf, const SMPairingInfo *info) {
}
void bluetooth_persistent_storage_debug_dump_classic_pairing_info(
char *display_buf, BTDeviceAddress *addr, char *device_name, SM128BitKey *link_key,
uint8_t platform_bits) {
}
void bluetooth_persistent_storage_debug_dump_root_keys(SM128BitKey *irk, SM128BitKey *erk) {
}

View file

@ -0,0 +1,27 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
typedef struct BTContext BTContext;
unsigned int bt_stack_id(void) {
return 1;
}
BTContext *bluetopia_get_context(void) {
return NULL;
}

View file

@ -0,0 +1,29 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "system/bootbits.h"
#include <inttypes.h>
#include <stdbool.h>
void boot_bit_clear(BootBitValue bit) {
return;
}
bool boot_bit_test(BootBitValue bit) {
return (false);
}

View file

@ -0,0 +1,35 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "comm/ble/gap_le_connection.h"
#include "comm/bt_conn_mgr.h"
void conn_mgr_set_ble_conn_response_time(
GAPLEConnection *hdl, BtConsumer consumer, ResponseTimeState state,
uint16_t max_period_secs) { }
void conn_mgr_set_ble_conn_response_time_ext(
GAPLEConnection *hdl, BtConsumer consumer, ResponseTimeState state,
uint16_t max_period_secs, ResponsivenessGrantedHandler granted_handler) { }
void conn_mgr_set_bt_classic_conn_response_time(
struct Remote *remote, BtConsumer consumer, ResponseTimeState state,
uint16_t max_period_secs) { }
void conn_mgr_set_bt_classic_conn_response_time_ext(
struct Remote *remote, BtConsumer consumer, ResponseTimeState state,
uint16_t max_period_secs, ResponsivenessGrantedHandler granted_handler) { }

View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
void bt_driver_classic_update_connectability(void) {
}
bool bt_driver_supports_bt_classic(void) {
return true;
}

View file

@ -0,0 +1,36 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <bluetooth/gatt.h>
#include "fake_GATTAPI.h"
// TODO: Rethink how we want to stub out these new driver wrapper calls.
void bt_driver_gatt_send_changed_indication(uint32_t connection_id, const ATTHandleRange *data) {
GATT_Service_Changed_Data_t all_changed_range = {
.Affected_Start_Handle = data->start,
.Affected_End_Handle = data->end,
};
GATT_Service_Changed_Indication(bt_stack_id(), connection_id, &all_changed_range);
}
void bt_driver_gatt_respond_read_subscription(uint32_t transaction_id, uint16_t response_code) {
GATT_Service_Changed_CCCD_Read_Response(bt_stack_id(),
transaction_id,
response_code);
}

View file

@ -0,0 +1,43 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <bluetooth/gatt.h>
#include "fake_GATTAPI.h"
// TODO: Rethink how we want to stub out these new driver wrapper calls.
BTErrno bt_driver_gatt_start_discovery_range(const GAPLEConnection *connection, const ATTHandleRange *data) {
GATT_Attribute_Handle_Group_t hdl = {
.Starting_Handle = data->start,
.Ending_Handle = data->end,
};
int rv = GATT_Start_Service_Discovery_Handle_Range(bt_stack_id(), connection->gatt_connection_id,
&hdl, 0, NULL, NULL, 0);
return 0;
}
BTErrno bt_driver_gatt_stop_discovery(GAPLEConnection *connection) {
GATT_Stop_Service_Discovery(bt_stack_id(), connection->gatt_connection_id);
return 0;
}
void bt_driver_gatt_handle_finalize_discovery(GAPLEConnection *connection) {
}
void bt_driver_gatt_handle_discovery_abandoned(void) {}

View file

@ -0,0 +1,30 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
void bt_lock(void) {
}
void bt_unlock(void) {
}
void bt_lock_assert_held(bool is_held) {
}
bool bt_lock_is_held(void) {
return false;
}

View file

@ -0,0 +1,21 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
unsigned int bt_stack_id(void) {
return 1;
}

View file

@ -0,0 +1,43 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
size_t buffer_get_bytes_remaining(Buffer *b) {
return 0;
}
size_t buffer_add(Buffer* const b, const uint8_t* const data, const size_t length) {
return 0;
}
size_t buffer_remove(Buffer* const b, const size_t offset, const size_t length) {
return 0;
}
Buffer* buffer_create(const size_t size_bytes) {
return NULL;
}
void buffer_init(Buffer * const buffer, const size_t length) {
}
void buffer_clear(Buffer * const buffer) {
}
bool buffer_is_empty(Buffer * const buffer) {
return true;
}

View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "util/attributes.h"
#include "util/build_id.h"
bool WEAK build_id_contains_gnu_build_id(const ElfExternalNote *note) {
return false;
}

36
tests/stubs/stubs_cache.h Normal file
View file

@ -0,0 +1,36 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "mcu/cache.h"
void icache_enable(void) {}
void icache_disable(void) {}
void icache_invalidate_all(void) {}
void dcache_enable(void) {}
void dcache_disable(void) {}
void dcache_flush_all(void) {}
void dcache_invalidate_all(void) {}
void dcache_flush_invalidate_all(void) {}
void dcache_flush(const void *addr, size_t size) {}
void dcache_invalidate(void *addr, size_t size) {}
void dcache_flush_invalidate(const void *addr, size_t size) {}
uint32_t dcache_alignment_mask_minimum(uint32_t min) { return min - 1; }

View file

@ -0,0 +1,25 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
void calendar_handle_pin_change(void) {
return;
}
bool calendar_event_is_ongoing(void) {
return false;
}

View file

@ -0,0 +1,28 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/timeline/calendar_layout.h"
#include "util/attributes.h"
LayoutLayer * WEAK calendar_layout_create(const LayoutLayerConfig *config) {
return NULL;
}
bool WEAK calendar_layout_verify(bool existing_attributes[]) {
return false;
}

32
tests/stubs/stubs_clar.c Normal file
View file

@ -0,0 +1,32 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdbool.h>
#include <setjmp.h>
bool clar_expecting_passert = false;
bool clar_passert_occurred = false;
jmp_buf clar_passert_jmp_buf;
void
clar__assert(
int condition,
const char *file,
int line,
const char *error_msg,
const char *description,
int should_abort)
{};

17
tests/stubs/stubs_click.c Normal file
View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_click.h"

49
tests/stubs/stubs_click.h Normal file
View file

@ -0,0 +1,49 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/ui/click.h"
#include "applib/ui/click_internal.h"
#include "applib/ui/window.h"
#include "util/attributes.h"
WEAK ButtonId click_recognizer_get_button_id(ClickRecognizerRef recognizer) {
return 0;
}
WEAK void click_recognizer_handle_button_up(ClickRecognizer *recognizer) {
return;
}
WEAK void click_recognizer_handle_button_down(ClickRecognizer *recognizer) {
return;
}
WEAK uint8_t click_number_of_clicks_counted(ClickRecognizerRef recognizer) {
return 0;
}
WEAK bool click_recognizer_is_held_down(ClickRecognizerRef recognizer) {
return false;
}
WEAK bool click_recognizer_is_repeating(ClickRecognizerRef recognizer) {
return false;
}
WEAK void app_click_config_setup_with_window(ClickManager *click_manager, Window *window) {}

17
tests/stubs/stubs_clock.c Normal file
View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_clock.h"

45
tests/stubs/stubs_clock.h Normal file
View file

@ -0,0 +1,45 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/common/clock.h"
#include "util/attributes.h"
void WEAK clock_get_since_time(char *buffer, int buf_size, time_t timestamp) {}
void WEAK clock_get_until_time(char *buffer, int buf_size, time_t timestamp,
int max_relative_hrs) {}
void WEAK clock_get_until_time_without_fulltime(char *buffer, int buf_size, time_t timestamp,
int max_relative_hrs) {}
void WEAK clock_hour_and_minute_add(int *hour, int *minute, int delta_minutes) {}
size_t WEAK clock_copy_time_string_timestamp(char *buffer, uint8_t size, time_t timestamp) {
return 0;
}
void WEAK clock_get_friendly_date(char *buffer, int buf_size, time_t timestamp) {}
size_t WEAK clock_get_time_number(char *number_buffer, size_t number_buffer_size,
time_t timestamp) {
return 0;
}
size_t WEAK clock_get_time_word(char *buffer, size_t buffer_size, time_t timestamp) {
return 0;
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
typedef uint32_t Codepoint;
bool codepoint_is_formatting_indicator(const Codepoint codepoint) {
return false;
}
bool codepoint_is_skin_tone_modifier(const Codepoint codepoint) {
return false;
}
bool codepoint_is_end_of_word(const Codepoint codepoint) {
return false;
}
bool codepoint_is_ideograph(const Codepoint codepoint) {
return false;
}
bool codepoint_should_skip(const Codepoint codepoint) {
return false;
}
bool codepoint_is_zero_width(const Codepoint codepoint) {
return false;
}
bool codepoint_is_latin(const Codepoint codepoint) {
return false;
}
bool codepoint_is_emoji(const Codepoint codepoint) {
return false;
}
bool codepoint_is_special(const Codepoint codepoint) {
return false;
}

View file

@ -0,0 +1,23 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/common/comm_session/app_session_capabilities.h"
#include "util/attributes.h"
void WEAK comm_session_app_session_capabilities_evict(const Uuid *app_uuid) {}

View file

@ -0,0 +1,32 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
static bool s_is_legacy2 = false;
void process_manager_set_compiled_with_legacy2_sdk(bool is_legacy2) {
s_is_legacy2 = is_legacy2;
}
bool process_manager_compiled_with_legacy2_sdk(void) {
#if LEGACY2_TEST
return true;
#else
return s_is_legacy2;
#endif
}

View file

@ -0,0 +1,18 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
void compositor_transition(const CompositorTransition *type) {
}

View file

@ -0,0 +1,19 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
void compositor_dma_init(void) { }

View file

@ -0,0 +1,30 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/common/compositor/compositor_transitions.h"
#include "util/attributes.h"
const CompositorTransition *WEAK compositor_slide_transition_timeline_get(
bool timeline_is_future, bool timeline_is_destination, bool timeline_is_empty) {
return NULL;
}
const CompositorTransition *WEAK compositor_dot_transition_timeline_get(
bool timeline_is_future, bool timeline_is_destination) {
return NULL;
}

View file

@ -0,0 +1,40 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/ui/dialogs/confirmation_dialog.h"
ConfirmationDialog *confirmation_dialog_create(const char *dialog_name) {
return NULL;
}
Dialog *confirmation_dialog_get_dialog(ConfirmationDialog *confirmation_dialog) {
return NULL;
}
ActionBarLayer *confirmation_dialog_get_action_bar(ConfirmationDialog *confirmation_dialog) {
return NULL;
}
void confirmation_dialog_set_click_config_provider(ConfirmationDialog *confirmation_dialog,
ClickConfigProvider click_config_provider) {}
void confirmation_dialog_push(ConfirmationDialog *confirmation_dialog, WindowStack *window_stack) {}
void app_confirmation_dialog_push(ConfirmationDialog *confirmation_dialog) {}
void confirmation_dialog_pop(ConfirmationDialog *confirmation_dialog) {}

View file

@ -0,0 +1,45 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "applib/connection_service.h"
#include "applib/connection_service_private.h"
bool connection_service_peek_pebble_app_connection(void) {
return false;
}
bool connection_service_peek_pebblekit_connection(void) {
return false;
}
void connection_service_unsubscribe(void) {
}
void connection_service_subscribe(ConnectionHandlers conn_handlers) {
}
void connection_service_state_init(ConnectionServiceState *state) {
}
void bluetooth_connection_service_subscribe(ConnectionHandler handler) {
}
void bluetooth_connection_service_unsubscribe(void) {
}
bool bluetooth_connection_service_peek(void) {
return false;
}

View file

@ -0,0 +1,25 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
Contact* contacts_get_contact_by_uuid(const Uuid *uuid) {
return NULL;
}
void contacts_free_contact(Contact *contact) {
return;
}

View file

@ -0,0 +1,51 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/blob_db/contacts_db.h"
int contacts_db_get_serialized_contact(const Uuid *uuid, SerializedContact **contact_out) {
return 0;
}
void contacts_db_free_serialized_contact(SerializedContact *contact) {
return;
}
void contacts_db_init(void) {
return;
}
status_t contacts_db_insert(const uint8_t *key, int key_len, const uint8_t *val, int val_len) {
return S_SUCCESS;
}
int contacts_db_get_len(const uint8_t *key, int key_len) {
return 1;
}
status_t contacts_db_read(const uint8_t *key, int key_len, uint8_t *val_out, int val_len) {
return S_SUCCESS;
}
status_t contacts_db_delete(const uint8_t *key, int key_len) {
return S_SUCCESS;
}
status_t contacts_db_flush(void) {
return S_SUCCESS;
}

View file

@ -0,0 +1,35 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/ui/content_indicator.h"
void content_indicator_init_buffer(ContentIndicatorsBuffer *content_indicators_buffer) {}
ContentIndicator *content_indicator_get_for_scroll_layer(ScrollLayer *scroll_layer) {
return NULL;
}
ContentIndicator *content_indicator_get_or_create_for_scroll_layer(ScrollLayer *scroll_layer) {
return NULL;
}
void content_indicator_destroy_for_scroll_layer(ScrollLayer *scroll_layer) {}
void content_indicator_set_content_available(ContentIndicator *content_indicator,
ContentIndicatorDirection direction,
bool available) {}

40
tests/stubs/stubs_crc.h Normal file
View file

@ -0,0 +1,40 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
void crc_init(void) {
}
uint32_t crc_calculate_bytes(const void* data, size_t data_length) {
return 0;
}
uint32_t crc_calculate_flash(uint32_t address, unsigned int num_bytes) {
return 0;
}
uint8_t crc8_calculate_bytes(const uint8_t *data, unsigned int data_length) {
return 0;
}
void crc_calculate_incremental_start(void) {
}
void crc_calculate_incremental_stop(void) {
}
uint32_t crc_calculate_file(int fd, uint32_t offset, uint32_t num_bytes) {
return 0;
}

35
tests/stubs/stubs_cron.h Normal file
View file

@ -0,0 +1,35 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <pebbleos/cron.h>
time_t cron_job_get_execute_time(const CronJob *job) {
return 0;
}
time_t cron_job_get_execute_time_from_epoch(const CronJob *job, time_t local_epoch) {
return 0;
}
time_t cron_job_schedule(CronJob *job) {
return 0;
}
bool cron_job_unschedule(CronJob *job) {
return true;
}

110
tests/stubs/stubs_dialog.h Normal file
View file

@ -0,0 +1,110 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/ui/dialogs/dialog.h"
void dialog_set_background_color(Dialog *dialog, GColor background_color) {
return;
}
void dialog_set_icon(Dialog *dialog, uint32_t icon_id) {
return;
}
void dialog_set_fullscreen(Dialog *dialog, bool is_fullscreen) {
return;
}
void dialog_show_status_bar_layer(Dialog *dialog, bool show_status_layer) {
return;
}
void dialog_set_text(Dialog *dialog, const char *text) {
return;
}
void dialog_set_text_color(Dialog *dialog, GColor text_color) {
return;
}
void ddialog_set_vibe(Dialog *dialog, bool vibe_on_show) {
return;
}
void dialog_set_timeout(Dialog *dialog, uint32_t timeout) {
return;
}
void dialog_set_callbacks(Dialog *dialog, const DialogCallbacks *callbacks,
void *callback_context) {
return;
}
void dialog_init(Dialog *dialog, const char *dialog_name) {
return;
}
void dialog_push(Dialog *dialog, struct WindowStack *window_stack) {
return;
}
void app_dialog_push(Dialog *dialog) {
}
void dialog_unload(Dialog *dialog) {
if (dialog && dialog->callbacks.unload) {
if (dialog->callback_context) {
dialog->callbacks.unload(dialog->callback_context);
} else {
dialog->callbacks.unload(dialog);
}
}
}
void dialog_pop(Dialog *dialog) {
dialog_unload(dialog);
}
void dialog_load(Dialog *dialog) {
return;
}
void dialog_appear(Dialog *dialog) {
return;
}
void dialog_add_status_bar_layer(Dialog *dialog, GRect status_layer_frame) {
return;
}
GDrawCommandImage *dialog_create_icon(Dialog *dialog) {
return NULL;
}
bool dialog_init_icon_layer(Dialog *dialog, GDrawCommandImage *image,
GPoint origin, bool animated) {
return false;
}
void dialog_set_icon_animate_direction(Dialog *dialog, DialogIconAnimationDirection direction) {
return;
}
void dialog_set_destroy_on_pop(Dialog *dialog, bool destroy_on_pop) {
return;
}

20
tests/stubs/stubs_dls.h Normal file
View file

@ -0,0 +1,20 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "services/normal/data_logging/data_logging_service.h"
void dls_inactivate_sessions(PebbleTask task) {
}

View file

@ -0,0 +1,30 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/normal/notifications/do_not_disturb.h"
#include "util/attributes.h"
bool WEAK do_not_disturb_is_active(void) {
return false;
}
void WEAK do_not_disturb_init(void) {}
void WEAK do_not_disturb_manual_toggle_with_dialog(void) {}
void WEAK do_not_disturb_toggle_manually_enabled(ManualDNDFirstUseSource source) {}

View file

@ -0,0 +1,23 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "kernel/event_loop.h"
void launcher_task_add_callback(CallbackEventCallback callback, void *data) {
callback(data);
}

View file

@ -0,0 +1,24 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "applib/event_service_client.h"
void event_service_client_subscribe(EventServiceInfo * service_info) {}
void event_service_client_unsubscribe(EventServiceInfo * service_info) {}

View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_evented_timer.h"

View file

@ -0,0 +1,50 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "services/common/evented_timer.h"
#include "util/attributes.h"
void WEAK evented_timer_init(void) {}
void WEAK evented_timer_clear_process_timers(PebbleTask task) {}
EventedTimerID WEAK evented_timer_register(uint32_t timeout_ms, bool repeating,
EventedTimerCallback callback, void* callback_data) {
return 0;
}
bool WEAK evented_timer_reschedule(EventedTimerID timer, uint32_t new_timeout_ms) {
return true;
}
EventedTimerID WEAK evented_timer_register_or_reschedule(
EventedTimerID timer_id, uint32_t timeout_ms, EventedTimerCallback callback, void *data) {
return 0;
}
void WEAK evented_timer_cancel(EventedTimerID timer) {}
bool WEAK evented_timer_exists(EventedTimerID timer) {
return true;
}
bool WEAK evented_timer_is_current_task(EventedTimerID timer) {
return true;
}
void WEAK evented_timer_reset(void) {}

View file

@ -0,0 +1,17 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stubs_events.h"

View file

@ -0,0 +1,28 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "kernel/events.h"
#include "util/attributes.h"
void WEAK event_put(PebbleEvent* event) { }
void WEAK event_put_from_app(PebbleEvent* event) { }
void WEAK event_put_from_process(PebbleTask task, PebbleEvent* event) { }
void WEAK event_reset_from_process_queue(PebbleTask task) { }

View file

@ -0,0 +1,71 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "stubs_dialog.h"
#include "applib/ui/window_stack.h"
#include "applib/ui/window_stack_private.h"
typedef struct ExpandableDialog {
Dialog dialog;
} ExpandableDialog;
ExpandableDialog *expandable_dialog_create(const char *dialog_name) {
return NULL;
}
ExpandableDialog *expandable_dialog_create_with_params(const char *dialog_name, uint32_t icon,
const char *text, GColor text_color,
GColor background_color,
DialogCallbacks *callbacks,
uint32_t select_icon,
ClickHandler select_click_handler) {
return NULL;
}
Dialog *expandable_dialog_get_dialog(ExpandableDialog *expandable_dialog) {
if (expandable_dialog == NULL) {
return NULL;
}
return &expandable_dialog->dialog;
}
void expandable_dialog_push(ExpandableDialog *expandable_dialog, WindowStack *window_stack) {
return;
}
void app_expandable_dialog_push(ExpandableDialog *expandable_dialog) {
}
void expandable_dialog_pop(ExpandableDialog *expandable_dialog) {
return;
}
void expandable_dialog_set_select_action(ExpandableDialog *expandable_dialog,
uint32_t resource_id,
ClickHandler select_click_handler) {
return;
}
void expandable_dialog_close_cb(ClickRecognizerRef recognizer, void *e_dialog) {
return;
}
void expandable_dialog_show_action_bar(ExpandableDialog *expandable_dialog,
bool show_action_bar) {
return;
}

View file

@ -0,0 +1,21 @@
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
bool bt_driver_supports_bt_classic(void) {
return false;
}

Some files were not shown because too many files have changed in this diff Show more