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

Commit ad213748 authored by Jeffrey Huang's avatar Jeffrey Huang
Browse files

Creating PendingIntentRef

Update #setDataFetchOperation to avoid using intentsender.

Bug: 146074295
Test: Ran GTS Tests
Change-Id: I7df5c6441725aa4e46fac18925664c9455f50fb9
parent 3c5d179a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
filegroup {
    name: "statsd_aidl",
    srcs: [
        "android/os/IPendingIntentRef.aidl",
        "android/os/IPullAtomCallback.aidl",
        "android/os/IPullAtomResultReceiver.aidl",
        "android/os/IStatsCompanionService.aidl",
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.os;

import android.os.StatsDimensionsValue;

/**
  * Binder interface to hold a PendingIntent for StatsCompanionService.
  * {@hide}
  */
interface IPendingIntentRef {

    /**
     * Sends a broadcast to the specified PendingIntent that it should getData now.
     * This should be only called from StatsCompanionService.
     */
     oneway void sendDataBroadcast(long lastReportTimeNs);

    /**
     * Send a broadcast to the specified PendingIntent notifying it that the list of active configs
     * has changed. This should be only called from StatsCompanionService.
     */
     oneway void sendActiveConfigsChangedBroadcast(in long[] configIds);

     /**
      * Send a broadcast to the specified PendingIntent, along with the other information
      * specified. This should only be called from StatsCompanionService.
      */
     oneway void sendSubscriberBroadcast(long configUid, long configId, long subscriptionId,
                                         long subscriptionRuleId, in String[] cookies,
                                         in StatsDimensionsValue dimensionsValue);
}
 No newline at end of file
+0 −3
Original line number Diff line number Diff line
@@ -66,9 +66,6 @@ interface IStatsCompanionService {
    /** Pull the specified data. Results will be sent to statsd when complete. */
    StatsLogEventWrapper[] pullData(int pullCode);

    /** Send a broadcast to the specified PendingIntent's as IBinder that it should getData now. */
    oneway void sendDataBroadcast(in IBinder intentSender, long lastReportTimeNs);

    /**
     * Send a broadcast to the specified PendingIntent's as IBinder notifying it that the list
     * of active configs has changed.
+9 −2
Original line number Diff line number Diff line
@@ -30,11 +30,18 @@ interface IStatsManagerService {
     * memory consumed by the metrics for this configuration approach the pre-defined limits. There
     * can be at most one listener per config key.
     *
     * Requires Manifest.permission.DUMP.
     * Requires Manifest.permission.DUMP and Manifest.permission.PACKAGE_USAGE_STATS.
     */
    void setDataFetchOperation(long configKey, in PendingIntent pendingIntent,
    void setDataFetchOperation(long configId, in PendingIntent pendingIntent,
        in String packageName);

    /**
     * Removes the data fetch operation for the specified configuration.
     *
     * Requires Manifest.permission.DUMP and Manifest.permission.PACKAGE_USAGE_STATS.
     */
    void removeDataFetchOperation(long configId, in String packageName);

    /**
     * Registers the given pending intent for this packagename. This intent is invoked when the
     * active status of any of the configs sent by this package changes and will contain a list of
+4 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.os;

import android.os.IStatsPullerCallback;
import android.os.IPendingIntentRef;
import android.os.IPullAtomCallback;
import android.os.ParcelFileDescriptor;

@@ -114,14 +115,15 @@ interface IStatsd {
     *
     * Requires Manifest.permission.DUMP.
     */
    void setDataFetchOperation(long configKey, in IBinder intentSender, in String packageName);
    void setDataFetchOperation(long configId, in IPendingIntentRef pendingIntentRef,
                               int callingUid);

    /**
     * Removes the data fetch operation for the specified configuration.
     *
     * Requires Manifest.permission.DUMP.
     */
    void removeDataFetchOperation(long configKey, in String packageName);
    void removeDataFetchOperation(long configId, int callingUid);

    /**
     * Registers the given pending intent for this packagename. This intent is invoked when the
Loading