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

Commit 073a6d2d authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5595753 from 2c402057 to qt-release

Change-Id: I27d4d2310a454c79f4f363b25996c57b1b2c3b22
parents abe0c6db 2c402057
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/SystemUI)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/DynamicAndroidInstallationService)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/DefaultContainerService)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/CaptivePortalLogin)
# ******************************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST ABOVE THIS BANNER
# ******************************************************************
+1 −0
Original line number Diff line number Diff line
@@ -3171,6 +3171,7 @@ package android.view {

  @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback {
    method public android.view.View getTooltipView();
    method public boolean isAutofilled();
    method public static boolean isDefaultFocusHighlightEnabled();
    method public boolean isDefaultFocusHighlightNeeded(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
    method protected void resetResolvedDrawables();
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ cc_binary {
    ],

    static_libs: [
        "libplatformprotos",
        "libprotoutil",
    ],

    cflags: [
+26 −4
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <android/os/BnIncidentReportStatusListener.h>
#include <android/os/IIncidentManager.h>
#include <android/os/IncidentReportArgs.h>
#include <android/util/ProtoOutputStream.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <utils/Looper.h>
@@ -36,6 +37,9 @@ using namespace android;
using namespace android::base;
using namespace android::binder;
using namespace android::os;
using android::util::FIELD_COUNT_SINGLE;
using android::util::FIELD_TYPE_STRING;
using android::util::ProtoOutputStream;

// ================================================================================
class StatusListener : public BnIncidentReportStatusListener {
@@ -129,11 +133,11 @@ static void section_list(FILE* out) {
static IncidentSection const*
find_section(const char* name)
{
    size_t low = 0;
    size_t high = INCIDENT_SECTION_COUNT - 1;
    ssize_t low = 0;
    ssize_t high = INCIDENT_SECTION_COUNT - 1;

    while (low <= high) {
        size_t mid = (low + high) >> 1;
        ssize_t mid = (low + high) / 2;
        IncidentSection const* section = INCIDENT_SECTIONS + mid;

        int cmp = strcmp(section->name, name);
@@ -208,6 +212,7 @@ usage(FILE* out)
    fprintf(out, "and one of these destinations:\n");
    fprintf(out, "  -b           (default) print the report to stdout (in proto format)\n");
    fprintf(out, "  -d           send the report into dropbox\n");
    fprintf(out, "  -r REASON    human readable description of why the report is taken.\n");
    fprintf(out, "  -s PKG/CLS   send broadcast to the broadcast receiver.\n");
    fprintf(out, "\n");
    fprintf(out, "  SECTION     the field numbers of the incident report fields to include\n");
@@ -221,11 +226,12 @@ main(int argc, char** argv)
    IncidentReportArgs args;
    enum { DEST_UNSET, DEST_DROPBOX, DEST_STDOUT, DEST_BROADCAST } destination = DEST_UNSET;
    int privacyPolicy = PRIVACY_POLICY_AUTOMATIC;
    string reason;
    string receiverArg;

    // Parse the args
    int opt;
    while ((opt = getopt(argc, argv, "bhdlp:s:")) != -1) {
    while ((opt = getopt(argc, argv, "bhdlp:r:s:")) != -1) {
        switch (opt) {
            case 'h':
                usage(stdout);
@@ -250,6 +256,13 @@ main(int argc, char** argv)
            case 'p':
                privacyPolicy = get_privacy_policy(optarg);
                break;
            case 'r':
                if (reason.size() > 0) {
                    usage(stderr);
                    return 1;
                }
                reason = optarg;
                break;
            case 's':
                if (destination != DEST_UNSET) {
                    usage(stderr);
@@ -291,6 +304,7 @@ main(int argc, char** argv)
                } else {
                    IncidentSection const* ic = find_section(arg);
                    if (ic == NULL) {
                        ALOGD("Invalid section: %s\n", arg);
                        fprintf(stderr, "Invalid section: %s\n", arg);
                        return 1;
                    }
@@ -301,6 +315,14 @@ main(int argc, char** argv)
    }
    args.setPrivacyPolicy(privacyPolicy);

    if (reason.size() > 0) {
        ProtoOutputStream proto;
        proto.write(/* reason field id */ 2 | FIELD_TYPE_STRING | FIELD_COUNT_SINGLE, reason);
        vector<uint8_t> header;
        proto.serializeToVector(&header);
        args.addHeader(header);
    }

    // Start the thread pool.
    sp<ProcessState> ps(ProcessState::self());
    ps->startThreadPool();
+80 −9
Original line number Diff line number Diff line
@@ -20,16 +20,21 @@ import android.content.ComponentName;
import android.content.Context;
import android.net.Uri;
import android.os.IUserManager;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.telecom.Log;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

import com.android.internal.os.BaseCommand;
import com.android.internal.telecom.ITelecomService;
import com.android.internal.telephony.ITelephony;
import com.android.internal.telephony.TelephonyProperties;

import java.io.PrintStream;

@@ -62,10 +67,14 @@ public final class Telecom extends BaseCommand {
    private static final String COMMAND_GET_DEFAULT_DIALER = "get-default-dialer";
    private static final String COMMAND_GET_SYSTEM_DIALER = "get-system-dialer";
    private static final String COMMAND_WAIT_ON_HANDLERS = "wait-on-handlers";
    private static final String COMMAND_SET_SIM_COUNT = "set-sim-count";
    private static final String COMMAND_GET_SIM_CONFIG = "get-sim-config";
    private static final String COMMAND_GET_MAX_PHONES = "get-max-phones";

    private ComponentName mComponent;
    private String mAccountId;
    private ITelecomService mTelecomService;
    private ITelephony mTelephonyService;
    private IUserManager mUserManager;

    @Override
@@ -88,11 +97,14 @@ public final class Telecom extends BaseCommand {
                + "usage: telecom get-default-dialer\n"
                + "usage: telecom get-system-dialer\n"
                + "usage: telecom wait-on-handlers\n"
                + "usage: telecom set-sim-count <COUNT>\n"
                + "usage: telecom get-sim-config\n"
                + "usage: telecom get-max-phones\n"
                + "\n"
                + "telecom set-phone-account-enabled: Enables the given phone account, if it has \n"
                + "telecom set-phone-account-enabled: Enables the given phone account, if it has"
                        + " already been registered with Telecom.\n"
                + "\n"
                + "telecom set-phone-account-disabled: Disables the given phone account, if it \n"
                + "telecom set-phone-account-disabled: Disables the given phone account, if it"
                        + " has already been registered with telecom.\n"
                + "\n"
                + "telecom set-default-dialer: Sets the override default dialer to the given"
@@ -103,6 +115,14 @@ public final class Telecom extends BaseCommand {
                + "telecom get-system-dialer: Displays the current system dialer.\n"
                + "\n"
                + "telecom wait-on-handlers: Wait until all handlers finish their work.\n"
                + "\n"
                + "telecom set-sim-count: Set num SIMs (2 for DSDS, 1 for single SIM."
                        + " This may restart the device.\n"
                + "\n"
                + "telecom get-sim-config: Get the mSIM config string. \"DSDS\" for DSDS mode,"
                        + " or \"\" for single SIM\n"
                + "\n"
                + "telecom get-max-phones: Get the max supported phones from the modem.\n"
        );
    }

@@ -115,6 +135,15 @@ public final class Telecom extends BaseCommand {
            showError("Error: Could not access the Telecom Manager. Is the system running?");
            return;
        }

        mTelephonyService = ITelephony.Stub.asInterface(
                ServiceManager.getService(Context.TELEPHONY_SERVICE));
        if (mTelephonyService == null) {
            Log.w(this, "onRun: Can't access telephony service.");
            showError("Error: Could not access the Telephony Service. Is the system running?");
            return;
        }

        mUserManager = IUserManager.Stub
                .asInterface(ServiceManager.getService(Context.USER_SERVICE));
        if (mUserManager == null) {
@@ -170,6 +199,15 @@ public final class Telecom extends BaseCommand {
            case COMMAND_WAIT_ON_HANDLERS:
                runWaitOnHandler();
                break;
            case COMMAND_SET_SIM_COUNT:
                runSetSimCount();
                break;
            case COMMAND_GET_SIM_CONFIG:
                runGetSimConfig();
                break;
            case COMMAND_GET_MAX_PHONES:
                runGetMaxPhones();
                break;
            default:
                Log.w(this, "onRun: unknown command: %s", command);
                throw new IllegalArgumentException ("unknown command '" + command + "'");
@@ -271,6 +309,35 @@ public final class Telecom extends BaseCommand {

    }

    private void runSetSimCount() throws RemoteException {
        if (!callerIsRoot()) {
            System.out.println("set-sim-count requires adb root");
            return;
        }
        int numSims = Integer.parseInt(nextArgRequired());
        System.out.println("Setting sim count to " + numSims + ". Device may reboot");
        mTelephonyService.switchMultiSimConfig(numSims);
    }

    /**
     * Prints the mSIM config to the console.
     * "DSDS" for a phone in DSDS mode
     * "" (empty string) for a phone in SS mode
     */
    private void runGetSimConfig() throws RemoteException {
        System.out.println(SystemProperties.get(TelephonyProperties.PROPERTY_MULTI_SIM_CONFIG));
    }

    private void runGetMaxPhones() throws RemoteException {
        // This assumes the max number of SIMs is 2, which it currently is
        if (TelephonyManager.MULTISIM_ALLOWED
                == mTelephonyService.isMultiSimSupported("com.android.commands.telecom")) {
            System.out.println("2");
        } else {
            System.out.println("1");
        }
    }

    private PhoneAccountHandle getPhoneAccountHandleFromArgs() throws RemoteException {
        if (TextUtils.isEmpty(mArgs.peekNextArg())) {
            return null;
@@ -289,6 +356,10 @@ public final class Telecom extends BaseCommand {
        return new PhoneAccountHandle(component, accountId, userHandle);
    }

    private boolean callerIsRoot() {
        return Process.ROOT_UID == Process.myUid();
    }

    private ComponentName parseComponentName(String component) {
        ComponentName cn = ComponentName.unflattenFromString(component);
        if (cn == null) {
Loading