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

Commit 940ba0c8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Rename CrossProfileApps API as per API council feedback"

parents af0c82ea b0d22627
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ java_library {
        "core/java/android/content/ISyncServiceAdapter.aidl",
        "core/java/android/content/ISyncStatusObserver.aidl",
        "core/java/android/content/om/IOverlayManager.aidl",
        "core/java/android/content/pm/crossprofile/ICrossProfileApps.aidl",
        "core/java/android/content/pm/ICrossProfileApps.aidl",
        "core/java/android/content/pm/IDexModuleRegisterCallback.aidl",
        "core/java/android/content/pm/ILauncherApps.aidl",
        "core/java/android/content/pm/IOnAppsChangedListener.aidl",
+7 −11
Original line number Diff line number Diff line
@@ -10687,6 +10687,13 @@ package android.content.pm {
    field public int reqTouchScreen;
  }
  public class CrossProfileApps {
    method public android.graphics.drawable.Drawable getProfileSwitchingIconDrawable(android.os.UserHandle);
    method public java.lang.CharSequence getProfileSwitchingLabel(android.os.UserHandle);
    method public java.util.List<android.os.UserHandle> getTargetUserProfiles();
    method public void startMainActivity(android.content.ComponentName, android.os.UserHandle);
  }
  public final class FeatureGroupInfo implements android.os.Parcelable {
    ctor public FeatureGroupInfo();
    ctor public FeatureGroupInfo(android.content.pm.FeatureGroupInfo);
@@ -11481,17 +11488,6 @@ package android.content.pm {
}
package android.content.pm.crossprofile {
  public class CrossProfileApps {
    method public android.graphics.drawable.Drawable getProfileSwitchingIcon(android.os.UserHandle);
    method public java.lang.CharSequence getProfileSwitchingLabel(android.os.UserHandle);
    method public java.util.List<android.os.UserHandle> getTargetUserProfiles();
    method public void startMainActivity(android.content.ComponentName, android.os.UserHandle);
  }
}
package android.content.res {
  public class AssetFileDescriptor implements java.io.Closeable android.os.Parcelable {
+2 −2
Original line number Diff line number Diff line
@@ -38,12 +38,12 @@ import android.content.ClipboardManager;
import android.content.Context;
import android.content.IRestrictionsManager;
import android.content.RestrictionsManager;
import android.content.pm.CrossProfileApps;
import android.content.pm.ICrossProfileApps;
import android.content.pm.IShortcutService;
import android.content.pm.LauncherApps;
import android.content.pm.PackageManager;
import android.content.pm.ShortcutManager;
import android.content.pm.crossprofile.CrossProfileApps;
import android.content.pm.crossprofile.ICrossProfileApps;
import android.content.res.Resources;
import android.hardware.ConsumerIrManager;
import android.hardware.ISerialManager;
+1 −1
Original line number Diff line number Diff line
@@ -4146,7 +4146,7 @@ public abstract class Context {

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.content.pm.crossprofile.CrossProfileApps} for cross profile operations.
     * {@link android.content.pm.CrossProfileApps} for cross profile operations.
     *
     * @see #getSystemService(String)
     */
+8 −7
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.content.pm.crossprofile;
package android.content.pm;

import android.annotation.NonNull;
import android.content.ComponentName;
@@ -57,13 +57,14 @@ public class CrossProfileApps {
     *        action {@link android.content.Intent#ACTION_MAIN}, category
     *        {@link android.content.Intent#CATEGORY_LAUNCHER}. Otherwise, SecurityException will
     *        be thrown.
     * @param user The UserHandle of the profile, must be one of the users returned by
     * @param targetUser The UserHandle of the profile, must be one of the users returned by
     *        {@link #getTargetUserProfiles()}, otherwise a {@link SecurityException} will
     *        be thrown.
     */
    public void startMainActivity(@NonNull ComponentName component, @NonNull UserHandle user) {
    public void startMainActivity(@NonNull ComponentName component,
            @NonNull UserHandle targetUser) {
        try {
            mService.startActivityAsUser(mContext.getPackageName(), component, user);
            mService.startActivityAsUser(mContext.getPackageName(), component, targetUser);
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
@@ -114,7 +115,7 @@ public class CrossProfileApps {
    }

    /**
     * Return an icon that calling app can show to user for the semantic of profile switching --
     * Return a drawable that calling app can show to user for the semantic of profile switching --
     * launching its own activity in specified user profile. For example, it may return a briefcase
     * icon if the given user handle is the managed profile one.
     *
@@ -124,9 +125,9 @@ public class CrossProfileApps {
     * @return an icon that calling app can show user for the semantic of launching its own
     *         activity in specified user profile.
     *
     * @see #startMainActivity(ComponentName, UserHandle, Rect, Bundle)
     * @see #startMainActivity(ComponentName, UserHandle)
     */
    public @NonNull Drawable getProfileSwitchingIcon(@NonNull UserHandle userHandle) {
    public @NonNull Drawable getProfileSwitchingIconDrawable(@NonNull UserHandle userHandle) {
        verifyCanAccessUser(userHandle);

        final boolean isManagedProfile =
Loading