Deprecate Looper.prepareMainLooper

Applications don't need to call this method.

Bug: 144042891
Test: No behavior changes
Change-Id: I0aab8619cd9afc6b672ae163fba9d17c797c9f26
This commit is contained in:
Charles Munger
2019-11-15 11:14:10 -08:00
parent 8e54615a36
commit 0ee2b879b6
2 changed files with 6 additions and 4 deletions

View File

@@ -34671,7 +34671,7 @@ package android.os {
method @Nullable public static android.os.Looper myLooper();
method @NonNull public static android.os.MessageQueue myQueue();
method public static void prepare();
method public static void prepareMainLooper();
method @Deprecated public static void prepareMainLooper();
method public void quit();
method public void quitSafely();
method public void setMessageLogging(@Nullable android.util.Printer);

View File

@@ -112,10 +112,12 @@ public final class Looper {
/**
* Initialize the current thread as a looper, marking it as an
* application's main looper. The main looper for your application
* is created by the Android environment, so you should never need
* to call this function yourself. See also: {@link #prepare()}
* application's main looper. See also: {@link #prepare()}
*
* @deprecated The main looper for your application is created by the Android environment,
* so you should never need to call this function yourself.
*/
@Deprecated
public static void prepareMainLooper() {
prepare(false);
synchronized (Looper.class) {