diff options
14 files changed, 156 insertions, 59 deletions
diff --git a/config/hiddenapi-private-dex.txt b/config/hiddenapi-private-dex.txt index 2c4865514c22..c3cf29a7a7b2 100644 --- a/config/hiddenapi-private-dex.txt +++ b/config/hiddenapi-private-dex.txt @@ -111065,11 +111065,11 @@ Lcom/android/internal/os/KernelCpuProcReader;->ERROR_THRESHOLD:I Lcom/android/internal/os/KernelCpuProcReader;->getActiveTimeReaderInstance()Lcom/android/internal/os/KernelCpuProcReader; Lcom/android/internal/os/KernelCpuProcReader;->getClusterTimeReaderInstance()Lcom/android/internal/os/KernelCpuProcReader; Lcom/android/internal/os/KernelCpuProcReader;->getFreqTimeReaderInstance()Lcom/android/internal/os/KernelCpuProcReader; -Lcom/android/internal/os/KernelCpuProcReader;->INITIAL_BUFFER_SIZE:I Lcom/android/internal/os/KernelCpuProcReader;->mActiveTimeReader:Lcom/android/internal/os/KernelCpuProcReader; Lcom/android/internal/os/KernelCpuProcReader;->MAX_BUFFER_SIZE:I -Lcom/android/internal/os/KernelCpuProcReader;->mBuffer:Ljava/nio/ByteBuffer; +Lcom/android/internal/os/KernelCpuProcReader;->mBuffer:[B Lcom/android/internal/os/KernelCpuProcReader;->mClusterTimeReader:Lcom/android/internal/os/KernelCpuProcReader; +Lcom/android/internal/os/KernelCpuProcReader;->mContentSize:I Lcom/android/internal/os/KernelCpuProcReader;->mErrors:I Lcom/android/internal/os/KernelCpuProcReader;->mFreqTimeReader:Lcom/android/internal/os/KernelCpuProcReader; Lcom/android/internal/os/KernelCpuProcReader;->mLastReadTime:J @@ -111079,7 +111079,6 @@ Lcom/android/internal/os/KernelCpuProcReader;->PROC_UID_ACTIVE_TIME:Ljava/lang/S Lcom/android/internal/os/KernelCpuProcReader;->PROC_UID_CLUSTER_TIME:Ljava/lang/String; Lcom/android/internal/os/KernelCpuProcReader;->PROC_UID_FREQ_TIME:Ljava/lang/String; Lcom/android/internal/os/KernelCpuProcReader;->readBytes()Ljava/nio/ByteBuffer; -Lcom/android/internal/os/KernelCpuProcReader;->resize()Z Lcom/android/internal/os/KernelCpuProcReader;->setThrottleInterval(J)V Lcom/android/internal/os/KernelCpuProcReader;->TAG:Ljava/lang/String; Lcom/android/internal/os/KernelCpuSpeedReader; diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java index ecf6f129f911..f85f35889aae 100644 --- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java +++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java @@ -199,8 +199,8 @@ public class AccessibilityServiceInfo implements Parcelable { * semantics in the context of the screen content. For example, a three by three * grid can be implemented as three horizontal linear layouts and one vertical, * or three vertical linear layouts and one horizontal, or one grid layout, etc. - * In this context the actual layout mangers used to achieve the grid configuration - * are not important, rather it is important that there are nine evenly distributed + * In this context, the actual layout managers used to achieve the grid configuration + * are not important; rather it is important that there are nine evenly distributed * elements. * </p> */ diff --git a/core/java/android/app/FragmentHostCallback.java b/core/java/android/app/FragmentHostCallback.java index b48817b1554d..b061301c34c3 100644 --- a/core/java/android/app/FragmentHostCallback.java +++ b/core/java/android/app/FragmentHostCallback.java @@ -52,7 +52,7 @@ public abstract class FragmentHostCallback<E> extends FragmentContainer { private ArrayMap<String, LoaderManager> mAllLoaderManagers; /** Whether or not fragment loaders should retain their state */ private boolean mRetainLoaders; - /** The loader manger for the fragment host [i.e. Activity#getLoaderManager()] */ + /** The loader manager for the fragment host [i.e. Activity#getLoaderManager()] */ private LoaderManagerImpl mLoaderManager; private boolean mCheckedForLoaderManager; /** Whether or not the fragment host loader manager was started */ diff --git a/core/java/android/hardware/location/NanoAppInstanceInfo.java b/core/java/android/hardware/location/NanoAppInstanceInfo.java index 75fb915708de..2db6a794fe9c 100644 --- a/core/java/android/hardware/location/NanoAppInstanceInfo.java +++ b/core/java/android/hardware/location/NanoAppInstanceInfo.java @@ -24,7 +24,7 @@ import android.os.Parcelable; import libcore.util.EmptyArray; /** - * Describes an instance of a nanoapp, used by the internal state manged by ContextHubService. + * Describes an instance of a nanoapp, used by the internal state managed by ContextHubService. * * TODO(b/69270990) Remove this class once the old API is deprecated. * diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index c94da9a12cad..3f9871f8de0a 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -867,13 +867,21 @@ public final class ContactsContract { */ protected interface ContactOptionsColumns { /** - * The number of times a contact has been contacted + * The number of times a contact has been contacted. + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field is obsolete. For + * more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page.</p> * <P>Type: INTEGER</P> */ public static final String TIMES_CONTACTED = "times_contacted"; /** * The last time a contact was contacted. + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field is obsolete. For + * more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page.</p> * <P>Type: INTEGER</P> */ public static final String LAST_TIME_CONTACTED = "last_time_contacted"; @@ -1692,6 +1700,11 @@ public final class ContactsContract { * TIMES_CONTACTED field is incremented by 1 and the LAST_TIME_CONTACTED * field is populated with the current system time. * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this method is obsolete. For + * more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. + * * @param resolver the ContentResolver to use * @param contactId the person who was contacted * @@ -1728,12 +1741,22 @@ public final class ContactsContract { * The content:// style URI for this table joined with useful data from * {@link ContactsContract.Data}, filtered to include only starred contacts * and the most frequently contacted contacts. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts + * results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. */ public static final Uri CONTENT_STREQUENT_URI = Uri.withAppendedPath( CONTENT_URI, "strequent"); /** * The content:// style URI for showing a list of frequently contacted people. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts + * results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. */ public static final Uri CONTENT_FREQUENT_URI = Uri.withAppendedPath( CONTENT_URI, "frequent"); @@ -1743,6 +1766,11 @@ public final class ContactsContract { * {@link #CONTENT_STREQUENT_URI} URI. The filter string will be used to match * various parts of the contact name. The filter argument should be passed * as an additional path segment after this URI. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts + * results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. */ public static final Uri CONTENT_STREQUENT_FILTER_URI = Uri.withAppendedPath( CONTENT_STREQUENT_URI, "filter"); @@ -4285,10 +4313,27 @@ public final class ContactsContract { * Columns in the Data_Usage_Stat table */ protected interface DataUsageStatColumns { - /** The last time (in milliseconds) this {@link Data} was used. */ + /** + * The last time (in milliseconds) this {@link Data} was used. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field is obsolete. For + * more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. + * + */ public static final String LAST_TIME_USED = "last_time_used"; - /** The number of times the referenced {@link Data} has been used. */ + /** + * The number of times the referenced {@link Data} has been used. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field is obsolete. For + * more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. + * + * + */ public static final String TIMES_USED = "times_used"; /** @hide Raw value. */ @@ -5257,7 +5302,14 @@ public final class ContactsContract { private PhoneLookup() {} /** - * The content:// style URI for this table. Append the phone number you want to lookup + * The content:// style URI for this table. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer + * sorts results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. + * + * Append the phone number you want to lookup * to this URI and query it to perform a lookup. For example: * <pre> * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, @@ -5270,6 +5322,11 @@ public final class ContactsContract { /** * <p>URI used for the "enterprise caller-id".</p> * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer + * sorts results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. + * * <p> * It supports the same semantics as {@link #CONTENT_FILTER_URI} and returns the same * columns. If the device has no corp profile that is linked to the current profile, it @@ -6065,14 +6122,24 @@ public final class ContactsContract { * records of MIME type {@link #CONTENT_ITEM_TYPE}. The filter is applied * to display names as well as phone numbers. The filter argument should be passed * as an additional path segment after this URI. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer + * sorts results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. */ public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI, "filter"); /** - * It supports the similar semantics as {@link #CONTENT_FILTER_URI} and returns the same - * columns. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in + * It supports the similar semantics as {@link #CONTENT_FILTER_URI} and returns the + * same columns. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in * parameters, otherwise it will throw IllegalArgumentException. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts + * results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. */ public static final Uri ENTERPRISE_CONTENT_FILTER_URI = Uri.withAppendedPath( CONTENT_URI, "filter_enterprise"); @@ -6239,7 +6306,7 @@ public final class ContactsContract { */ public static final class Email implements DataColumnsWithJoins, CommonColumns, ContactCounts { - /** + /* * This utility class cannot be instantiated */ private Email() {} @@ -6330,12 +6397,17 @@ public final class ContactsContract { Uri.withAppendedPath(CONTENT_URI, "lookup_enterprise"); /** - * <p> * The content:// style URL for email lookup using a filter. The filter returns * records of MIME type {@link #CONTENT_ITEM_TYPE}. The filter is applied * to display names as well as email addresses. The filter argument should be passed * as an additional path segment after this URI. * </p> + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer sorts + * results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page.</p> + * * <p>The query in the following example will return "Robert Parr (bob@incredibles.com)" * as well as "Bob Parr (incredible@android.com)". * <pre> @@ -6350,9 +6422,14 @@ public final class ContactsContract { "filter"); /** - * It supports the similar semantics as {@link #CONTENT_FILTER_URI} and returns the same - * columns. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in + * It supports the similar semantics as {@link #CONTENT_FILTER_URI} and returns the + * same columns. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in * parameters, otherwise it will throw IllegalArgumentException. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer + * sorts results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. */ public static final Uri ENTERPRISE_CONTENT_FILTER_URI = Uri.withAppendedPath( CONTENT_URI, "filter_enterprise"); @@ -7567,6 +7644,11 @@ public final class ContactsContract { /** * Similar to {@link Phone#CONTENT_FILTER_URI}, but allows users to filter callable * data. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer + * sorts results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. */ public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath(CONTENT_URI, "filter"); @@ -7575,6 +7657,11 @@ public final class ContactsContract { * Similar to {@link Phone#ENTERPRISE_CONTENT_FILTER_URI}, but allows users to filter * callable data. This URI requires {@link ContactsContract#DIRECTORY_PARAM_KEY} in * parameters, otherwise it will throw IllegalArgumentException. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer + * sorts results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page.</p> */ public static final Uri ENTERPRISE_CONTENT_FILTER_URI = Uri.withAppendedPath( CONTENT_URI, "filter_enterprise"); @@ -7599,8 +7686,13 @@ public final class ContactsContract { "contactables"); /** - * The content:// style URI for these data items, which allows for a query parameter to - * be appended onto the end to filter for data items matching the query. + * The content:// style URI for these data items, which allows for a query parameter + * to be appended onto the end to filter for data items matching the query. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this field no longer + * sorts results based on contacts frequency. For more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. */ public static final Uri CONTENT_FILTER_URI = Uri.withAppendedPath( Contactables.CONTENT_URI, "filter"); @@ -8249,11 +8341,15 @@ public final class ContactsContract { } /** - * <p> * API allowing applications to send usage information for each {@link Data} row to the * Contacts Provider. Applications can also clear all usage information. + * + * <p class="caution"><b>Caution: </b>As of January 7, 2019, this class is obsolete. For + * more information, see the + * <a href="/guide/topics/providers/contacts-provider#ObsoleteData">Contacts Provider</a> + * page. * </p> - * <p> + * * With the feedback, Contacts Provider may return more contextually appropriate results for * Data listing, typically supplied with * {@link ContactsContract.Contacts#CONTENT_FILTER_URI}, diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index de621e38a72b..501d7f1d97c9 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -11236,14 +11236,6 @@ public final class Settings { public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; /** - * Enable faster emergency phone call feature. - * The value is a boolean (1 or 0). - * @hide - */ - public static final String FASTER_EMERGENCY_PHONE_CALL_ENABLED = - "faster_emergency_phone_call_enabled"; - - /** * See RIL_PreferredNetworkType in ril.h * @hide */ diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java index 418b8953d68a..c4a3b7ab11af 100644 --- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java +++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java @@ -237,7 +237,6 @@ public class SettingsBackupTest { Settings.Global.EUICC_SUPPORTED_COUNTRIES, Settings.Global.EUICC_FACTORY_RESET_TIMEOUT_MILLIS, Settings.Global.FANCY_IME_ANIMATIONS, - Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED, Settings.Global.FORCE_ALLOW_ON_EXTERNAL, Settings.Global.FORCED_APP_STANDBY_ENABLED, Settings.Global.FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED, diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index 97d0a6ecd6a3..3151c2818d71 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -226,7 +226,7 @@ import java.util.Vector; * transfers the object to the <em>Prepared</em> state once the method call * returns, or a call to {@link #prepareAsync()} (asynchronous) which * first transfers the object to the <em>Preparing</em> state after the - * call returns (which occurs almost right way) while the internal + * call returns (which occurs almost right away) while the internal * player engine continues working on the rest of preparation work * until the preparation work completes. When the preparation completes or when {@link #prepare()} call returns, * the internal player engine then calls a user supplied callback method, diff --git a/media/java/android/media/projection/MediaProjectionManager.java b/media/java/android/media/projection/MediaProjectionManager.java index aa0d0cc090bc..900e3bb62fcf 100644 --- a/media/java/android/media/projection/MediaProjectionManager.java +++ b/media/java/android/media/projection/MediaProjectionManager.java @@ -66,7 +66,7 @@ public final class MediaProjectionManager { } /** - * Returns an Intent that <b>must</b> passed to startActivityForResult() + * Returns an Intent that <b>must</b> be passed to startActivityForResult() * in order to start screen capture. The activity will prompt * the user whether to allow screen capture. The result of this * activity should be passed to getMediaProjection. diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index 00758e8e1297..897ab88215ef 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -101,7 +101,7 @@ import java.util.List; * is provisioned. */ class GlobalActionsDialog implements DialogInterface.OnDismissListener, - DialogInterface.OnClickListener { + DialogInterface.OnClickListener, DialogInterface.OnShowListener { static public final String SYSTEM_DIALOG_REASON_KEY = "reason"; static public final String SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS = "globalactions"; @@ -318,8 +318,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, ArraySet<String> addedKeys = new ArraySet<String>(); mHasLogoutButton = false; mHasLockdownButton = false; - mSeparatedEmergencyButtonEnabled = Settings.Global.getInt(mContext.getContentResolver(), - Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED, 0) != 0; + mSeparatedEmergencyButtonEnabled = true; for (int i = 0; i < defaultActions.length; i++) { String actionKey = defaultActions[i]; if (addedKeys.contains(actionKey)) { @@ -398,6 +397,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, dialog.setKeyguardShowing(mKeyguardShowing); dialog.setOnDismissListener(this); + dialog.setOnShowListener(this); return dialog; } @@ -456,6 +456,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, @Override public void onPress() { + MetricsLogger.action(mContext, MetricsEvent.ACTION_EMERGENCY_DIALER_FROM_POWER_MENU); Intent intent = new Intent(EmergencyDialerConstants.ACTION_DIAL); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra(EmergencyDialerConstants.EXTRA_ENTRY_TYPE, @@ -862,6 +863,11 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, item.onPress(); } + /** {@inheritDoc} */ + public void onShow(DialogInterface dialog) { + MetricsLogger.visible(mContext, MetricsEvent.POWER_MENU); + } + /** * The adapter used for the list within the global actions dialog, taking * into account whether the keyguard is showing via diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto index b990175fd616..d79d833f2233 100644 --- a/proto/src/metrics_constants.proto +++ b/proto/src/metrics_constants.proto @@ -6482,6 +6482,16 @@ message MetricsEvent { // OS: Q FIELD_EMERGENCY_DIALER_SHORTCUT_TAPS_INTERVAL = 1567; + // OPEN: Power menu is opened + // CATEGORY: GLOBAL_SYSTEM_UI + // OS: Q + POWER_MENU = 1568; + + // ACTION: User tapped emergency dialer icon in the power menu. + // CATEGORY: GLOBAL_SYSTEM_UI + // OS: Q + ACTION_EMERGENCY_DIALER_FROM_POWER_MENU = 1569; + // ---- End Q Constants, all Q constants go above this line ---- // Add new aosp constants above this line. diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java index b71d7a726b28..da52d408e125 100644 --- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java +++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java @@ -1834,7 +1834,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku if (provider.widgets.isEmpty()) { // cancel the future updates - cancelBroadcasts(provider); + cancelBroadcastsLocked(provider); // send the broacast saying that the provider is not in use any more sendDisabledIntentLocked(provider); @@ -1843,18 +1843,16 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku } } - private void cancelBroadcasts(Provider provider) { + private void cancelBroadcastsLocked(Provider provider) { if (DEBUG) { - Slog.i(TAG, "cancelBroadcasts() for " + provider); + Slog.i(TAG, "cancelBroadcastsLocked() for " + provider); } if (provider.broadcast != null) { - mAlarmManager.cancel(provider.broadcast); - long token = Binder.clearCallingIdentity(); - try { - provider.broadcast.cancel(); - } finally { - Binder.restoreCallingIdentity(token); - } + final PendingIntent broadcast = provider.broadcast; + mSaveStateHandler.post(() -> { + mAlarmManager.cancel(broadcast); + broadcast.cancel(); + }); provider.broadcast = null; } } @@ -2315,7 +2313,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku mProviders.remove(provider); // no need to send the DISABLE broadcast, since the receiver is gone anyway - cancelBroadcasts(provider); + cancelBroadcastsLocked(provider); } private void sendEnableIntentLocked(Provider p) { @@ -2369,17 +2367,14 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku Binder.restoreCallingIdentity(token); } if (!alreadyRegistered) { - long period = provider.info.updatePeriodMillis; - if (period < MIN_UPDATE_PERIOD) { - period = MIN_UPDATE_PERIOD; - } - final long oldId = Binder.clearCallingIdentity(); - try { + // Set the alarm outside of our locks; we've latched the first-time + // invariant and established the PendingIntent safely. + final long period = Math.max(provider.info.updatePeriodMillis, MIN_UPDATE_PERIOD); + final PendingIntent broadcast = provider.broadcast; + mSaveStateHandler.post(() -> mAlarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, - SystemClock.elapsedRealtime() + period, period, provider.broadcast); - } finally { - Binder.restoreCallingIdentity(oldId); - } + SystemClock.elapsedRealtime() + period, period, broadcast) + ); } } } @@ -3382,7 +3377,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku // Reschedule for the new updatePeriodMillis (don't worry about handling // it specially if updatePeriodMillis didn't change because we just sent // an update, and the next one will be updatePeriodMillis from now). - cancelBroadcasts(provider); + cancelBroadcastsLocked(provider); registerForBroadcastsLocked(provider, appWidgetIds); // If it's currently showing, call back with the new // AppWidgetProviderInfo. diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index a6ec3cff1b2c..0190e15d7fdc 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -71,7 +71,7 @@ import java.util.List; import java.util.Set; /** - * This class contains the accessibility related logic of the window manger. + * This class contains the accessibility related logic of the window manager. */ final class AccessibilityController { diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index fc32b177e8dc..e39c0032ed31 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -71,7 +71,7 @@ import java.util.concurrent.ConcurrentHashMap; * See {@link PhoneAccount} and {@link TelecomManager#registerPhoneAccount} for more information. * <p> * System managed {@link ConnectionService}s must be enabled by the user in the phone app settings - * before Telecom will bind to them. Self-manged {@link ConnectionService}s must be granted the + * before Telecom will bind to them. Self-managed {@link ConnectionService}s must be granted the * appropriate permission before Telecom will bind to them. * <p> * Once registered and enabled by the user in the phone app settings or granted permission, telecom |