Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab6a8e1f authored by Justin Klaassen's avatar Justin Klaassen
Browse files

Cleanup exported APIs

Bug: 30076796

- Removed preliminary support for deeplinks since Clock doesn't have a
  public content provider.
- Removed unnecessarily exported intent actions since Intents
  specifying explicit components don't need to register specific
  actions.
- Removed unused strings and resources.

Change-Id: Ifbee006dbd752ecdcfe0125cabe19ffda40ea659
parent 1791cebc
Loading
Loading
Loading
Loading
+139 −207
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2015 The Android Open Source Project
  Copyright (C) 2016 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.android.deskclock"
    android:versionCode="460"
    android:versionName="4.6.0">
@@ -53,11 +52,9 @@
        android:requiredForAllUsers="true"
        android:supportsRtl="true">

        <provider
            android:name=".provider.ClockProvider"
            android:authorities="com.android.deskclock"
            android:directBootAware="true"
            android:exported="false" />
        <!-- ============================================================== -->
        <!-- Main app components.                                           -->
        <!-- ============================================================== -->

        <activity
            android:name=".DeskClock"
@@ -67,33 +64,9 @@
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity-alias
            android:name=".DockClock"
            android:enabled="false"
            android:label="@string/app_label"
            android:launchMode="singleTask"
            android:targetActivity="DeskClock"
            android:theme="@style/DeskClockTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.DESK_DOCK" />
            </intent-filter>
        </activity-alias>

        <activity
            android:name=".settings.SettingsActivity"
            android:excludeFromRecents="true"
            android:label="@string/settings"
            android:taskAffinity=""
            android:theme="@style/SettingsTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

@@ -101,166 +74,195 @@
            android:name=".worldclock.CitySelectionActivity"
            android:excludeFromRecents="true"
            android:label="@string/cities_activity_title"
            android:parentActivityName=".DeskClock"
            android:taskAffinity=""
            android:theme="@style/CitiesTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>
            android:theme="@style/CitiesTheme" />

        <activity
            android:name=".alarms.AlarmActivity"
            android:directBootAware="true"
            android:name=".settings.SettingsActivity"
            android:excludeFromRecents="true"
            android:resizeableActivity="false"
            android:showOnLockScreen="true"
            android:label="@string/settings"
            android:parentActivityName=".DeskClock"
            android:taskAffinity=""
            android:theme="@style/AlarmAlertFullScreenTheme"
            android:windowSoftInputMode="stateAlwaysHidden" />
            android:theme="@style/SettingsTheme" />

        <activity
            android:name=".ScreensaverActivity"
            android:name=".HandleShortcuts"
            android:excludeFromRecents="true"
            android:resizeableActivity="false"
            android:launchMode="singleInstance"
            android:taskAffinity=""
            android:theme="@style/ScreensaverActivityTheme" />
            android:theme="@android:style/Theme.NoDisplay" />

        <receiver
            android:name=".alarms.AlarmStateManager"
            android:directBootAware="true"
            android:exported="false" />

        <service
            android:name=".alarms.AlarmService"
            android:directBootAware="true"
            android:exported="false" />
        <!-- ============================================================== -->
        <!-- AlarmClock API components.                                     -->
        <!-- ============================================================== -->

        <activity
            android:name=".HandleApiCalls"
            android:excludeFromRecents="true"
            android:launchMode="singleTask"
            android:permission="com.android.alarm.permission.SET_ALARM"
            android:launchMode="singleInstance"
            android:taskAffinity=""
            android:theme="@android:style/Theme.NoDisplay">
            <intent-filter>
                <action android:name="android.intent.action.SET_ALARM" />
                <action android:name="android.intent.action.SHOW_ALARMS" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.DISMISS_ALARM" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SNOOZE_ALARM" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
        </activity>

        <activity-alias
            android:name=".HandleSetAlarmApiCalls"
            android:permission="com.android.alarm.permission.SET_ALARM"
            android:targetActivity=".HandleApiCalls">
            <intent-filter>
                <action android:name="android.intent.action.SHOW_ALARMS" />
                <action android:name="android.intent.action.SET_ALARM" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SET_TIMER" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
        </activity>
        </activity-alias>

        <activity-alias
            android:name="HandleSetAlarm"
            android:exported="true"
            android:targetActivity=".HandleApiCalls" />
        <!-- ============================================================== -->
        <!-- Alarm components.                                              -->
        <!-- ============================================================== -->

        <activity
            android:name=".HandleDeskClockApiCalls"
            android:name=".alarms.AlarmActivity"
            android:directBootAware="true"
            android:excludeFromRecents="true"
            android:launchMode="singleTask"
            android:permission="com.android.alarm.permission.SET_ALARM"
            android:resizeableActivity="false"
            android:showOnLockScreen="true"
            android:taskAffinity=""
            android:theme="@android:style/Theme.NoDisplay">
            <intent-filter>
                <action android:name="com.android.deskclock.action.SHOW_CLOCK" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.ADD_CLOCK" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.DELETE_CLOCK" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.START_TIMER" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.RESET_TIMER" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.PAUSE_TIMER" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.SHOW_TIMERS" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.DELETE_TIMER" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.SHOW_STOPWATCH" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.START_STOPWATCH" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.PAUSE_STOPWATCH" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.LAP_STOPWATCH" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.deskclock.action.RESET_STOPWATCH" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
        </activity>
            android:theme="@style/AlarmAlertFullScreenTheme"
            android:windowSoftInputMode="stateAlwaysHidden" />

        <activity
            android:name=".AlarmSelectionActivity"
            android:label="@string/dismiss_alarm"
            android:theme="@android:style/Theme.Holo.Light.Dialog.NoActionBar" />

        <provider
            android:name=".provider.ClockProvider"
            android:authorities="com.android.deskclock"
            android:directBootAware="true"
            android:exported="false" />

        <receiver
            android:name=".AlarmInitReceiver"
            android:directBootAware="true">
            <intent-filter>
                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.TIME_SET" />
                <action android:name="android.intent.action.TIMEZONE_CHANGED" />
                <action android:name="android.intent.action.LOCALE_CHANGED" />
                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
                <action android:name="android.intent.action.TIME_SET" />
                <action android:name="android.intent.action.TIMEZONE_CHANGED" />
            </intent-filter>
        </receiver>

        <receiver
            android:name=".alarms.AlarmStateManager"
            android:directBootAware="true" />

        <service
            android:name=".alarms.AlarmService"
            android:directBootAware="true" />

        <!-- ============================================================== -->
        <!-- Timer components.                                              -->
        <!-- ============================================================== -->

        <activity
            android:name=".timer.ExpiredTimersActivity"
            android:configChanges="screenSize|keyboardHidden|keyboard|navigation"
            android:directBootAware="true"
            android:excludeFromRecents="true"
            android:launchMode="singleInstance"
            android:resizeableActivity="false"
            android:showOnLockScreen="true"
            android:taskAffinity=""
            android:theme="@style/ExpiredTimersActivityTheme" />

        <!-- Legacy broadcast receiver that honors old scheduled timers across app upgrade. -->
        <receiver
            android:name="com.android.deskclock.timer.TimerReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="times_up" />
            </intent-filter>
        </receiver>

        <service
            android:name=".timer.TimerService"
            android:description="@string/timer_service_desc"
            android:directBootAware="true" />

        <!-- ============================================================== -->
        <!-- Stopwatch components.                                          -->
        <!-- ============================================================== -->

        <service
            android:name=".stopwatch.StopwatchService"
            android:description="@string/stopwatch_service_desc"
            android:directBootAware="true" />


        <!-- ============================================================== -->
        <!-- Screen saver components.                                       -->
        <!-- ============================================================== -->

        <activity
            android:name=".ScreensaverActivity"
            android:excludeFromRecents="true"
            android:resizeableActivity="false"
            android:taskAffinity=""
            android:theme="@style/ScreensaverActivityTheme" />

        <activity
            android:name=".settings.ScreensaverSettingsActivity"
            android:excludeFromRecents="true"
            android:label="@string/screensaver_settings"
            android:taskAffinity=""
            android:theme="@style/SettingsTheme" />

        <service
            android:name=".Screensaver"
            android:label="@string/app_label"
            android:permission="android.permission.BIND_DREAM_SERVICE">
            <intent-filter>
                <action android:name="android.service.dreams.DreamService" />
                <action android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data
                android:name="android.service.dream"
                android:resource="@xml/screensaver_info" />
        </service>

        <!-- ============================================================== -->
        <!-- App widget components.                                         -->
        <!-- ============================================================== -->

        <receiver
            android:name="com.android.alarmclock.AnalogAppWidgetProvider"
            android:label="@string/analog_gadget">
@@ -298,77 +300,7 @@

        <service
            android:name="com.android.alarmclock.DigitalAppWidgetCityService"
            android:exported="false"
            android:permission="android.permission.BIND_REMOTEVIEWS" />

        <!-- Screen saver implementation -->
        <service
            android:name=".Screensaver"
            android:exported="true"
            android:label="@string/app_label"
            android:permission="android.permission.BIND_DREAM_SERVICE">
            <intent-filter>
                <action android:name="android.service.dreams.DreamService" />
                <action android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data
                android:name="android.service.dream"
                android:resource="@xml/screensaver_info" />
        </service>

        <!-- Settings activity for screensaver -->
        <activity
            android:name=".settings.ScreensaverSettingsActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:label="@string/screensaver_settings"
            android:taskAffinity=""
            android:theme="@style/SettingsTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>

        <activity
            android:name=".AlarmSelectionActivity"
            android:label="@string/dismiss_alarm"
            android:theme="@android:style/Theme.Holo.Light.Dialog.NoActionBar" />

        <!-- This activity displays only the timers that have expired with only a reset button
         present. This makes the activity appropriate for display above the lock screen so that
         users have the limited ability to silence expired timers but nothing else. -->
        <activity
            android:name=".timer.ExpiredTimersActivity"
            android:configChanges="screenSize|keyboardHidden|keyboard|navigation"
            android:excludeFromRecents="true"
            android:launchMode="singleInstance"
            android:resizeableActivity="false"
            android:showOnLockScreen="true"
            android:taskAffinity=""
            android:theme="@style/ExpiredTimersActivityTheme" />

        <!-- Legacy broadcast receiver that honors old scheduled timers across app upgrade. -->
        <receiver android:name="com.android.deskclock.timer.TimerReceiver"
                  android:exported="false">
            <intent-filter>
                <action android:name="times_up" />
            </intent-filter>
        </receiver>

        <service
            android:name=".timer.TimerService"
            android:description="@string/timer_service_desc"
            android:directBootAware="true"
            android:exported="false"
            tools:ignore="ManifestResource" />

        <service
            android:name=".stopwatch.StopwatchService"
            android:description="@string/stopwatch_service_desc"
            android:directBootAware="true"
            android:exported="false"
            tools:ignore="ManifestResource" />

    </application>
</manifest>
+1 −4
Original line number Diff line number Diff line
@@ -17,9 +17,6 @@
<!-- These resources are around just to allow their values to be customized
     for different hardware and product builds. -->
<resources>
    <dimen name="ampm_text_size">32dip</dimen>
    <dimen name="date_text_size">15sp</dimen>
    <dimen name="next_alarm_text_size">15sp</dimen>
    <dimen name="time_margin_top">24dip</dimen>

    <dimen name="dialpad_font_size">24sp</dimen>
+1 −5
Original line number Diff line number Diff line
@@ -17,14 +17,10 @@
<!-- These resources are around just to allow their values to be customized
     for different hardware and product builds. -->
<resources>
    <dimen name="ampm_text_size">90dip</dimen>
    <dimen name="date_text_size">15sp</dimen>
    <dimen name="next_alarm_text_size">15sp</dimen>
    <dimen name="time_margin_top">32dip</dimen>

    <dimen name="dialpad_font_size">42sp</dimen>
    <dimen name="timer_setup_font_size">78sp</dimen>
    <dimen name="timer_setup_button_size">36sp</dimen>
    <dimen name="timer_setup_delete_margin">19sp</dimen>

    <!-- Size of margin for circles. -->
+1 −13
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@
     for different hardware and product builds. -->
<resources>
    <dimen name="label_text_size">18sp</dimen>
    <dimen name="ampm_text_size">54dip</dimen>
    <dimen name="date_text_size">15sp</dimen>
    <dimen name="next_alarm_text_size">15sp</dimen>
    <dimen name="time_margin_top">48dip</dimen>
    <dimen name="screensaver_margin">20dip</dimen>
    <dimen name="alarm_label_padding">64dip</dimen>
@@ -34,7 +31,6 @@
    <dimen name="medium_font_size">96sp</dimen>
    <dimen name="label_font_size">18sp</dimen>
    <dimen name="alarm_label_size">18sp</dimen>
    <dimen name="body_font_size">20sp</dimen>
    <dimen name="day_button_font_size">20sp</dimen>
    <dimen name="alarm_info_font_size">48sp</dimen>
    <dimen name="no_alarm_font_size">20sp</dimen>
@@ -44,18 +40,13 @@
    <dimen name="fab_alarm_size">80dp</dimen>

    <dimen name="body_font_padding">8dp</dimen>
    <dimen name="medium_font_padding">24dp</dimen>

    <dimen name="small_space">32dp</dimen>
    <dimen name="medium_space_top">46dp</dimen>
    <dimen name="medium_space_bottom">18dp</dimen>

    <dimen name="label_margin_big">8dp</dimen>
    <dimen name="label_margin_small">4dp</dimen>

    <dimen name="dialpad_font_size">56sp</dimen>
    <dimen name="timer_setup_font_size">86sp</dimen>
    <dimen name="timer_setup_button_size">36sp</dimen>
    <dimen name="timer_setup_delete_margin">21sp</dimen>

    <!-- Specified in sp to match the top margin of the time on the adjacent world clock tab. -->
@@ -65,9 +56,6 @@
    <dimen name="circle_margin_top">48dp</dimen>
    <dimen name="analog_clock_margin">96dp</dimen>

     <!-- Width of the clock, for use with alarm buttons. -->
    <dimen name="alarm_alert_display_width">550dip</dimen>

    <!-- Size of analog clock in world clock. -->
    <dimen name="world_clock_analog_size">200dp</dimen>

+1 −2
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
<resources>

    <dimen name="timer_setup_font_size">78sp</dimen>
    <dimen name="timer_setup_button_size">36sp</dimen>
    <dimen name="timer_setup_delete_margin">19sp</dimen>

</resources>
Loading