Loading api/current.txt +13 −2 Original line number Original line Diff line number Diff line Loading @@ -8595,19 +8595,26 @@ package android.content.pm { } } public class LauncherApps { public class LauncherApps { method public void addCallback(android.content.pm.LauncherApps.Callback); method public void addCallback(android.content.pm.LauncherApps.Callback, android.os.Handler); method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback); method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback); method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback, android.os.Handler); method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback, android.os.Handler); method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle); method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle); method public boolean isActivityEnabled(android.content.ComponentName, android.os.UserHandle); method public boolean isActivityEnabledForProfile(android.content.ComponentName, android.os.UserHandle); method public boolean isActivityEnabledForProfile(android.content.ComponentName, android.os.UserHandle); method public boolean isPackageEnabled(java.lang.String, android.os.UserHandle); method public boolean isPackageEnabledForProfile(java.lang.String, android.os.UserHandle); method public boolean isPackageEnabledForProfile(java.lang.String, android.os.UserHandle); method public void removeCallback(android.content.pm.LauncherApps.Callback); method public void removeOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback); method public void removeOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback); method public android.content.pm.LauncherActivityInfo resolveActivity(android.content.Intent, android.os.UserHandle); method public android.content.pm.LauncherActivityInfo resolveActivity(android.content.Intent, android.os.UserHandle); method public void showAppDetailsForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void showAppDetailsForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startActivityForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startActivityForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startAppDetailsActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startMainActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); } } public static abstract class LauncherApps.OnAppsChangedCallback { public static abstract class LauncherApps.Callback { ctor public LauncherApps.OnAppsChangedCallback(); ctor public LauncherApps.Callback(); method public abstract void onPackageAdded(java.lang.String, android.os.UserHandle); method public abstract void onPackageAdded(java.lang.String, android.os.UserHandle); method public abstract void onPackageChanged(java.lang.String, android.os.UserHandle); method public abstract void onPackageChanged(java.lang.String, android.os.UserHandle); method public abstract void onPackageRemoved(java.lang.String, android.os.UserHandle); method public abstract void onPackageRemoved(java.lang.String, android.os.UserHandle); Loading @@ -8615,6 +8622,10 @@ package android.content.pm { method public abstract void onPackagesUnavailable(java.lang.String[], android.os.UserHandle, boolean); method public abstract void onPackagesUnavailable(java.lang.String[], android.os.UserHandle, boolean); } } public static abstract class LauncherApps.OnAppsChangedCallback extends android.content.pm.LauncherApps.Callback { ctor public LauncherApps.OnAppsChangedCallback(); } public class PackageInfo implements android.os.Parcelable { public class PackageInfo implements android.os.Parcelable { ctor public PackageInfo(); ctor public PackageInfo(); method public int describeContents(); method public int describeContents(); core/java/android/content/pm/LauncherApps.java +57 −16 Original line number Original line Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class LauncherApps { /** /** * Callbacks for package changes to this and related managed profiles. * Callbacks for package changes to this and related managed profiles. */ */ public static abstract class OnAppsChangedCallback { public static abstract class Callback { /** /** * Indicates that a package was removed from the specified profile. * Indicates that a package was removed from the specified profile. * * Loading Loading @@ -207,17 +207,17 @@ public class LauncherApps { } } /** /** * Starts an activity in the specified profile. * Starts a Main activity in the specified profile. * * * @param component The ComponentName of the activity to launch * @param component The ComponentName of the activity to launch * @param user The UserHandle of the profile * @param user The UserHandle of the profile * @param sourceBounds The Rect containing the source bounds of the clicked icon * @param sourceBounds The Rect containing the source bounds of the clicked icon * @param opts Options to pass to startActivity * @param opts Options to pass to startActivity */ */ public void startActivityForProfile(ComponentName component, UserHandle user, Rect sourceBounds, public void startMainActivity(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { Bundle opts) { if (DEBUG) { if (DEBUG) { Log.i(TAG, "StartActivityForProfile " + component + " " + user.getIdentifier()); Log.i(TAG, "StartMainActivity " + component + " " + user.getIdentifier()); } } try { try { mService.startActivityAsUser(component, sourceBounds, opts, user); mService.startActivityAsUser(component, sourceBounds, opts, user); Loading @@ -235,7 +235,7 @@ public class LauncherApps { * @param sourceBounds The Rect containing the source bounds of the clicked icon * @param sourceBounds The Rect containing the source bounds of the clicked icon * @param opts Options to pass to startActivity * @param opts Options to pass to startActivity */ */ public void showAppDetailsForProfile(ComponentName component, UserHandle user, public void startAppDetailsActivity(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { Rect sourceBounds, Bundle opts) { try { try { mService.showAppDetailsAsUser(component, sourceBounds, opts, user); mService.showAppDetailsAsUser(component, sourceBounds, opts, user); Loading @@ -252,7 +252,7 @@ public class LauncherApps { * * * @return true if the package exists and is enabled. * @return true if the package exists and is enabled. */ */ public boolean isPackageEnabledForProfile(String packageName, UserHandle user) { public boolean isPackageEnabled(String packageName, UserHandle user) { try { try { return mService.isPackageEnabled(packageName, user); return mService.isPackageEnabled(packageName, user); } catch (RemoteException re) { } catch (RemoteException re) { Loading @@ -268,7 +268,7 @@ public class LauncherApps { * * * @return true if the activity exists and is enabled. * @return true if the activity exists and is enabled. */ */ public boolean isActivityEnabledForProfile(ComponentName component, UserHandle user) { public boolean isActivityEnabled(ComponentName component, UserHandle user) { try { try { return mService.isActivityEnabled(component, user); return mService.isActivityEnabled(component, user); } catch (RemoteException re) { } catch (RemoteException re) { Loading @@ -282,8 +282,8 @@ public class LauncherApps { * * * @param callback The callback to add. * @param callback The callback to add. */ */ public void addOnAppsChangedCallback(OnAppsChangedCallback callback) { public void addCallback(Callback callback) { addOnAppsChangedCallback(callback, null); addCallback(callback, null); } } /** /** Loading @@ -292,7 +292,7 @@ public class LauncherApps { * @param callback The callback to add. * @param callback The callback to add. * @param handler that should be used to post callbacks on, may be null. * @param handler that should be used to post callbacks on, may be null. */ */ public void addOnAppsChangedCallback(OnAppsChangedCallback callback, Handler handler) { public void addCallback(Callback callback, Handler handler) { synchronized (this) { synchronized (this) { if (callback != null && !mCallbacks.contains(callback)) { if (callback != null && !mCallbacks.contains(callback)) { boolean addedFirstCallback = mCallbacks.size() == 0; boolean addedFirstCallback = mCallbacks.size() == 0; Loading @@ -311,9 +311,9 @@ public class LauncherApps { * Removes a callback that was previously added. * Removes a callback that was previously added. * * * @param callback The callback to remove. * @param callback The callback to remove. * @see #addOnAppsChangedListener(OnAppsChangedCallback) * @see #addCallback(Callback) */ */ public void removeOnAppsChangedCallback(OnAppsChangedCallback callback) { public void removeCallback(Callback callback) { synchronized (this) { synchronized (this) { removeCallbackLocked(callback); removeCallbackLocked(callback); if (mCallbacks.size() == 0) { if (mCallbacks.size() == 0) { Loading @@ -325,7 +325,7 @@ public class LauncherApps { } } } } private void removeCallbackLocked(OnAppsChangedCallback callback) { private void removeCallbackLocked(Callback callback) { if (callback == null) { if (callback == null) { throw new IllegalArgumentException("Callback cannot be null"); throw new IllegalArgumentException("Callback cannot be null"); } } Loading @@ -338,7 +338,7 @@ public class LauncherApps { } } } } private void addCallbackLocked(OnAppsChangedCallback callback, Handler handler) { private void addCallbackLocked(Callback callback, Handler handler) { // Remove if already present. // Remove if already present. removeCallbackLocked(callback); removeCallbackLocked(callback); if (handler == null) { if (handler == null) { Loading Loading @@ -421,7 +421,7 @@ public class LauncherApps { private static final int MSG_AVAILABLE = 4; private static final int MSG_AVAILABLE = 4; private static final int MSG_UNAVAILABLE = 5; private static final int MSG_UNAVAILABLE = 5; private OnAppsChangedCallback mCallback; private LauncherApps.Callback mCallback; private static class CallbackInfo { private static class CallbackInfo { String[] packageNames; String[] packageNames; Loading @@ -430,7 +430,7 @@ public class LauncherApps { UserHandle user; UserHandle user; } } public CallbackMessageHandler(Looper looper, OnAppsChangedCallback callback) { public CallbackMessageHandler(Looper looper, LauncherApps.Callback callback) { super(looper, null, true); super(looper, null, true); mCallback = callback; mCallback = callback; } } Loading Loading @@ -499,4 +499,45 @@ public class LauncherApps { obtainMessage(MSG_UNAVAILABLE, info).sendToTarget(); obtainMessage(MSG_UNAVAILABLE, info).sendToTarget(); } } } } /** Remove after unbundled apps have migrated STOP SHIP */ public static abstract class OnAppsChangedCallback extends Callback { } /** Remove after unbundled apps have migrated STOP SHIP */ public void addOnAppsChangedCallback(OnAppsChangedCallback callback) { addCallback(callback, null); } /** Remove after unbundled apps have migrated STOP SHIP */ public void addOnAppsChangedCallback(OnAppsChangedCallback callback, Handler handler) { addCallback(callback, handler); } /** Remove after unbundled apps have migrated STOP SHIP */ public void removeOnAppsChangedCallback(OnAppsChangedCallback callback) { removeCallback(callback); } /** Remove after unbundled apps have migrated STOP SHIP */ public void startActivityForProfile(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { startMainActivity(component, user, sourceBounds, opts); } /** Remove after unbundled apps have migrated STOP SHIP */ public void showAppDetailsForProfile(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { startAppDetailsActivity(component, user, sourceBounds, opts); } /** Remove after unbundled apps have migrated STOP SHIP */ public boolean isPackageEnabledForProfile(String packageName, UserHandle user) { return isPackageEnabled(packageName, user); } /** Remove after unbundled apps have migrated STOP SHIP */ public boolean isActivityEnabledForProfile(ComponentName component, UserHandle user) { return isActivityEnabled(component, user); } } } Loading
api/current.txt +13 −2 Original line number Original line Diff line number Diff line Loading @@ -8595,19 +8595,26 @@ package android.content.pm { } } public class LauncherApps { public class LauncherApps { method public void addCallback(android.content.pm.LauncherApps.Callback); method public void addCallback(android.content.pm.LauncherApps.Callback, android.os.Handler); method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback); method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback); method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback, android.os.Handler); method public void addOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback, android.os.Handler); method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle); method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle); method public boolean isActivityEnabled(android.content.ComponentName, android.os.UserHandle); method public boolean isActivityEnabledForProfile(android.content.ComponentName, android.os.UserHandle); method public boolean isActivityEnabledForProfile(android.content.ComponentName, android.os.UserHandle); method public boolean isPackageEnabled(java.lang.String, android.os.UserHandle); method public boolean isPackageEnabledForProfile(java.lang.String, android.os.UserHandle); method public boolean isPackageEnabledForProfile(java.lang.String, android.os.UserHandle); method public void removeCallback(android.content.pm.LauncherApps.Callback); method public void removeOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback); method public void removeOnAppsChangedCallback(android.content.pm.LauncherApps.OnAppsChangedCallback); method public android.content.pm.LauncherActivityInfo resolveActivity(android.content.Intent, android.os.UserHandle); method public android.content.pm.LauncherActivityInfo resolveActivity(android.content.Intent, android.os.UserHandle); method public void showAppDetailsForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void showAppDetailsForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startActivityForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startActivityForProfile(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startAppDetailsActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startMainActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); } } public static abstract class LauncherApps.OnAppsChangedCallback { public static abstract class LauncherApps.Callback { ctor public LauncherApps.OnAppsChangedCallback(); ctor public LauncherApps.Callback(); method public abstract void onPackageAdded(java.lang.String, android.os.UserHandle); method public abstract void onPackageAdded(java.lang.String, android.os.UserHandle); method public abstract void onPackageChanged(java.lang.String, android.os.UserHandle); method public abstract void onPackageChanged(java.lang.String, android.os.UserHandle); method public abstract void onPackageRemoved(java.lang.String, android.os.UserHandle); method public abstract void onPackageRemoved(java.lang.String, android.os.UserHandle); Loading @@ -8615,6 +8622,10 @@ package android.content.pm { method public abstract void onPackagesUnavailable(java.lang.String[], android.os.UserHandle, boolean); method public abstract void onPackagesUnavailable(java.lang.String[], android.os.UserHandle, boolean); } } public static abstract class LauncherApps.OnAppsChangedCallback extends android.content.pm.LauncherApps.Callback { ctor public LauncherApps.OnAppsChangedCallback(); } public class PackageInfo implements android.os.Parcelable { public class PackageInfo implements android.os.Parcelable { ctor public PackageInfo(); ctor public PackageInfo(); method public int describeContents(); method public int describeContents();
core/java/android/content/pm/LauncherApps.java +57 −16 Original line number Original line Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class LauncherApps { /** /** * Callbacks for package changes to this and related managed profiles. * Callbacks for package changes to this and related managed profiles. */ */ public static abstract class OnAppsChangedCallback { public static abstract class Callback { /** /** * Indicates that a package was removed from the specified profile. * Indicates that a package was removed from the specified profile. * * Loading Loading @@ -207,17 +207,17 @@ public class LauncherApps { } } /** /** * Starts an activity in the specified profile. * Starts a Main activity in the specified profile. * * * @param component The ComponentName of the activity to launch * @param component The ComponentName of the activity to launch * @param user The UserHandle of the profile * @param user The UserHandle of the profile * @param sourceBounds The Rect containing the source bounds of the clicked icon * @param sourceBounds The Rect containing the source bounds of the clicked icon * @param opts Options to pass to startActivity * @param opts Options to pass to startActivity */ */ public void startActivityForProfile(ComponentName component, UserHandle user, Rect sourceBounds, public void startMainActivity(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { Bundle opts) { if (DEBUG) { if (DEBUG) { Log.i(TAG, "StartActivityForProfile " + component + " " + user.getIdentifier()); Log.i(TAG, "StartMainActivity " + component + " " + user.getIdentifier()); } } try { try { mService.startActivityAsUser(component, sourceBounds, opts, user); mService.startActivityAsUser(component, sourceBounds, opts, user); Loading @@ -235,7 +235,7 @@ public class LauncherApps { * @param sourceBounds The Rect containing the source bounds of the clicked icon * @param sourceBounds The Rect containing the source bounds of the clicked icon * @param opts Options to pass to startActivity * @param opts Options to pass to startActivity */ */ public void showAppDetailsForProfile(ComponentName component, UserHandle user, public void startAppDetailsActivity(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { Rect sourceBounds, Bundle opts) { try { try { mService.showAppDetailsAsUser(component, sourceBounds, opts, user); mService.showAppDetailsAsUser(component, sourceBounds, opts, user); Loading @@ -252,7 +252,7 @@ public class LauncherApps { * * * @return true if the package exists and is enabled. * @return true if the package exists and is enabled. */ */ public boolean isPackageEnabledForProfile(String packageName, UserHandle user) { public boolean isPackageEnabled(String packageName, UserHandle user) { try { try { return mService.isPackageEnabled(packageName, user); return mService.isPackageEnabled(packageName, user); } catch (RemoteException re) { } catch (RemoteException re) { Loading @@ -268,7 +268,7 @@ public class LauncherApps { * * * @return true if the activity exists and is enabled. * @return true if the activity exists and is enabled. */ */ public boolean isActivityEnabledForProfile(ComponentName component, UserHandle user) { public boolean isActivityEnabled(ComponentName component, UserHandle user) { try { try { return mService.isActivityEnabled(component, user); return mService.isActivityEnabled(component, user); } catch (RemoteException re) { } catch (RemoteException re) { Loading @@ -282,8 +282,8 @@ public class LauncherApps { * * * @param callback The callback to add. * @param callback The callback to add. */ */ public void addOnAppsChangedCallback(OnAppsChangedCallback callback) { public void addCallback(Callback callback) { addOnAppsChangedCallback(callback, null); addCallback(callback, null); } } /** /** Loading @@ -292,7 +292,7 @@ public class LauncherApps { * @param callback The callback to add. * @param callback The callback to add. * @param handler that should be used to post callbacks on, may be null. * @param handler that should be used to post callbacks on, may be null. */ */ public void addOnAppsChangedCallback(OnAppsChangedCallback callback, Handler handler) { public void addCallback(Callback callback, Handler handler) { synchronized (this) { synchronized (this) { if (callback != null && !mCallbacks.contains(callback)) { if (callback != null && !mCallbacks.contains(callback)) { boolean addedFirstCallback = mCallbacks.size() == 0; boolean addedFirstCallback = mCallbacks.size() == 0; Loading @@ -311,9 +311,9 @@ public class LauncherApps { * Removes a callback that was previously added. * Removes a callback that was previously added. * * * @param callback The callback to remove. * @param callback The callback to remove. * @see #addOnAppsChangedListener(OnAppsChangedCallback) * @see #addCallback(Callback) */ */ public void removeOnAppsChangedCallback(OnAppsChangedCallback callback) { public void removeCallback(Callback callback) { synchronized (this) { synchronized (this) { removeCallbackLocked(callback); removeCallbackLocked(callback); if (mCallbacks.size() == 0) { if (mCallbacks.size() == 0) { Loading @@ -325,7 +325,7 @@ public class LauncherApps { } } } } private void removeCallbackLocked(OnAppsChangedCallback callback) { private void removeCallbackLocked(Callback callback) { if (callback == null) { if (callback == null) { throw new IllegalArgumentException("Callback cannot be null"); throw new IllegalArgumentException("Callback cannot be null"); } } Loading @@ -338,7 +338,7 @@ public class LauncherApps { } } } } private void addCallbackLocked(OnAppsChangedCallback callback, Handler handler) { private void addCallbackLocked(Callback callback, Handler handler) { // Remove if already present. // Remove if already present. removeCallbackLocked(callback); removeCallbackLocked(callback); if (handler == null) { if (handler == null) { Loading Loading @@ -421,7 +421,7 @@ public class LauncherApps { private static final int MSG_AVAILABLE = 4; private static final int MSG_AVAILABLE = 4; private static final int MSG_UNAVAILABLE = 5; private static final int MSG_UNAVAILABLE = 5; private OnAppsChangedCallback mCallback; private LauncherApps.Callback mCallback; private static class CallbackInfo { private static class CallbackInfo { String[] packageNames; String[] packageNames; Loading @@ -430,7 +430,7 @@ public class LauncherApps { UserHandle user; UserHandle user; } } public CallbackMessageHandler(Looper looper, OnAppsChangedCallback callback) { public CallbackMessageHandler(Looper looper, LauncherApps.Callback callback) { super(looper, null, true); super(looper, null, true); mCallback = callback; mCallback = callback; } } Loading Loading @@ -499,4 +499,45 @@ public class LauncherApps { obtainMessage(MSG_UNAVAILABLE, info).sendToTarget(); obtainMessage(MSG_UNAVAILABLE, info).sendToTarget(); } } } } /** Remove after unbundled apps have migrated STOP SHIP */ public static abstract class OnAppsChangedCallback extends Callback { } /** Remove after unbundled apps have migrated STOP SHIP */ public void addOnAppsChangedCallback(OnAppsChangedCallback callback) { addCallback(callback, null); } /** Remove after unbundled apps have migrated STOP SHIP */ public void addOnAppsChangedCallback(OnAppsChangedCallback callback, Handler handler) { addCallback(callback, handler); } /** Remove after unbundled apps have migrated STOP SHIP */ public void removeOnAppsChangedCallback(OnAppsChangedCallback callback) { removeCallback(callback); } /** Remove after unbundled apps have migrated STOP SHIP */ public void startActivityForProfile(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { startMainActivity(component, user, sourceBounds, opts); } /** Remove after unbundled apps have migrated STOP SHIP */ public void showAppDetailsForProfile(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { startAppDetailsActivity(component, user, sourceBounds, opts); } /** Remove after unbundled apps have migrated STOP SHIP */ public boolean isPackageEnabledForProfile(String packageName, UserHandle user) { return isPackageEnabled(packageName, user); } /** Remove after unbundled apps have migrated STOP SHIP */ public boolean isActivityEnabledForProfile(ComponentName component, UserHandle user) { return isActivityEnabled(component, user); } } }