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

Commit 3ff8e1a8 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue #7211769 and #7244492, thrash around on #7226656." into jb-mr1-dev

parents 1d352735 d4ac8d7b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -127,6 +127,8 @@ public class Am {
            runSetDebugApp();
        } else if (op.equals("clear-debug-app")) {
            runClearDebugApp();
        } else if (op.equals("bug-report")) {
            runBugReport();
        } else if (op.equals("monitor")) {
            runMonitor();
        } else if (op.equals("screen-compat")) {
@@ -844,6 +846,11 @@ public class Am {
        mAm.setDebugApp(null, false, true);
    }

    private void runBugReport() throws Exception {
        mAm.requestBugReport();
        System.out.println("Your lovely bug report is being created; please be patient.");
    }

    private void runSwitchUser() throws Exception {
        String user = nextArgRequired();
        mAm.switchUser(Integer.parseInt(user));
@@ -1508,6 +1515,9 @@ public class Am {
                "\n" +
                "am clear-debug-app: clear the previously set-debug-app.\n" +
                "\n" +
                "am bug-report: request bug report generation; will launch UI\n" +
                "    when done to select where it should be delivered." +
                "\n" +
                "am monitor: start monitoring for crashes or ANRs.\n" +
                "    --gdb: start gdbserv on the given port at crash/ANR\n" +
                "\n" +
+16 −0
Original line number Diff line number Diff line
@@ -1783,6 +1783,12 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            return true;
        }

        case REQUEST_BUG_REPORT_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            requestBugReport();
            return true;
        }

        }

        return super.onTransact(code, data, reply, flags);
@@ -4066,5 +4072,15 @@ class ActivityManagerProxy implements IActivityManager
        reply.recycle();
    }

    public void requestBugReport() throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
        reply.recycle();
    }

    private IBinder mRemote;
}
+3 −0
Original line number Diff line number Diff line
@@ -361,6 +361,8 @@ public interface IActivityManager extends IInterface {
    public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException;
    public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException;

    public void requestBugReport() throws RemoteException;

    /*
     * Private non-Binder interfaces
     */
@@ -613,4 +615,5 @@ public interface IActivityManager extends IInterface {
    int REGISTER_USER_SWITCH_OBSERVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+154;
    int UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+155;
    int GET_RUNNING_USER_IDS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+156;
    int REQUEST_BUG_REPORT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+157;
}
+7 −1
Original line number Diff line number Diff line
@@ -171,11 +171,17 @@ public class ActivityInfo extends ComponentInfo
     * {@see android.app.Notification#FLAG_HIGH_PRIORITY}
     */
    public static final int FLAG_IMMERSIVE = 0x0400;
    /**
     * @hide Bit in {@link #flags}: If set, this component will only be seen
     * by the primary user.  Only works with broadcast receivers.  Set from the
     * {@link android.R.attr#primaryUserOnly} attribute.
     */
    public static final int FLAG_PRIMARY_USER_ONLY = 0x20000000;
    /**
     * Bit in {@link #flags}: If set, a single instance of the receiver will
     * run for all users on the device.  Set from the
     * {@link android.R.attr#singleUser} attribute.  Note that this flag is
     * only relevent for ActivityInfo structures that are describiner receiver
     * only relevant for ActivityInfo structures that are describing receiver
     * components; it is not applied to activities.
     */
    public static final int FLAG_SINGLE_USER = 0x40000000;
+6 −1
Original line number Diff line number Diff line
@@ -2193,7 +2193,7 @@ public class PackageParser {
            if (sa.getBoolean(
                    com.android.internal.R.styleable.AndroidManifestActivity_singleUser,
                    false)) {
                a.info.flags |= ServiceInfo.FLAG_SINGLE_USER;
                a.info.flags |= ActivityInfo.FLAG_SINGLE_USER;
                if (a.info.exported) {
                    Slog.w(TAG, "Activity exported request ignored due to singleUser: "
                            + a.className + " at " + mArchiveSourcePath + " "
@@ -2202,6 +2202,11 @@ public class PackageParser {
                }
                setExported = true;
            }
            if (sa.getBoolean(
                    com.android.internal.R.styleable.AndroidManifestActivity_primaryUserOnly,
                    false)) {
                a.info.flags |= ActivityInfo.FLAG_PRIMARY_USER_ONLY;
            }
        }

        sa.recycle();
Loading