Merge "Generate new field short_name_hash for atom ForegroundServiceStateChanged." into sc-dev am: b7c4eb868e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14794235 Change-Id: Ia2c87aeef372459b6199bccdddc2a8a3ca966524
This commit is contained in:
@@ -6191,7 +6191,8 @@ public final class ActiveServices {
|
|||||||
r.mFgsNotificationDeferred,
|
r.mFgsNotificationDeferred,
|
||||||
r.mFgsNotificationShown,
|
r.mFgsNotificationShown,
|
||||||
durationMs,
|
durationMs,
|
||||||
r.mStartForegroundCount);
|
r.mStartForegroundCount,
|
||||||
|
ActivityManagerUtils.hashComponentNameForAtom(r.shortInstanceName));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canAllowWhileInUsePermissionInFgsLocked(int callingPid, int callingUid,
|
boolean canAllowWhileInUsePermissionInFgsLocked(int callingPid, int callingUid,
|
||||||
|
|||||||
@@ -121,4 +121,12 @@ public class ActivityManagerUtils {
|
|||||||
|
|
||||||
return (((double) hash) / Integer.MAX_VALUE) <= rate;
|
return (((double) hash) / Integer.MAX_VALUE) <= rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param shortInstanceName {@link ServiceRecord#shortInstanceName}.
|
||||||
|
* @return hash of the ServiceRecord's shortInstanceName, combined with ANDROID_ID.
|
||||||
|
*/
|
||||||
|
public static int hashComponentNameForAtom(String shortInstanceName) {
|
||||||
|
return getUnsignedHashUnCached(shortInstanceName) ^ getAndroidIdHash();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user