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

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

Snap for 6085360 from c5dffc9a to qt-qpr2-release

Change-Id: I5a5d112a646758cb48a59d344b81a6dafec16ab0
parents 6f26345e c5dffc9a
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -266,7 +266,9 @@ status_t StatsService::onTransact(uint32_t code, const Parcel& data, Parcel* rep
                    IResultReceiver::asInterface(data.readStrongBinder());

            err = command(in, out, err, args, resultReceiver);
            if (resultReceiver != nullptr) {
                resultReceiver->send(err);
            }
            return NO_ERROR;
        }
        default: { return BnStatsManager::onTransact(code, data, reply, flags); }
@@ -411,13 +413,20 @@ status_t StatsService::command(int in, int out, int err, Vector<String8>& args,
            return cmd_trigger_active_config_broadcast(out, args);
        }
        if (!args[0].compare(String8("data-subscribe"))) {
            {
                std::lock_guard<std::mutex> lock(mShellSubscriberMutex);
                if (mShellSubscriber == nullptr) {
                    mShellSubscriber = new ShellSubscriber(mUidMap, mPullerManager);
                }
            }
            int timeoutSec = -1;
            if (argCount >= 2) {
                timeoutSec = atoi(args[1].c_str());
            }
            if (resultReceiver == nullptr) {
                ALOGI("Null resultReceiver given, no subscription will be started");
                return UNEXPECTED_NULL;
            }
            mShellSubscriber->startNewSubscription(in, out, resultReceiver, timeoutSec);
            return NO_ERROR;
        }
+4 −0
Original line number Diff line number Diff line
@@ -432,6 +432,10 @@ private:

    sp<ShellSubscriber> mShellSubscriber;

    /**
     * Mutex for setting the shell subscriber
     */
    mutable mutex mShellSubscriberMutex;
    std::shared_ptr<LogEventQueue> mEventQueue;

    FRIEND_TEST(StatsLogProcessorTest, TestActivationsPersistAcrossSystemServerRestart);
+29 −7
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import android.content.pm.ResolveInfo;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.DataSetObserver;
import android.graphics.Bitmap;
@@ -931,20 +932,38 @@ public class ChooserActivity extends ResolverActivity {

        final Intent resolveIntent = new Intent();
        resolveIntent.setComponent(cn);
        final ResolveInfo ri = getPackageManager().resolveActivity(resolveIntent, 0);
        if (ri == null) {
        final ResolveInfo ri = getPackageManager().resolveActivity(
                resolveIntent, PackageManager.GET_META_DATA);
        if (ri == null || ri.activityInfo == null) {
            Log.e(TAG, "Device-specified nearby sharing component (" + cn
                    + ") not available");
            return null;
        }

        // TODO(b/144290152): CHIP_LABEL_METADATA_KEY / CHIP_ICON_METADATA_KEY

        CharSequence name = ri.loadLabel(getPackageManager());
        // Allow the nearby sharing component to provide a more appropriate icon and label
        // for the chip.
        CharSequence name = null;
        Drawable icon = null;
        final Bundle metaData = ri.activityInfo.metaData;
        if (metaData != null) {
            try {
                final Resources pkgRes = getPackageManager().getResourcesForActivity(cn);
                final int nameResId = metaData.getInt(CHIP_LABEL_METADATA_KEY);
                name = pkgRes.getString(nameResId);
                final int resId = metaData.getInt(CHIP_ICON_METADATA_KEY);
                icon = pkgRes.getDrawable(resId);
            } catch (NameNotFoundException ex) { }
        }
        if (TextUtils.isEmpty(name)) {
            name = ri.loadLabel(getPackageManager());
        }
        if (icon == null) {
            icon = ri.loadIcon(getPackageManager());
        }

        final DisplayResolveInfo dri = new DisplayResolveInfo(
                originalIntent, ri, name, "", null);
        dri.setDisplayIcon(ri.loadIcon(getPackageManager()));
        dri.setDisplayIcon(icon);
        return dri;
    }

@@ -976,7 +995,10 @@ public class ChooserActivity extends ResolverActivity {
        return createActionButton(
                ti.getDisplayIcon(),
                ti.getDisplayLabel(),
                (View unused) -> safelyStartActivity(ti)
                (View unused) -> {
                    safelyStartActivity(ti);
                    finish();
                }
        );
    }

+4 −2
Original line number Diff line number Diff line
@@ -18,8 +18,10 @@
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    android:viewportHeight="24"
    android:autoMirrored="true"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="?android:attr/textColorSecondary"
      android:fillColor="@color/white"
      android:pathData="M18,21L4,21L4,7L2,7v14c0,1.1 0.9,2 2,2h14v-2zM21,17L21,3c0,-1.1 -0.9,-2 -2,-2L8,1c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h11c1.1,0 2,-0.9 2,-2zM19,17L8,17L8,3h11v14z"/>
</vector>
+2 −0
Original line number Diff line number Diff line
@@ -25,4 +25,6 @@
    android:singleLine="true"
    android:clickable="true"
    android:background="@drawable/chooser_action_button_bg"
    android:drawableTint="?android:attr/colorControlNormal"
    android:drawableTintMode="src_in"
    />
Loading