diff options
86 files changed, 1422 insertions, 1595 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 36680a171f35..7c66af559673 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6401,14 +6401,10 @@ package android.service.contentsuggestions { public abstract class ContentSuggestionsService extends android.app.Service { ctor public ContentSuggestionsService(); - method @Deprecated public void classifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); - method @Deprecated public void notifyInteraction(@NonNull String, @NonNull android.os.Bundle); - method public void onClassifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); - method public void onNotifyInteraction(@NonNull String, @NonNull android.os.Bundle); - method public void onProcessContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); - method public void onSuggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); - method @Deprecated public void processContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); - method @Deprecated public void suggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); + method public abstract void onClassifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); + method public abstract void onNotifyInteraction(@NonNull String, @NonNull android.os.Bundle); + method public abstract void onProcessContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); + method public abstract void onSuggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); field public static final String SERVICE_INTERFACE = "android.service.contentsuggestions.ContentSuggestionsService"; } diff --git a/api/test-current.txt b/api/test-current.txt index 95f4a2e480b8..5dc7929d06df 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -731,6 +731,7 @@ package android.content.pm { } public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable { + field public static final int FLAG_REMOVED = 2; // 0x2 field public static final int PROTECTION_FLAG_APP_PREDICTOR = 2097152; // 0x200000 field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000 field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000 diff --git a/cmds/statsd/src/guardrail/StatsdStats.cpp b/cmds/statsd/src/guardrail/StatsdStats.cpp index 74a4c87af7c3..ce0e561f291b 100644 --- a/cmds/statsd/src/guardrail/StatsdStats.cpp +++ b/cmds/statsd/src/guardrail/StatsdStats.cpp @@ -432,12 +432,13 @@ void StatsdStats::notePullExceedMaxDelay(int pullAtomId) { void StatsdStats::noteAtomLogged(int atomId, int32_t timeSec) { lock_guard<std::mutex> lock(mLock); - if (atomId > android::util::kMaxPushedAtomId) { - ALOGW("not interested in atom %d", atomId); - return; + if (atomId <= android::util::kMaxPushedAtomId) { + mPushedAtomStats[atomId]++; + } else { + if (mNonPlatformPushedAtomStats.size() < kMaxNonPlatformPushedAtoms) { + mNonPlatformPushedAtomStats[atomId]++; + } } - - mPushedAtomStats[atomId]++; } void StatsdStats::noteSystemServerRestart(int32_t timeSec) { @@ -551,6 +552,7 @@ void StatsdStats::resetInternalLocked() { mStartTimeSec = getWallClockSec(); mIceBox.clear(); std::fill(mPushedAtomStats.begin(), mPushedAtomStats.end(), 0); + mNonPlatformPushedAtomStats.clear(); mAnomalyAlarmRegisteredStats = 0; mPeriodicAlarmRegisteredStats = 0; mSystemServerRestartSec.clear(); @@ -705,6 +707,9 @@ void StatsdStats::dumpStats(int out) const { dprintf(out, "Atom %lu->%d\n", (unsigned long)i, mPushedAtomStats[i]); } } + for (const auto& pair : mNonPlatformPushedAtomStats) { + dprintf(out, "Atom %lu->%d\n", (unsigned long)pair.first, pair.second); + } dprintf(out, "********Pulled Atom stats***********\n"); for (const auto& pair : mPulledAtomStats) { @@ -890,6 +895,14 @@ void StatsdStats::dumpStats(std::vector<uint8_t>* output, bool reset) { } } + for (const auto& pair : mNonPlatformPushedAtomStats) { + uint64_t token = + proto.start(FIELD_TYPE_MESSAGE | FIELD_ID_ATOM_STATS | FIELD_COUNT_REPEATED); + proto.write(FIELD_TYPE_INT32 | FIELD_ID_ATOM_STATS_TAG, pair.first); + proto.write(FIELD_TYPE_INT32 | FIELD_ID_ATOM_STATS_COUNT, pair.second); + proto.end(token); + } + for (const auto& pair : mPulledAtomStats) { android::os::statsd::writePullerStatsToStream(pair, &proto); } diff --git a/cmds/statsd/src/guardrail/StatsdStats.h b/cmds/statsd/src/guardrail/StatsdStats.h index 4d21a29c1d82..8b39f5f3f37c 100644 --- a/cmds/statsd/src/guardrail/StatsdStats.h +++ b/cmds/statsd/src/guardrail/StatsdStats.h @@ -24,6 +24,7 @@ #include <mutex> #include <string> #include <vector> +#include <unordered_map> namespace android { namespace os { @@ -160,6 +161,9 @@ public: // Max time to do a pull. static const int64_t kPullMaxDelayNs = 10 * NS_PER_SEC; + // Maximum number of pushed atoms statsd stats will track above kMaxPushedAtomId. + static const int kMaxNonPlatformPushedAtoms = 100; + // Max platform atom tag number. static const int32_t kMaxPlatformAtomTag = 100000; @@ -508,10 +512,14 @@ private: // Stores the number of times a pushed atom is logged. // The size of the vector is the largest pushed atom id in atoms.proto + 1. Atoms - // out of that range will be dropped (it's either pulled atoms or test atoms). + // out of that range will be put in mNonPlatformPushedAtomStats. // This is a vector, not a map because it will be accessed A LOT -- for each stats log. std::vector<int> mPushedAtomStats; + // Stores the number of times a pushed atom is logged for atom ids above kMaxPushedAtomId. + // The max size of the map is kMaxNonPlatformPushedAtoms. + std::unordered_map<int, int> mNonPlatformPushedAtomStats; + // Maps PullAtomId to its stats. The size is capped by the puller atom counts. std::map<int, PulledAtomStats> mPulledAtomStats; @@ -587,6 +595,7 @@ private: FRIEND_TEST(StatsdStatsTest, TestConfigRemove); FRIEND_TEST(StatsdStatsTest, TestSubStats); FRIEND_TEST(StatsdStatsTest, TestAtomLog); + FRIEND_TEST(StatsdStatsTest, TestNonPlatformAtomLog); FRIEND_TEST(StatsdStatsTest, TestTimestampThreshold); FRIEND_TEST(StatsdStatsTest, TestAnomalyMonitor); FRIEND_TEST(StatsdStatsTest, TestSystemServerCrash); diff --git a/cmds/statsd/src/metrics/GaugeMetricProducer.cpp b/cmds/statsd/src/metrics/GaugeMetricProducer.cpp index 49fe7ef31a30..41000dae1462 100644 --- a/cmds/statsd/src/metrics/GaugeMetricProducer.cpp +++ b/cmds/statsd/src/metrics/GaugeMetricProducer.cpp @@ -312,7 +312,7 @@ void GaugeMetricProducer::onDumpReportLocked(const int64_t dumpTimeNs, } } -void GaugeMetricProducer::prepareFistBucketLocked() { +void GaugeMetricProducer::prepareFirstBucketLocked() { if (mIsActive && mIsPulled && mSamplingType == GaugeMetric::RANDOM_ONE_SAMPLE) { pullAndMatchEventsLocked(mCurrentBucketStartTimeNs); } diff --git a/cmds/statsd/src/metrics/GaugeMetricProducer.h b/cmds/statsd/src/metrics/GaugeMetricProducer.h index d3007c8a6778..1b43d4386e6c 100644 --- a/cmds/statsd/src/metrics/GaugeMetricProducer.h +++ b/cmds/statsd/src/metrics/GaugeMetricProducer.h @@ -122,7 +122,7 @@ private: void flushCurrentBucketLocked(const int64_t& eventTimeNs, const int64_t& nextBucketStartTimeNs) override; - void prepareFistBucketLocked() override; + void prepareFirstBucketLocked() override; void pullAndMatchEventsLocked(const int64_t timestampNs); diff --git a/cmds/statsd/src/metrics/MetricProducer.h b/cmds/statsd/src/metrics/MetricProducer.h index 7676f598f749..ec3484c80209 100644 --- a/cmds/statsd/src/metrics/MetricProducer.h +++ b/cmds/statsd/src/metrics/MetricProducer.h @@ -236,9 +236,9 @@ public: void addActivation(int activationTrackerIndex, const ActivationType& activationType, int64_t ttl_seconds, int deactivationTrackerIndex = -1); - void prepareFistBucket() { + void prepareFirstBucket() { std::lock_guard<std::mutex> lock(mMutex); - prepareFistBucketLocked(); + prepareFirstBucketLocked(); } void flushIfExpire(int64_t elapsedTimestampNs); @@ -272,7 +272,7 @@ protected: void loadActiveMetricLocked(const ActiveMetric& activeMetric, int64_t currentTimeNs); - virtual void prepareFistBucketLocked() {}; + virtual void prepareFirstBucketLocked() {}; /** * Flushes the current bucket if the eventTime is after the current bucket's end time. This will also flush the current partial bucket in memory. diff --git a/cmds/statsd/src/metrics/ValueMetricProducer.cpp b/cmds/statsd/src/metrics/ValueMetricProducer.cpp index 0bd6e624e25f..17f2994cca31 100644 --- a/cmds/statsd/src/metrics/ValueMetricProducer.cpp +++ b/cmds/statsd/src/metrics/ValueMetricProducer.cpp @@ -170,7 +170,7 @@ ValueMetricProducer::~ValueMetricProducer() { } } -void ValueMetricProducer::prepareFistBucketLocked() { +void ValueMetricProducer::prepareFirstBucketLocked() { // Kicks off the puller immediately if condition is true and diff based. if (mIsActive && mIsPulled && mCondition == ConditionState::kTrue && mUseDiff) { pullAndMatchEventsLocked(mCurrentBucketStartTimeNs, mCondition); diff --git a/cmds/statsd/src/metrics/ValueMetricProducer.h b/cmds/statsd/src/metrics/ValueMetricProducer.h index 1821dea34975..de01e7221ad0 100644 --- a/cmds/statsd/src/metrics/ValueMetricProducer.h +++ b/cmds/statsd/src/metrics/ValueMetricProducer.h @@ -113,7 +113,7 @@ private: void flushCurrentBucketLocked(const int64_t& eventTimeNs, const int64_t& nextBucketStartTimeNs) override; - void prepareFistBucketLocked() override; + void prepareFirstBucketLocked() override; void dropDataLocked(const int64_t dropTimeNs) override; diff --git a/cmds/statsd/src/metrics/metrics_manager_util.cpp b/cmds/statsd/src/metrics/metrics_manager_util.cpp index b027fa0d13e8..dd32c08faba3 100644 --- a/cmds/statsd/src/metrics/metrics_manager_util.cpp +++ b/cmds/statsd/src/metrics/metrics_manager_util.cpp @@ -766,9 +766,9 @@ bool initMetricActivations(const ConfigKey& key, const StatsdConfig& config, return true; } -void prepareFistBucket(const vector<sp<MetricProducer>>& allMetricProducers) { +void prepareFirstBucket(const vector<sp<MetricProducer>>& allMetricProducers) { for (const auto& metric: allMetricProducers) { - metric->prepareFistBucket(); + metric->prepareFirstBucket(); } } @@ -829,7 +829,7 @@ bool initStatsdConfig(const ConfigKey& key, const StatsdConfig& config, UidMap& return false; } - prepareFistBucket(allMetricProducers); + prepareFirstBucket(allMetricProducers); return true; } diff --git a/cmds/statsd/src/stats_log_util.h b/cmds/statsd/src/stats_log_util.h index 2a18e22adbb6..53dd5b792539 100644 --- a/cmds/statsd/src/stats_log_util.h +++ b/cmds/statsd/src/stats_log_util.h @@ -92,10 +92,6 @@ bool parseProtoOutputStream(util::ProtoOutputStream& protoOutput, T* message) { // Returns the truncated timestamp. int64_t truncateTimestampNsToFiveMinutes(int64_t timestampNs); -inline bool isPushedAtom(int atomId) { - return atomId <= util::kMaxPushedAtomId && atomId > 1; -} - inline bool isVendorPulledAtom(int atomId) { return atomId >= StatsdStats::kVendorPulledAtomStartTag && atomId < StatsdStats::kMaxAtomTag; } diff --git a/cmds/statsd/tests/guardrail/StatsdStats_test.cpp b/cmds/statsd/tests/guardrail/StatsdStats_test.cpp index 1ff7982e1232..1b8a3b543a49 100644 --- a/cmds/statsd/tests/guardrail/StatsdStats_test.cpp +++ b/cmds/statsd/tests/guardrail/StatsdStats_test.cpp @@ -227,8 +227,6 @@ TEST(StatsdStatsTest, TestAtomLog) { stats.noteAtomLogged(android::util::SENSOR_STATE_CHANGED, now + 1); stats.noteAtomLogged(android::util::SENSOR_STATE_CHANGED, now + 2); stats.noteAtomLogged(android::util::APP_CRASH_OCCURRED, now + 3); - // pulled event, should ignore - stats.noteAtomLogged(android::util::WIFI_BYTES_TRANSFER, now + 4); vector<uint8_t> output; stats.dumpStats(&output, false); @@ -253,6 +251,39 @@ TEST(StatsdStatsTest, TestAtomLog) { EXPECT_TRUE(sensorAtomGood); } +TEST(StatsdStatsTest, TestNonPlatformAtomLog) { + StatsdStats stats; + time_t now = time(nullptr); + int newAtom1 = android::util::kMaxPushedAtomId + 1; + int newAtom2 = android::util::kMaxPushedAtomId + 2; + + stats.noteAtomLogged(newAtom1, now + 1); + stats.noteAtomLogged(newAtom1, now + 2); + stats.noteAtomLogged(newAtom2, now + 3); + + vector<uint8_t> output; + stats.dumpStats(&output, false); + StatsdStatsReport report; + bool good = report.ParseFromArray(&output[0], output.size()); + EXPECT_TRUE(good); + + EXPECT_EQ(2, report.atom_stats_size()); + bool newAtom1Good = false; + bool newAtom2Good = false; + + for (const auto& atomStats : report.atom_stats()) { + if (atomStats.tag() == newAtom1 && atomStats.count() == 2) { + newAtom1Good = true; + } + if (atomStats.tag() == newAtom2 && atomStats.count() == 1) { + newAtom2Good = true; + } + } + + EXPECT_TRUE(newAtom1Good); + EXPECT_TRUE(newAtom2Good); +} + TEST(StatsdStatsTest, TestPullAtomStats) { StatsdStats stats; diff --git a/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp b/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp index b9a586752712..b9553a8fded8 100644 --- a/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp +++ b/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp @@ -79,7 +79,7 @@ TEST(GaugeMetricProducerTest, TestFirstBucket) { logEventMatcherIndex, eventMatcherWizard, -1, -1, tagId, 5, 600 * NS_PER_SEC + NS_PER_SEC / 2, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); EXPECT_EQ(600500000000, gaugeProducer.mCurrentBucketStartTimeNs); @@ -126,7 +126,7 @@ TEST(GaugeMetricProducerTest, TestPulledEventsNoCondition) { tagId, -1, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; allData.clear(); @@ -211,7 +211,7 @@ TEST(GaugeMetricProducerTest, TestPushedEventsWithUpgrade) { logEventMatcherIndex, eventMatcherWizard, -1 /* -1 means no pulling */, -1, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); sp<AnomalyTracker> anomalyTracker = gaugeProducer.addAnomalyTracker(alert, alarmMonitor); EXPECT_TRUE(anomalyTracker != nullptr); @@ -303,7 +303,7 @@ TEST(GaugeMetricProducerTest, TestPulledWithUpgrade) { GaugeMetricProducer gaugeProducer(kConfigKey, metric, -1 /*-1 meaning no condition*/, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, -1, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; shared_ptr<LogEvent> event = make_shared<LogEvent>(tagId, bucketStartTimeNs + 1); @@ -370,7 +370,7 @@ TEST(GaugeMetricProducerTest, TestPulledWithAppUpgradeDisabled) { logEventMatcherIndex, eventMatcherWizard, tagId, -1, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; shared_ptr<LogEvent> event = make_shared<LogEvent>(tagId, bucketStartTimeNs + 1); @@ -431,7 +431,7 @@ TEST(GaugeMetricProducerTest, TestPulledEventsWithCondition) { GaugeMetricProducer gaugeProducer(kConfigKey, metric, 1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, -1, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); gaugeProducer.onConditionChanged(true, bucketStartTimeNs + 8); EXPECT_EQ(1UL, gaugeProducer.mCurrentSlicedBucket->size()); @@ -529,7 +529,7 @@ TEST(GaugeMetricProducerTest, TestPulledEventsWithSlicedCondition) { GaugeMetricProducer gaugeProducer(kConfigKey, metric, 1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, -1, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); gaugeProducer.onSlicedConditionMayChange(true, bucketStartTimeNs + 8); @@ -583,7 +583,7 @@ TEST(GaugeMetricProducerTest, TestPulledEventsAnomalyDetection) { logEventMatcherIndex, eventMatcherWizard, tagId, -1, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); Alert alert; alert.set_id(101); @@ -692,7 +692,7 @@ TEST(GaugeMetricProducerTest, TestPullOnTrigger) { logEventMatcherIndex, eventMatcherWizard, tagId, triggerId, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; @@ -777,7 +777,7 @@ TEST(GaugeMetricProducerTest, TestRemoveDimensionInOutput) { logEventMatcherIndex, eventMatcherWizard, tagId, triggerId, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - gaugeProducer.prepareFistBucket(); + gaugeProducer.prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; diff --git a/cmds/statsd/tests/metrics/ValueMetricProducer_test.cpp b/cmds/statsd/tests/metrics/ValueMetricProducer_test.cpp index 0e82bad0f27b..2262c76e64f9 100644 --- a/cmds/statsd/tests/metrics/ValueMetricProducer_test.cpp +++ b/cmds/statsd/tests/metrics/ValueMetricProducer_test.cpp @@ -105,7 +105,7 @@ class ValueMetricProducerTestHelper { kConfigKey, metric, -1 /*-1 meaning no condition*/, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer->prepareFistBucket(); + valueProducer->prepareFirstBucket(); return valueProducer; } @@ -125,7 +125,7 @@ class ValueMetricProducerTestHelper { new ValueMetricProducer(kConfigKey, metric, 1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer->prepareFistBucket(); + valueProducer->prepareFirstBucket(); valueProducer->mCondition = ConditionState::kFalse; return valueProducer; } @@ -169,7 +169,7 @@ TEST(ValueMetricProducerTest, TestCalcPreviousBucketEndTime) { ValueMetricProducer valueProducer(kConfigKey, metric, -1 /*-1 meaning no condition*/, wizard, logEventMatcherIndex, eventMatcherWizard, -1, startTimeBase, 22, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); EXPECT_EQ(startTimeBase, valueProducer.calcPreviousBucketEndTime(60 * NS_PER_SEC + 10)); EXPECT_EQ(startTimeBase, valueProducer.calcPreviousBucketEndTime(60 * NS_PER_SEC + 10)); @@ -199,7 +199,7 @@ TEST(ValueMetricProducerTest, TestFirstBucket) { ValueMetricProducer valueProducer(kConfigKey, metric, -1 /*-1 meaning no condition*/, wizard, logEventMatcherIndex, eventMatcherWizard, -1, 5, 600 * NS_PER_SEC + NS_PER_SEC / 2, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); EXPECT_EQ(600500000000, valueProducer.mCurrentBucketStartTimeNs); EXPECT_EQ(10, valueProducer.mCurrentBucketNum); @@ -381,7 +381,7 @@ TEST(ValueMetricProducerTest, TestPulledEventsWithFiltering) { kConfigKey, metric, -1 /*-1 meaning no condition*/, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer->prepareFistBucket(); + valueProducer->prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; allData.clear(); @@ -670,7 +670,7 @@ TEST(ValueMetricProducerTest, TestPushedEventsWithUpgrade) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); event1->write(1); @@ -728,7 +728,7 @@ TEST(ValueMetricProducerTest, TestPulledValueWithUpgrade) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; allData.clear(); @@ -779,7 +779,7 @@ TEST(ValueMetricProducerTest, TestPulledWithAppUpgradeDisabled) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; allData.clear(); @@ -854,7 +854,7 @@ TEST(ValueMetricProducerTest, TestPushedEventsWithoutCondition) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); event1->write(1); @@ -897,7 +897,7 @@ TEST(ValueMetricProducerTest, TestPushedEventsWithCondition) { ValueMetricProducer valueProducer(kConfigKey, metric, 1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); valueProducer.mCondition = ConditionState::kFalse; shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); @@ -972,7 +972,7 @@ TEST(ValueMetricProducerTest, TestAnomalyDetection) { ValueMetricProducer valueProducer(kConfigKey, metric, -1 /*-1 meaning no condition*/, wizard, logEventMatcherIndex, eventMatcherWizard, -1 /*not pulled*/, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); sp<AnomalyTracker> anomalyTracker = valueProducer.addAnomalyTracker(alert, alarmMonitor); @@ -1269,7 +1269,7 @@ TEST(ValueMetricProducerTest, TestPushedAggregateMin) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); event1->write(1); @@ -1314,7 +1314,7 @@ TEST(ValueMetricProducerTest, TestPushedAggregateMax) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); event1->write(1); @@ -1361,7 +1361,7 @@ TEST(ValueMetricProducerTest, TestPushedAggregateAvg) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); event1->write(1); @@ -1412,7 +1412,7 @@ TEST(ValueMetricProducerTest, TestPushedAggregateSum) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); event1->write(1); @@ -1458,7 +1458,7 @@ TEST(ValueMetricProducerTest, TestSkipZeroDiffOutput) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); event1->write(1); @@ -1532,7 +1532,7 @@ TEST(ValueMetricProducerTest, TestSkipZeroDiffOutputMultiValue) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, -1, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); shared_ptr<LogEvent> event1 = make_shared<LogEvent>(tagId, bucketStartTimeNs + 10); event1->write(1); @@ -2081,7 +2081,7 @@ TEST(ValueMetricProducerTest, TestResetBaseOnPullTooLate) { ValueMetricProducer valueProducer(kConfigKey, metric, 1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucket2StartTimeNs, bucket2StartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); valueProducer.mCondition = ConditionState::kFalse; // Event should be skipped since it is from previous bucket. @@ -2862,7 +2862,7 @@ TEST(ValueMetricProducerTest, TestPullNeededFastDump) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); ProtoOutputStream output; std::set<string> strSet; @@ -2905,7 +2905,7 @@ TEST(ValueMetricProducerTest, TestFastDumpWithoutCurrentBucket) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); vector<shared_ptr<LogEvent>> allData; allData.clear(); @@ -2969,7 +2969,7 @@ TEST(ValueMetricProducerTest, TestPullNeededNoTimeConstraints) { ValueMetricProducer valueProducer(kConfigKey, metric, -1, wizard, logEventMatcherIndex, eventMatcherWizard, tagId, bucketStartTimeNs, bucketStartTimeNs, pullerManager); - valueProducer.prepareFistBucket(); + valueProducer.prepareFirstBucket(); ProtoOutputStream output; std::set<string> strSet; diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 15b571ffcd72..a869d85f7322 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -618,11 +618,13 @@ public class Notification implements Parcelable public static final int FLAG_CAN_COLORIZE = 0x00000800; /** - * Bit to be bitswised-ored into the {@link #flags} field that should be set if this - * notification is showing as a bubble. This will be set by the system if it is determined - * that your notification is allowed to be a bubble. + * Bit to be bitswised-ored into the {@link #flags} field that should be + * set by the system if this notification is showing as a bubble. * - * @see {@link Notification.Builder#setBubbleMetadata(BubbleMetadata)} + * Applications cannot set this flag directly; they should instead call + * {@link Notification.Builder#setBubbleMetadata(BubbleMetadata)} to + * request that a notification be displayed as a bubble, and then check + * this flag to see whether that request was honored by the system. */ public static final int FLAG_BUBBLE = 0x00001000; @@ -6253,7 +6255,7 @@ public class Notification implements Parcelable } /** - * @return true if this is a notification that can show as a bubble. + * @return true if this notification is showing as a bubble * * @hide */ diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java index 14340fe788f7..dd5c6a53cc20 100644 --- a/core/java/android/content/pm/PermissionInfo.java +++ b/core/java/android/content/pm/PermissionInfo.java @@ -316,6 +316,7 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { * value of {@link android.R.attr#permissionFlags}. * @hide */ + @TestApi @SystemApi public static final int FLAG_REMOVED = 1<<1; @@ -360,8 +361,11 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { /** @hide */ @IntDef(flag = true, prefix = { "FLAG_" }, value = { FLAG_COSTS_MONEY, - FLAG_INSTALLED, - FLAG_REMOVED + FLAG_REMOVED, + FLAG_HARD_RESTRICTED, + FLAG_SOFT_RESTRICTED, + FLAG_IMMUTABLY_RESTRICTED, + FLAG_INSTALLED }) @Retention(RetentionPolicy.SOURCE) public @interface Flags {} diff --git a/core/java/android/service/contentsuggestions/ContentSuggestionsService.java b/core/java/android/service/contentsuggestions/ContentSuggestionsService.java index 516d33673012..efc8e877f3c3 100644 --- a/core/java/android/service/contentsuggestions/ContentSuggestionsService.java +++ b/core/java/android/service/contentsuggestions/ContentSuggestionsService.java @@ -127,41 +127,29 @@ public abstract class ContentSuggestionsService extends Service { * Called by the system to provide the snapshot for the task associated with the given * {@param taskId}. */ - public void onProcessContextImage( - int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras) { - // TODO(b/127532182): remove after next prebuilt drop. - processContextImage(taskId, contextImage, extras); - } + public abstract void onProcessContextImage( + int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras); /** * Content selections have been request through {@link ContentSuggestionsManager}, implementer * should reply on the callback with selections. */ - public void onSuggestContentSelections(@NonNull SelectionsRequest request, - @NonNull ContentSuggestionsManager.SelectionsCallback callback) { - // TODO(b/127532182): remove after next prebuilt drop. - suggestContentSelections(request, callback); - } + public abstract void onSuggestContentSelections(@NonNull SelectionsRequest request, + @NonNull ContentSuggestionsManager.SelectionsCallback callback); /** * Content classifications have been request through {@link ContentSuggestionsManager}, * implementer should reply on the callback with classifications. */ - public void onClassifyContentSelections(@NonNull ClassificationsRequest request, - @NonNull ContentSuggestionsManager.ClassificationsCallback callback) { - // TODO(b/127532182): remove after next prebuilt drop. - classifyContentSelections(request, callback); - } + public abstract void onClassifyContentSelections(@NonNull ClassificationsRequest request, + @NonNull ContentSuggestionsManager.ClassificationsCallback callback); /** * User interactions have been reported through {@link ContentSuggestionsManager}, implementer * should handle those interactions. */ - public void onNotifyInteraction( - @NonNull String requestId, @NonNull Bundle interaction) { - // TODO(b/127532182): remove after next prebuilt drop. - notifyInteraction(requestId, interaction); - } + public abstract void onNotifyInteraction( + @NonNull String requestId, @NonNull Bundle interaction); private ContentSuggestionsManager.SelectionsCallback wrapSelectionsCallback( ISelectionsCallback callback) { @@ -184,42 +172,4 @@ public abstract class ContentSuggestionsService extends Service { } }); } - - - /** - * For temporary compat reason, remove with b/127532182 - * @deprecated use {@link #onProcessContextImage(int, Bitmap, Bundle)} instead. - */ - @Deprecated - public void processContextImage( - int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras) { - } - - /** - * For temporary compat reason, remove with b/127532182 - * @deprecated use {@link #onSuggestContentSelections(SelectionsRequest, - * ContentSuggestionsManager.SelectionsCallback)} instead. - */ - @Deprecated - public void suggestContentSelections(@NonNull SelectionsRequest request, - @NonNull ContentSuggestionsManager.SelectionsCallback callback) { - } - - /** - * For temporary compat reason, remove with b/127532182 - * @deprecated use {@link #onClassifyContentSelections(ClassificationsRequest, - * ContentSuggestionsManager.ClassificationsCallback)} instead. - */ - @Deprecated - public void classifyContentSelections(@NonNull ClassificationsRequest request, - @NonNull ContentSuggestionsManager.ClassificationsCallback callback) { - } - - /** - * For temporary compat reason, remove with b/127532182 - * @deprecated use {@link #onNotifyInteraction(String, Bundle)} instead. - */ - @Deprecated - public void notifyInteraction(@NonNull String requestId, @NonNull Bundle interaction) { - } } diff --git a/core/res/res/drawable/popup_background_material.xml b/core/res/res/drawable/popup_background_material.xml index b1f0cf595771..9ad7bfc68122 100644 --- a/core/res/res/drawable/popup_background_material.xml +++ b/core/res/res/drawable/popup_background_material.xml @@ -20,6 +20,6 @@ <corners android:radius="2dp" /> <solid - android:color="?attr/colorBackground" /> + android:color="?attr/colorPopupBackground" /> </shape> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 489a08ac9399..dffc2e979c17 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -87,6 +87,8 @@ theme does not set this value, meaning it is based on whether the window is floating. --> <attr name="backgroundDimEnabled" format="boolean" /> + <!-- Color of background imagery used for popup windows. --> + <attr name="colorPopupBackground" format="color" /> <!-- =========== --> <!-- Text styles --> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index f576feae0663..ab6f29b19445 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3270,6 +3270,10 @@ <!-- Controls whether the navigation bar lets through taps. --> <bool name="config_navBarTapThrough">false</bool> + <!-- Controls whether the side edge gestures can always trigger the transient nav bar to + show. --> + <bool name="config_navBarAlwaysShowOnSideEdgeGesture">false</bool> + <!-- Controls the size of the back gesture inset. --> <dimen name="config_backGestureInset">0dp</dimen> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index d178383973fd..e7e4d08778b9 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2869,6 +2869,7 @@ <java-symbol type="integer" name="config_navBarInteractionMode" /> <java-symbol type="bool" name="config_navBarCanMove" /> <java-symbol type="bool" name="config_navBarTapThrough" /> + <java-symbol type="bool" name="config_navBarAlwaysShowOnSideEdgeGesture" /> <java-symbol type="bool" name="config_navBarNeedsScrim" /> <java-symbol type="dimen" name="config_backGestureInset" /> <java-symbol type="color" name="system_bar_background_semi_transparent" /> diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml index 2e984601524d..08d6d0621cf4 100644 --- a/core/res/res/values/themes_device_defaults.xml +++ b/core/res/res/values/themes_device_defaults.xml @@ -216,6 +216,7 @@ easier. <item name="colorAccent">@color/accent_device_default_dark</item> <item name="colorError">@color/error_color_device_default_dark</item> <item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item> + <item name="colorPopupBackground">?attr/colorBackgroundFloating</item> </style> <style name="Theme.DeviceDefault" parent="Theme.DeviceDefaultBase" /> @@ -943,6 +944,7 @@ easier. <item name="colorAccent">@color/accent_device_default_light</item> <item name="colorError">@color/error_color_device_default_light</item> <item name="colorBackgroundFloating">@color/background_floating_device_default_light</item> + <item name="colorPopupBackground">?attr/colorBackgroundFloating</item> </style> <!-- Variant of the DeviceDefault (light) theme that has a solid (opaque) action bar with an diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml index 6b7698e344ad..6337db1905c9 100644 --- a/core/res/res/values/themes_material.xml +++ b/core/res/res/values/themes_material.xml @@ -52,6 +52,7 @@ please see themes_device_defaults.xml. <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_material_dark</item> <item name="backgroundDimAmount">0.6</item> <item name="colorError">@color/error_color_material_dark</item> + <item name="colorPopupBackground">?attr/colorBackground</item> <!-- Text styles --> <item name="textAppearance">@style/TextAppearance.Material</item> @@ -422,6 +423,7 @@ please see themes_device_defaults.xml. <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_material_light</item> <item name="backgroundDimAmount">0.6</item> <item name="colorError">@color/error_color_material_light</item> + <item name="colorPopupBackground">?attr/colorBackground</item> <!-- Text styles --> <item name="textAppearance">@style/TextAppearance.Material</item> diff --git a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java index 07dbf93ce46e..b3465cf00bd0 100644 --- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java @@ -59,7 +59,7 @@ import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.SystemUIFactory; import com.android.systemui.classifier.FalsingLog; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.plugins.qs.QS; import com.android.systemui.qs.car.CarQSFragment; @@ -794,7 +794,7 @@ public class CarStatusBar extends StatusBar implements KeyguardUpdateMonitor.getInstance(mContext).dump(fd, pw, args); } - FalsingManager.getInstance(mContext).dump(pw); + FalsingManagerFactory.getInstance(mContext).dump(pw); FalsingLog.dump(pw); pw.println("SharedPreferences:"); diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java index 02bcc099a70d..baa3544bd3fd 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java @@ -1111,7 +1111,7 @@ public class AccessPoint implements Comparable<AccessPoint> { * Return true if this AccessPoint represents a Passpoint provider configuration. */ public boolean isPasspointConfig() { - return mFqdn != null; + return mFqdn != null && mConfig == null; } /** diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java index d8172a0f9430..49c8ce32658b 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java @@ -718,6 +718,7 @@ public class WifiTracker implements LifecycleObserver, OnStart, OnStop, OnDestro if (accessPoint == null) { accessPoint = new AccessPoint(mContext, config, homeScans, roamingScans); } else { + accessPoint.update(config); accessPoint.setScanResultsPasspoint(homeScans, roamingScans); } return accessPoint; diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java b/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java index 683ec8bb5a6c..7fac81211dc1 100644 --- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java +++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java @@ -314,7 +314,8 @@ public class WifiTrackerTest { private List<Pair<WifiConfiguration, Map<Integer, List<ScanResult>>>> createPasspointMatchingWifiConfigWithScanResults( - List<ScanResult> homeList, List<ScanResult> roamingList) { + List<ScanResult> homeList, List<ScanResult> roamingList, + String fqdn, String friendlyName) { List<Pair<WifiConfiguration, Map<Integer, List<ScanResult>>>> matchingList = new ArrayList<>(); Map<Integer, List<ScanResult>> mapping = new HashMap<>(); @@ -326,7 +327,7 @@ public class WifiTrackerTest { mapping.put(WifiManager.PASSPOINT_ROAMING_NETWORK, roamingList); } - matchingList.add(new Pair(buildPasspointConfiguration(FQDN_1, PROVIDER_FRIENDLY_NAME_1), + matchingList.add(new Pair(buildPasspointConfiguration(fqdn, friendlyName), mapping)); return matchingList; @@ -1077,7 +1078,7 @@ public class WifiTrackerTest { List<AccessPoint> passpointAccessPointsFirstUpdate = tracker.updatePasspointAccessPoints( createPasspointMatchingWifiConfigWithScanResults(Arrays.asList(result), - null), new ArrayList<>()); + null, FQDN_1, PROVIDER_FRIENDLY_NAME_1), new ArrayList<>()); List<AccessPoint> cachedAccessPoints = new ArrayList<>(passpointAccessPointsFirstUpdate); int prevRssi = result.level; @@ -1086,7 +1087,7 @@ public class WifiTrackerTest { List<AccessPoint> passpointAccessPointsSecondUpdate = tracker.updatePasspointAccessPoints( createPasspointMatchingWifiConfigWithScanResults(Arrays.asList(result), - null), cachedAccessPoints); + null, FQDN_1, PROVIDER_FRIENDLY_NAME_1), cachedAccessPoints); // Verify second update AP is the same object as the first update AP assertThat(passpointAccessPointsFirstUpdate.get(0)) @@ -1097,6 +1098,28 @@ public class WifiTrackerTest { } /** + * Verifies that the internal WifiConfiguration of a Passpoint AccessPoint is updated + */ + @Test + public void updatePasspointAccessPoints_updatesConfig() { + WifiTracker tracker = createMockedWifiTracker(); + + ScanResult result = buildScanResult1(); + + List<AccessPoint> passpointAccessPoints = tracker.updatePasspointAccessPoints( + createPasspointMatchingWifiConfigWithScanResults(Arrays.asList(result), + null, FQDN_1, PROVIDER_FRIENDLY_NAME_1), new ArrayList<>()); + + AccessPoint ap = passpointAccessPoints.get(0); + assertEquals(ap.getTitle(), PROVIDER_FRIENDLY_NAME_1); + + tracker.updatePasspointAccessPoints( + createPasspointMatchingWifiConfigWithScanResults(Arrays.asList(result), + null, FQDN_1, PROVIDER_FRIENDLY_NAME_2), passpointAccessPoints); + assertEquals(ap.getTitle(), PROVIDER_FRIENDLY_NAME_2); + } + + /** * Verifies that updateOsuAccessPoints will only return AccessPoints whose * isOsuProvider() evaluates as true. */ diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingPlugin.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingPlugin.java index dce02e1a6c56..635932ea3c2b 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingPlugin.java +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingPlugin.java @@ -22,7 +22,7 @@ import com.android.systemui.plugins.annotations.ProvidesInterface; * Used to capture Falsing data (related to unlocking the screen). * * The intent is that the data can later be analyzed to validate the quality of the - * {@link com.android.systemui.classifier.FalsingManager}. + * {@link com.android.systemui.classifier.FalsingManagerFactory.FalsingManager}. */ @ProvidesInterface(action = FalsingPlugin.ACTION, version = FalsingPlugin.VERSION) public interface FalsingPlugin extends Plugin { diff --git a/packages/SystemUI/res/drawable/face_dialog_face_blue_to_checkmark.xml b/packages/SystemUI/res/drawable/face_dialog_dark_to_checkmark.xml index e4ace67577c3..e4ace67577c3 100644 --- a/packages/SystemUI/res/drawable/face_dialog_face_blue_to_checkmark.xml +++ b/packages/SystemUI/res/drawable/face_dialog_dark_to_checkmark.xml diff --git a/packages/SystemUI/res/drawable/face_dialog_face_to_error.xml b/packages/SystemUI/res/drawable/face_dialog_dark_to_error.xml index a96d21addb2b..a96d21addb2b 100644 --- a/packages/SystemUI/res/drawable/face_dialog_face_to_error.xml +++ b/packages/SystemUI/res/drawable/face_dialog_dark_to_error.xml diff --git a/packages/SystemUI/res/drawable/face_dialog_error_to_face.xml b/packages/SystemUI/res/drawable/face_dialog_error_to_idle.xml index 75311f44dfe3..aca12fce8d2f 100644 --- a/packages/SystemUI/res/drawable/face_dialog_error_to_face.xml +++ b/packages/SystemUI/res/drawable/face_dialog_error_to_idle.xml @@ -1,5 +1,5 @@ -<?xml version="1.0" encoding="utf-8"?><!-- - ~ Copyright (C) 2018 The Android Open Source Project +<!-- + ~ 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. @@ -23,69 +23,61 @@ android:viewportWidth="60" android:viewportHeight="60"> <group android:name="_R_G"> - <group - android:name="_R_G_L_0_G_N_1_T_0" - android:translateX="30" - android:translateY="30"> + <group android:name="_R_G_L_0_G"> + <path + android:name="_R_G_L_0_G_D_0_P_0" + android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " + android:strokeWidth="2.5" + android:strokeAlpha="1" + android:strokeColor="?android:attr/colorError" + android:trimPathStart="0" + android:trimPathEnd="1" + android:trimPathOffset="0" /> + <path + android:name="_R_G_L_0_G_D_1_P_0" + android:pathData=" M34.78 38.76 C33.83,38.75 31.54,38.75 30.01,38.75 C26.97,38.75 26.14,38.75 24.3,38.76 " + android:strokeWidth="2.5" + android:strokeAlpha="1" + android:strokeColor="?android:attr/colorError" + android:trimPathStart="0.34" + android:trimPathEnd="0.5700000000000001" + android:trimPathOffset="0" /> <group - android:name="_R_G_L_0_G" - android:translateX="-30" - android:translateY="-30"> + android:name="_R_G_L_0_G_D_2_P_0_G_0_T_0" + android:scaleX="0.3" + android:scaleY="0.3" + android:translateX="37.788" + android:translateY="19.53"> <path - android:name="_R_G_L_0_G_D_0_P_0" - android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " - android:strokeWidth="2.5" - android:strokeAlpha="1" - android:strokeColor="?android:attr/colorError" - android:trimPathStart="0" - android:trimPathEnd="1" - android:trimPathOffset="0" /> + android:name="_R_G_L_0_G_D_2_P_0" + android:fillAlpha="0" + android:fillColor="@color/biometric_face_icon_gray" + android:fillType="nonZero" + android:pathData=" M-2.1 0 C-2.1,1.2 -1.2,2.1 0,2.1 C1.1,2.1 2.1,1.2 2.1,0 C2.1,-1.2 1.2,-2.1 0,-2.1 C-1.2,-2.1 -2.1,-1.2 -2.1,0c " /> + </group> + <group + android:name="_R_G_L_0_G_D_3_P_0_G_0_T_0" + android:scaleX="0.3" + android:scaleY="0.3" + android:translateX="22.005" + android:translateY="19.51"> + <path + android:name="_R_G_L_0_G_D_3_P_0" + android:fillAlpha="0" + android:fillColor="@color/biometric_face_icon_gray" + android:fillType="nonZero" + android:pathData=" M-2.1 0 C-2.1,1.2 -1.2,2.1 0,2.1 C1.2,2.1 2.1,1.2 2.1,0 C2.1,-1.2 1.2,-2.1 0,-2.1 C-1.2,-2.1 -2.1,-1.2 -2.1,0c " /> + </group> + <group + android:name="_R_G_L_0_G_D_4_P_0_G_0_T_0" + android:translateX="30.3" + android:translateY="29.215"> <path - android:name="_R_G_L_0_G_D_1_P_0" - android:pathData=" M34.78 38.76 C33.83,38.75 31.54,38.75 30.01,38.75 C26.97,38.75 26.14,38.75 24.3,38.76 " - android:strokeWidth="2.5" - android:strokeAlpha="1" - android:strokeColor="?android:attr/colorError" - android:trimPathStart="0.34" - android:trimPathEnd="0.5700000000000001" - android:trimPathOffset="0" /> - <group - android:name="_R_G_L_0_G_D_2_P_0_G_0_T_0" - android:scaleX="0.3" - android:scaleY="0.3" - android:translateX="37.788" - android:translateY="19.53"> - <path - android:name="_R_G_L_0_G_D_2_P_0" - android:fillAlpha="0" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M-2.1 0 C-2.1,1.2 -1.2,2.1 0,2.1 C1.1,2.1 2.1,1.2 2.1,0 C2.1,-1.2 1.2,-2.1 0,-2.1 C-1.2,-2.1 -2.1,-1.2 -2.1,0c " /> - </group> - <group - android:name="_R_G_L_0_G_D_3_P_0_G_0_T_0" - android:scaleX="0.3" - android:scaleY="0.3" - android:translateX="22.005" - android:translateY="19.51"> - <path - android:name="_R_G_L_0_G_D_3_P_0" - android:fillAlpha="0" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M-2.1 0 C-2.1,1.2 -1.2,2.1 0,2.1 C1.2,2.1 2.1,1.2 2.1,0 C2.1,-1.2 1.2,-2.1 0,-2.1 C-1.2,-2.1 -2.1,-1.2 -2.1,0c " /> - </group> - <group - android:name="_R_G_L_0_G_D_4_P_0_G_0_T_0" - android:translateX="30.3" - android:translateY="29.215"> - <path - android:name="_R_G_L_0_G_D_4_P_0" - android:fillAlpha="1" - android:fillColor="?android:attr/colorError" - android:fillType="nonZero" - android:pathData=" M0.9 3.25 C0.9,3.25 -1.5,3.25 -1.5,3.25 C-1.5,3.25 -1.5,1.25 -1.5,1.25 C-1.5,1.25 -1.5,1.25 -1.5,1.25 C-1.5,1.25 -1.5,-11.71 -1.5,-11.71 C-1.5,-11.71 0.9,-11.71 0.9,-11.71 C0.9,-11.71 0.9,3.25 0.9,3.25c " /> - </group> + android:name="_R_G_L_0_G_D_4_P_0" + android:fillAlpha="1" + android:fillColor="?android:attr/colorError" + android:fillType="nonZero" + android:pathData=" M0.9 3.25 C0.9,3.25 -1.5,3.25 -1.5,3.25 C-1.5,3.25 -1.5,1.25 -1.5,1.25 C-1.5,1.25 -1.5,1.25 -1.5,1.25 C-1.5,1.25 -1.5,-11.71 -1.5,-11.71 C-1.5,-11.71 0.9,-11.71 0.9,-11.71 C0.9,-11.71 0.9,3.25 0.9,3.25c " /> </group> </group> </group> @@ -505,7 +497,7 @@ <aapt:attr name="android:animation"> <set android:ordering="together"> <objectAnimator - android:duration="233" + android:duration="267" android:propertyName="translateX" android:startOffset="0" android:valueFrom="0" diff --git a/packages/SystemUI/res/drawable/face_dialog_face_gray_to_checkmark.xml b/packages/SystemUI/res/drawable/face_dialog_face_gray_to_checkmark.xml deleted file mode 100644 index b09f69b742bb..000000000000 --- a/packages/SystemUI/res/drawable/face_dialog_face_gray_to_checkmark.xml +++ /dev/null @@ -1,637 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><!-- - ~ Copyright (C) 2018 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 - --> - -<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:aapt="http://schemas.android.com/aapt"> - <aapt:attr name="android:drawable"> - <vector - android:width="60dp" - android:height="60dp" - android:viewportWidth="60" - android:viewportHeight="60"> - <group android:name="_R_G"> - <group - android:name="_R_G_L_0_G_N_2_T_0" - android:translateX="30" - android:translateY="30"> - <group - android:name="_R_G_L_0_G" - android:translateX="-30" - android:translateY="-30"> - <group - android:name="_R_G_L_0_G_D_0_P_0_G_0_T_0" - android:scaleX="0.08" - android:scaleY="0.08" - android:translateX="30.1" - android:translateY="30.083"> - <path - android:name="_R_G_L_0_G_D_0_P_0" - android:fillAlpha="0" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M-116 -16.5 C-116,-16.5 -31.25,68.5 -31.25,68.5 C-31.25,68.5 108.75,-71.5 108.75,-71.5 " - android:trimPathStart="0" - android:trimPathEnd="0" - android:trimPathOffset="0" /> - </group> - <group - android:name="_R_G_L_0_G_D_1_P_0_G_0_T_0" - android:scaleX="0.08" - android:scaleY="0.08" - android:translateX="30.1" - android:translateY="30.083"> - <path - android:name="_R_G_L_0_G_D_1_P_0" - android:pathData=" M-116 -16.5 C-116,-16.5 -31.25,68.5 -31.25,68.5 C-31.25,68.5 108.75,-71.5 108.75,-71.5 " - android:strokeWidth="20" - android:strokeAlpha="1" - android:strokeColor="?android:attr/colorAccent" - android:trimPathStart="0" - android:trimPathEnd="0" - android:trimPathOffset="0" /> - </group> - <path - android:name="_R_G_L_0_G_D_2_P_0" - android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " - android:strokeWidth="2.5" - android:strokeAlpha="1" - android:strokeColor="@color/biometric_face_icon_gray" - android:trimPathStart="0" - android:trimPathEnd="1" - android:trimPathOffset="0" /> - <group - android:name="_R_G_L_0_G_D_3_P_0_G_0_T_0" - android:pivotX="1.05" - android:pivotY="-9.891" - android:scaleX="1" - android:scaleY="1" - android:translateX="29.044" - android:translateY="41.647"> - <path - android:name="_R_G_L_0_G_D_3_P_0" - android:pathData=" M4.71 1.1 C3.71,2.12 2.32,2.75 0.79,2.75 C-2.25,2.75 -4.7,0.29 -4.7,-2.75 " - android:strokeWidth="2" - android:strokeAlpha="1" - android:strokeColor="@color/biometric_face_icon_gray" - android:trimPathStart="0" - android:trimPathEnd="1" - android:trimPathOffset="0" /> - </group> - <group - android:name="_R_G_L_0_G_D_4_P_0_G_0_T_0" - android:scaleX="1" - android:scaleY="1" - android:translateX="41.1" - android:translateY="23.8"> - <path - android:name="_R_G_L_0_G_D_4_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M-2.1 0 C-2.1,1.2 -1.2,2.1 0,2.1 C1.1,2.1 2.1,1.2 2.1,0 C2.1,-1.2 1.2,-2.1 0,-2.1 C-1.2,-2.1 -2.1,-1.2 -2.1,0c " /> - </group> - <group - android:name="_R_G_L_0_G_D_5_P_0_G_0_T_0" - android:scaleX="1" - android:scaleY="1" - android:translateX="18.6" - android:translateY="23.8"> - <path - android:name="_R_G_L_0_G_D_5_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M-2.1 0 C-2.1,1.2 -1.2,2.1 0,2.1 C1.2,2.1 2.1,1.2 2.1,0 C2.1,-1.2 1.2,-2.1 0,-2.1 C-1.2,-2.1 -2.1,-1.2 -2.1,0c " /> - </group> - <group - android:name="_R_G_L_0_G_D_6_P_0_G_0_T_0" - android:scaleX="1" - android:scaleY="1" - android:translateX="30.727" - android:translateY="31.703"> - <path - android:name="_R_G_L_0_G_D_6_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M2.6 3.25 C2.6,3.25 -2.6,3.25 -2.6,3.25 C-2.6,3.25 -2.6,1.25 -2.6,1.25 C-2.6,1.25 0.6,1.25 0.6,1.25 C0.6,1.25 0.6,-3.25 0.6,-3.25 C0.6,-3.25 2.6,-3.25 2.6,-3.25 C2.6,-3.25 2.6,3.25 2.6,3.25c " /> - </group> - </group> - </group> - </group> - <group android:name="time_group" /> - </vector> - </aapt:attr> - <target android:name="_R_G_L_0_G_D_0_P_0_G_0_T_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="0.08" - android:valueTo="0.08" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.537,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="33" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="0.08" - android:valueTo="0.08" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.537,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="167" - android:propertyName="scaleX" - android:startOffset="33" - android:valueFrom="0.08" - android:valueTo="0.12789" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.537,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="167" - android:propertyName="scaleY" - android:startOffset="33" - android:valueFrom="0.08" - android:valueTo="0.12789" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.537,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleX" - android:startOffset="200" - android:valueFrom="0.12789" - android:valueTo="0.12241" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.441,0 0.533,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleY" - android:startOffset="200" - android:valueFrom="0.12789" - android:valueTo="0.12241" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.441,0 0.533,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleX" - android:startOffset="300" - android:valueFrom="0.12241" - android:valueTo="0.125" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.424,0 0.486,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleY" - android:startOffset="300" - android:valueFrom="0.12241" - android:valueTo="0.125" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.424,0 0.486,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_0_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.292,0 0.155,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="233" - android:propertyName="trimPathEnd" - android:startOffset="33" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.292,0 0.155,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_1_P_0_G_0_T_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="0.08" - android:valueTo="0.08" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.537,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="33" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="0.08" - android:valueTo="0.08" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.537,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="167" - android:propertyName="scaleX" - android:startOffset="33" - android:valueFrom="0.08" - android:valueTo="0.12789" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.537,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="167" - android:propertyName="scaleY" - android:startOffset="33" - android:valueFrom="0.08" - android:valueTo="0.12789" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.537,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleX" - android:startOffset="200" - android:valueFrom="0.12789" - android:valueTo="0.12241" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.441,0 0.533,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleY" - android:startOffset="200" - android:valueFrom="0.12789" - android:valueTo="0.12241" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.441,0 0.533,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleX" - android:startOffset="300" - android:valueFrom="0.12241" - android:valueTo="0.125" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.424,0 0.486,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleY" - android:startOffset="300" - android:valueFrom="0.12241" - android:valueTo="0.125" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.424,0 0.486,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_1_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.292,0 0.155,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="233" - android:propertyName="trimPathEnd" - android:startOffset="33" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.292,0 0.155,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_2_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="67" - android:propertyName="strokeColor" - android:startOffset="0" - android:valueFrom="@color/biometric_face_icon_gray" - android:valueTo="@color/biometric_face_icon_gray" - android:valueType="colorType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="17" - android:propertyName="strokeColor" - android:startOffset="67" - android:valueFrom="@color/biometric_face_icon_gray" - android:valueTo="?android:attr/colorAccent" - android:valueType="colorType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_3_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="50" - android:propertyName="strokeAlpha" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_3_P_0_G_0_T_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="67" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0.65" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0.65" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_3_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="trimPathStart" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0.5" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_3_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0.5" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_4_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="50" - android:propertyName="fillAlpha" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_4_P_0_G_0_T_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="83" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_5_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="50" - android:propertyName="fillAlpha" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_5_P_0_G_0_T_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="83" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_6_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="50" - android:propertyName="fillAlpha" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_6_P_0_G_0_T_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.287,0.12 0.667,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="83" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.287,0.12 0.667,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="time_group"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="383" - android:propertyName="translateX" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType" /> - </set> - </aapt:attr> - </target> -</animated-vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/face_dialog_face_gray_to_face_blue.xml b/packages/SystemUI/res/drawable/face_dialog_face_gray_to_face_blue.xml deleted file mode 100644 index 9259dc7bb977..000000000000 --- a/packages/SystemUI/res/drawable/face_dialog_face_gray_to_face_blue.xml +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><!-- - ~ 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 - --> - -<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:aapt="http://schemas.android.com/aapt"> - <aapt:attr name="android:drawable"> - <vector - android:width="60dp" - android:height="60dp" - android:viewportHeight="60" - android:viewportWidth="60"> - <group android:name="_R_G"> - <group - android:name="_R_G_L_0_G_N_1_T_0" - android:translateX="30" - android:translateY="30"> - <group - android:name="_R_G_L_0_G" - android:translateX="-30" - android:translateY="-30"> - <path - android:name="_R_G_L_0_G_D_0_P_0" - android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_face_icon_gray" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="2.5" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_0_G_D_1_P_0" - android:pathData=" M33.75 42.75 C32.75,43.76 31.37,44.39 29.83,44.39 C26.8,44.39 24.34,41.93 24.34,38.9 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_face_icon_gray" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="2" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_0_G_D_2_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M39 23.8 C39,25 39.9,25.9 41.1,25.9 C42.2,25.9 43.2,25 43.2,23.8 C43.2,22.6 42.3,21.7 41.1,21.7 C39.9,21.7 39,22.6 39,23.8c " /> - <path - android:name="_R_G_L_0_G_D_3_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M16.5 23.8 C16.5,25 17.4,25.9 18.6,25.9 C19.8,25.9 20.7,25 20.7,23.8 C20.7,22.6 19.8,21.7 18.6,21.7 C17.4,21.7 16.5,22.6 16.5,23.8c " /> - <path - android:name="_R_G_L_0_G_D_4_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_face_icon_gray" - android:fillType="nonZero" - android:pathData=" M32.9 34.7 C32.9,34.7 27.7,34.7 27.7,34.7 C27.7,34.7 27.7,32.7 27.7,32.7 C27.7,32.7 30.9,32.7 30.9,32.7 C30.9,32.7 30.9,28.2 30.9,28.2 C30.9,28.2 32.9,28.2 32.9,28.2 C32.9,28.2 32.9,34.7 32.9,34.7c " /> - </group> - </group> - </group> - <group android:name="time_group" /> - </vector> - </aapt:attr> - <target android:name="_R_G_L_0_G_D_0_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="strokeColor" - android:startOffset="0" - android:valueFrom="@color/biometric_face_icon_gray" - android:valueTo="?android:attr/colorAccent" - android:valueType="colorType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_1_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="strokeColor" - android:startOffset="0" - android:valueFrom="@color/biometric_face_icon_gray" - android:valueTo="?android:attr/colorAccent" - android:valueType="colorType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_2_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="fillColor" - android:startOffset="0" - android:valueFrom="@color/biometric_face_icon_gray" - android:valueTo="?android:attr/colorAccent" - android:valueType="colorType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_3_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="fillColor" - android:startOffset="0" - android:valueFrom="@color/biometric_face_icon_gray" - android:valueTo="?android:attr/colorAccent" - android:valueType="colorType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_0_G_D_4_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="33" - android:propertyName="fillColor" - android:startOffset="0" - android:valueFrom="@color/biometric_face_icon_gray" - android:valueTo="?android:attr/colorAccent" - android:valueType="colorType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0.167 0.833,0.833 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="time_group"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="50" - android:propertyName="translateX" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType" /> - </set> - </aapt:attr> - </target> -</animated-vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/face_dialog_pulse_dark_to_light.xml b/packages/SystemUI/res/drawable/face_dialog_pulse_dark_to_light.xml new file mode 100644 index 000000000000..0de856c28dcd --- /dev/null +++ b/packages/SystemUI/res/drawable/face_dialog_pulse_dark_to_light.xml @@ -0,0 +1,183 @@ +<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt"> + <aapt:attr name="android:drawable"> + <vector + android:width="60dp" + android:height="60dp" + android:viewportWidth="60" + android:viewportHeight="60"> + <group android:name="_R_G"> + <group + android:name="_R_G_L_0_G" + android:pivotX="30" + android:pivotY="30" + android:scaleX="1" + android:scaleY="1"> + <path + android:name="_R_G_L_0_G_D_0_P_0" + android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " + android:strokeWidth="2.5" + android:strokeAlpha="1" + android:strokeColor="?android:attr/colorAccent" + android:trimPathStart="0" + android:trimPathEnd="1" + android:trimPathOffset="0" /> + <path + android:name="_R_G_L_0_G_D_1_P_0" + android:pathData=" M33.75 42.75 C32.75,43.77 31.37,44.39 29.83,44.39 C26.8,44.39 24.34,41.93 24.34,38.9 " + android:strokeWidth="2" + android:strokeAlpha="1" + android:strokeColor="?android:attr/colorAccent" + android:trimPathStart="0" + android:trimPathEnd="1" + android:trimPathOffset="0" /> + <path + android:name="_R_G_L_0_G_D_2_P_0" + android:fillAlpha="1" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M39 23.8 C39,25 39.9,25.9 41.1,25.9 C42.2,25.9 43.2,25 43.2,23.8 C43.2,22.6 42.3,21.7 41.1,21.7 C39.9,21.7 39,22.6 39,23.8c " /> + <path + android:name="_R_G_L_0_G_D_3_P_0" + android:fillAlpha="1" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M16.5 23.8 C16.5,25 17.4,25.9 18.6,25.9 C19.8,25.9 20.7,25 20.7,23.8 C20.7,22.6 19.8,21.7 18.6,21.7 C17.4,21.7 16.5,22.6 16.5,23.8c " /> + <path + android:name="_R_G_L_0_G_D_4_P_0" + android:fillAlpha="1" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M33.33 34.95 C33.33,34.95 28.13,34.95 28.13,34.95 C28.13,34.95 28.13,32.95 28.13,32.95 C28.13,32.95 31.33,32.95 31.33,32.95 C31.33,32.95 31.33,28.45 31.33,28.45 C31.33,28.45 33.33,28.45 33.33,28.45 C33.33,28.45 33.33,34.95 33.33,34.95c " /> + </group> + </group> + <group android:name="time_group" /> + </vector> + </aapt:attr> + <target android:name="_R_G_L_0_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="strokeAlpha" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="0.5" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_1_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="strokeAlpha" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="0.5" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_2_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="fillAlpha" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="0.5" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_3_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="fillAlpha" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="0.5" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_4_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="fillAlpha" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="0.5" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="scaleX" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="1.03" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="333" + android:propertyName="scaleY" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="1.03" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="time_group"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="350" + android:propertyName="translateX" + android:startOffset="0" + android:valueFrom="0" + android:valueTo="1" + android:valueType="floatType" /> + </set> + </aapt:attr> + </target> +</animated-vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/face_dialog_pulse_light_to_dark.xml b/packages/SystemUI/res/drawable/face_dialog_pulse_light_to_dark.xml new file mode 100644 index 000000000000..31a0cbb2605c --- /dev/null +++ b/packages/SystemUI/res/drawable/face_dialog_pulse_light_to_dark.xml @@ -0,0 +1,183 @@ +<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt"> + <aapt:attr name="android:drawable"> + <vector + android:width="60dp" + android:height="60dp" + android:viewportWidth="60" + android:viewportHeight="60"> + <group android:name="_R_G"> + <group + android:name="_R_G_L_0_G" + android:pivotX="30" + android:pivotY="30" + android:scaleX="1.03" + android:scaleY="1.03"> + <path + android:name="_R_G_L_0_G_D_0_P_0" + android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " + android:strokeWidth="2.5" + android:strokeAlpha="0.5" + android:strokeColor="?android:attr/colorAccent" + android:trimPathStart="0" + android:trimPathEnd="1" + android:trimPathOffset="0" /> + <path + android:name="_R_G_L_0_G_D_1_P_0" + android:pathData=" M33.75 42.75 C32.75,43.77 31.37,44.39 29.83,44.39 C26.8,44.39 24.34,41.93 24.34,38.9 " + android:strokeWidth="2" + android:strokeAlpha="0.5" + android:strokeColor="?android:attr/colorAccent" + android:trimPathStart="0" + android:trimPathEnd="1" + android:trimPathOffset="0" /> + <path + android:name="_R_G_L_0_G_D_2_P_0" + android:fillAlpha="0.5" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M39 23.8 C39,25 39.9,25.9 41.1,25.9 C42.2,25.9 43.2,25 43.2,23.8 C43.2,22.6 42.3,21.7 41.1,21.7 C39.9,21.7 39,22.6 39,23.8c " /> + <path + android:name="_R_G_L_0_G_D_3_P_0" + android:fillAlpha="0.5" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M16.5 23.8 C16.5,25 17.4,25.9 18.6,25.9 C19.8,25.9 20.7,25 20.7,23.8 C20.7,22.6 19.8,21.7 18.6,21.7 C17.4,21.7 16.5,22.6 16.5,23.8c " /> + <path + android:name="_R_G_L_0_G_D_4_P_0" + android:fillAlpha="0.5" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M33.33 34.95 C33.33,34.95 28.13,34.95 28.13,34.95 C28.13,34.95 28.13,32.95 28.13,32.95 C28.13,32.95 31.33,32.95 31.33,32.95 C31.33,32.95 31.33,28.45 31.33,28.45 C31.33,28.45 33.33,28.45 33.33,28.45 C33.33,28.45 33.33,34.95 33.33,34.95c " /> + </group> + </group> + <group android:name="time_group" /> + </vector> + </aapt:attr> + <target android:name="_R_G_L_0_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="strokeAlpha" + android:startOffset="0" + android:valueFrom="0.5" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_1_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="strokeAlpha" + android:startOffset="0" + android:valueFrom="0.5" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_2_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="fillAlpha" + android:startOffset="0" + android:valueFrom="0.5" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_3_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="fillAlpha" + android:startOffset="0" + android:valueFrom="0.5" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_4_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="fillAlpha" + android:startOffset="0" + android:valueFrom="0.5" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="333" + android:propertyName="scaleX" + android:startOffset="0" + android:valueFrom="1.03" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="333" + android:propertyName="scaleY" + android:startOffset="0" + android:valueFrom="1.03" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.317,0 0.287,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="time_group"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="350" + android:propertyName="translateX" + android:startOffset="0" + android:valueFrom="0" + android:valueTo="1" + android:valueType="floatType" /> + </set> + </aapt:attr> + </target> +</animated-vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/face_dialog_wink_from_dark.xml b/packages/SystemUI/res/drawable/face_dialog_wink_from_dark.xml new file mode 100644 index 000000000000..adbe446abb9d --- /dev/null +++ b/packages/SystemUI/res/drawable/face_dialog_wink_from_dark.xml @@ -0,0 +1,208 @@ +<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt"> + <aapt:attr name="android:drawable"> + <vector + android:width="60dp" + android:height="60dp" + android:viewportWidth="60" + android:viewportHeight="60"> + <group android:name="_R_G"> + <group android:name="_R_G_L_1_G"> + <path + android:name="_R_G_L_1_G_D_0_P_0" + android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " + android:strokeWidth="2.5" + android:strokeAlpha="1" + android:strokeColor="?android:attr/colorAccent" + android:trimPathStart="0" + android:trimPathEnd="1" + android:trimPathOffset="0" /> + </group> + <group + android:name="_R_G_L_0_G" + android:pivotX="30" + android:pivotY="30" + android:rotation="0" + android:scaleX="1" + android:scaleY="1"> + <path + android:name="_R_G_L_0_G_D_0_P_0" + android:pathData=" M33.75 42.75 C32.75,43.77 31.37,44.39 29.83,44.39 C26.8,44.39 24.34,41.93 24.34,38.9 " + android:strokeWidth="2" + android:strokeAlpha="1" + android:strokeColor="?android:attr/colorAccent" + android:trimPathStart="0" + android:trimPathEnd="1" + android:trimPathOffset="0" /> + <path + android:name="_R_G_L_0_G_D_1_P_0" + android:fillAlpha="1" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M39 23.8 C39,25 39.9,25.9 41.1,25.9 C42.2,25.9 43.2,25 43.2,23.8 C43.2,22.6 42.3,21.7 41.1,21.7 C39.9,21.7 39,22.6 39,23.8c " /> + <group + android:name="_R_G_L_0_G_D_2_P_0_G_0_T_0" + android:scaleX="1" + android:scaleY="1" + android:translateX="18.6" + android:translateY="23.8"> + <path + android:name="_R_G_L_0_G_D_2_P_0" + android:fillAlpha="1" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M-2.1 0 C-2.1,1.2 -1.2,2.1 0,2.1 C1.2,2.1 2.1,1.2 2.1,0 C2.1,-1.2 1.2,-2.1 0,-2.1 C-1.2,-2.1 -2.1,-1.2 -2.1,0c " /> + </group> + <path + android:name="_R_G_L_0_G_D_3_P_0" + android:fillAlpha="1" + android:fillColor="?android:attr/colorAccent" + android:fillType="nonZero" + android:pathData=" M33.33 34.95 C33.33,34.95 28.13,34.95 28.13,34.95 C28.13,34.95 28.13,32.95 28.13,32.95 C28.13,32.95 31.33,32.95 31.33,32.95 C31.33,32.95 31.33,28.45 31.33,28.45 C31.33,28.45 33.33,28.45 33.33,28.45 C33.33,28.45 33.33,34.95 33.33,34.95c " /> + </group> + </group> + <group android:name="time_group" /> + </vector> + </aapt:attr> + <target android:name="_R_G_L_0_G_D_2_P_0_G_0_T_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="433" + android:propertyName="scaleX" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="433" + android:propertyName="scaleY" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="0.26" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="317" + android:propertyName="scaleX" + android:startOffset="433" + android:valueFrom="1" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="317" + android:propertyName="scaleY" + android:startOffset="433" + android:valueFrom="0.26" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="433" + android:propertyName="rotation" + android:startOffset="0" + android:valueFrom="0" + android:valueTo="-14" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.5,0 0.2,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="317" + android:propertyName="rotation" + android:startOffset="433" + android:valueFrom="-14" + android:valueTo="0" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.305,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="433" + android:propertyName="scaleX" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="1.06" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.5,0 0.2,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="433" + android:propertyName="scaleY" + android:startOffset="0" + android:valueFrom="1" + android:valueTo="1.06" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.5,0 0.2,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="317" + android:propertyName="scaleX" + android:startOffset="433" + android:valueFrom="1.06" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.305,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + <objectAnimator + android:duration="317" + android:propertyName="scaleY" + android:startOffset="433" + android:valueFrom="1.06" + android:valueTo="1" + android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.305,1 1.0,1.0" /> + </aapt:attr> + </objectAnimator> + </set> + </aapt:attr> + </target> + <target android:name="time_group"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator + android:duration="1017" + android:propertyName="translateX" + android:startOffset="0" + android:valueFrom="0" + android:valueTo="1" + android:valueType="floatType" /> + </set> + </aapt:attr> + </target> +</animated-vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/bubble_expanded_view.xml b/packages/SystemUI/res/layout/bubble_expanded_view.xml index b73412526f5e..5b93edd1e6b3 100644 --- a/packages/SystemUI/res/layout/bubble_expanded_view.xml +++ b/packages/SystemUI/res/layout/bubble_expanded_view.xml @@ -27,35 +27,14 @@ android:layout_height="@dimen/bubble_pointer_height" /> - <FrameLayout - android:id="@+id/permission_or_settings" - android:layout_width="match_parent" + <com.android.systemui.statusbar.AlphaOptimizedButton + style="@android:style/Widget.Material.Button.Borderless" + android:id="@+id/settings_button" + android:layout_gravity="end" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:animateLayoutChanges="true"> - - <com.android.systemui.statusbar.AlphaOptimizedButton - style="@android:style/Widget.Material.Button.Borderless" - android:id="@+id/settings_button" - android:layout_gravity="end" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:focusable="true" - android:text="@string/manage_bubbles_text" - android:textColor="?attr/wallpaperTextColor"/> - - <include layout="@layout/bubble_permission_view" - android:id="@+id/permission_layout" - android:layout_width="match_parent" - android:layout_height="wrap_content" - /> - - <View - android:id="@+id/divider" - android:layout_width="match_parent" - android:layout_height="1dp" - android:layout_gravity="bottom" - android:background="?android:attr/dividerHorizontal"/> - - </FrameLayout> + android:focusable="true" + android:text="@string/manage_bubbles_text" + android:textColor="?attr/wallpaperTextColor"/> </com.android.systemui.bubbles.BubbleExpandedView> diff --git a/packages/SystemUI/res/layout/bubble_permission_view.xml b/packages/SystemUI/res/layout/bubble_permission_view.xml deleted file mode 100644 index df5264cc7706..000000000000 --- a/packages/SystemUI/res/layout/bubble_permission_view.xml +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright 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. ---> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="@dimen/bubble_permission_height" - android:animateLayoutChanges="true" - android:orientation="vertical" - android:paddingStart="@dimen/bubble_expanded_header_horizontal_padding" - android:paddingEnd="@dimen/bubble_expanded_header_horizontal_padding"> - - <!-- App info --> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:layout_marginTop="@dimen/bubble_expanded_header_horizontal_padding" > - - <ImageView - android:id="@+id/pkgicon" - android:layout_width="@dimen/bubble_permission_icon_size" - android:layout_height="@dimen/bubble_permission_icon_size" - android:layout_centerVertical="true" - android:layout_marginEnd="3dp" - /> - - <TextView - android:id="@+id/pkgname" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:textAppearance="@*android:style/TextAppearance.Material.Body2" - android:layout_marginStart="3dp" - android:layout_marginEnd="2dp" - android:singleLine="true" - android:gravity="center_vertical" - android:layout_centerVertical="true" - /> - </LinearLayout> - - <!-- Actual permission --> - <TextView - android:id="@+id/prompt" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:text="@string/bubbles_prompt" - style="@*android:style/TextAppearance.DeviceDefault.Notification.Title"/> - - <!-- Buttons --> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:gravity="end" - android:orientation="horizontal"> - - <TextView - android:id="@+id/no_bubbles_button" - android:text="@string/no_bubbles" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:background="@drawable/ripple_drawable" - style="@style/TextAppearance.NotificationInfo.Button"/> - <TextView - android:id="@+id/yes_bubbles_button" - android:text="@string/yes_bubbles" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:background="@drawable/ripple_drawable" - style="@style/TextAppearance.NotificationInfo.Button"/> - </LinearLayout> -</LinearLayout>
\ No newline at end of file diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index b673e5207f80..88466ce286a8 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -157,7 +157,7 @@ <!-- Biometric dialog colors --> <color name="biometric_dialog_dim_color">#80000000</color> <!-- 50% black --> - <color name="biometric_face_icon_gray">#ffbdc1c6</color> + <color name="biometric_face_icon_gray">#ff757575</color> <!-- Logout button --> <color name="logout_button_bg_color">#ccffffff</color> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index bb7b6630cb19..7b27cc479a85 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1123,12 +1123,8 @@ <dimen name="bubble_stack_starting_offset_y">100dp</dimen> <!-- Size of image buttons in the bubble header --> <dimen name="bubble_header_icon_size">48dp</dimen> - <!-- Size of the app icon shown in the bubble permission view --> - <dimen name="bubble_permission_icon_size">24dp</dimen> <!-- Space between the pointer triangle and the bubble expanded view --> <dimen name="bubble_pointer_margin">8dp</dimen> - <!-- Height of the permission prompt shown with bubbles --> - <dimen name="bubble_permission_height">120dp</dimen> <!-- Size of the RAT type for CellularTile --> <dimen name="celltile_rat_type_size">10sp</dimen> diff --git a/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java b/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java index 12d1f7c3118d..c407ba8abf22 100644 --- a/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java +++ b/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java @@ -174,6 +174,9 @@ public class CarrierTextController { mSimSlotsNumber = ((TelephonyManager) context.getSystemService( Context.TELEPHONY_SERVICE)).getPhoneCount(); mSimErrorState = new boolean[mSimSlotsNumber]; + updateDisplayOpportunisticSubscriptionCarrierText(SystemProperties.getBoolean( + TelephonyProperties.DISPLAY_OPPORTUNISTIC_SUBSCRIPTION_CARRIER_TEXT_PROPERTY_NAME, + false)); } /** @@ -282,10 +285,8 @@ public class CarrierTextController { * */ @VisibleForTesting - public void updateDisplayOpportunisticSubscriptionCarrierText() { - mDisplayOpportunisticSubscriptionCarrierText = SystemProperties - .getBoolean(TelephonyProperties - .DISPLAY_OPPORTUNISTIC_SUBSCRIPTION_CARRIER_TEXT_PROPERTY_NAME, false); + public void updateDisplayOpportunisticSubscriptionCarrierText(boolean isEnable) { + mDisplayOpportunisticSubscriptionCarrierText = isEnable; } protected List<SubscriptionInfo> getSubscriptionInfo() { diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index f7ecfd7d1205..de49b92fdeb5 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -34,7 +34,8 @@ import android.view.View; import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityEvent; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; import com.android.systemui.statusbar.FlingAnimationUtils; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; @@ -112,7 +113,7 @@ public class SwipeHelper implements Gefingerpoken { mDensityScale = res.getDisplayMetrics().density; mFalsingThreshold = res.getDimensionPixelSize(R.dimen.swipe_helper_falsing_threshold); mFadeDependingOnAmountSwiped = res.getBoolean(R.bool.config_fadeDependingOnAmountSwiped); - mFalsingManager = FalsingManager.getInstance(context); + mFalsingManager = FalsingManagerFactory.getInstance(context); mFlingAnimationUtils = new FlingAnimationUtils(context, getMaxEscapeAnimDuration() / 1000f); } diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java index f9926f3550ec..0fdab014439b 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java @@ -33,7 +33,7 @@ import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.ViewMediatorCallback; import com.android.systemui.assist.AssistManager; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; import com.android.systemui.dock.DockManager; import com.android.systemui.fragments.FragmentService; import com.android.systemui.keyguard.DismissCallbackRegistry; @@ -129,8 +129,9 @@ public class SystemUIFactory { DismissCallbackRegistry dismissCallbackRegistry, KeyguardBouncer.BouncerExpansionCallback expansionCallback) { return new KeyguardBouncer(context, callback, lockPatternUtils, container, - dismissCallbackRegistry, FalsingManager.getInstance(context), expansionCallback, - KeyguardUpdateMonitor.getInstance(context), new Handler(Looper.getMainLooper())); + dismissCallbackRegistry, FalsingManagerFactory.getInstance(context), + expansionCallback, KeyguardUpdateMonitor.getInstance(context), + new Handler(Looper.getMainLooper())); } public ScrimController createScrimController(ScrimView scrimBehind, ScrimView scrimInFront, diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java index 4ed28f92d5cb..68cf15d262de 100644 --- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java +++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java @@ -15,6 +15,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.PixelFormat; import android.graphics.Rect; +import android.metrics.LogMaker; import android.os.AsyncTask; import android.os.Binder; import android.os.Bundle; @@ -35,6 +36,8 @@ import android.widget.ImageView; import com.android.internal.app.AssistUtils; import com.android.internal.app.IVoiceInteractionSessionListener; import com.android.internal.app.IVoiceInteractionSessionShowCallback; +import com.android.internal.logging.MetricsLogger; +import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.settingslib.applications.InterestingConfigChanges; import com.android.systemui.ConfigurationChangedReceiver; @@ -185,6 +188,10 @@ public class AssistManager implements ConfigurationChangedReceiver { args = new Bundle(); } args.putLong(INVOCATION_TIME_MS_KEY, SystemClock.uptimeMillis()); + // Logs assistant start with invocation type. + MetricsLogger.action( + new LogMaker(MetricsEvent.ASSISTANT) + .setType(MetricsEvent.TYPE_OPEN).setSubtype(args.getInt(INVOCATION_TYPE_KEY))); startAssistInternal(args, assistComponent, isService); } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java index 420d0fac433e..9dfcf7d01e31 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java @@ -76,8 +76,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba } case MSG_BIOMETRIC_HELP: { SomeArgs args = (SomeArgs) msg.obj; - handleBiometricHelp((String) args.arg1 /* message */, - (boolean) args.arg2 /* requireTryAgain */); + handleBiometricHelp((String) args.arg1 /* message */); args.recycle(); break; } @@ -182,7 +181,6 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba if (DEBUG) Log.d(TAG, "onBiometricHelp: " + message); SomeArgs args = SomeArgs.obtain(); args.arg1 = message; - args.arg2 = false; // requireTryAgain mHandler.obtainMessage(MSG_BIOMETRIC_HELP, args).sendToTarget(); } @@ -257,14 +255,13 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba }, mCurrentDialog.getDelayAfterAuthenticatedDurationMs()); } } else { - handleBiometricHelp(failureReason, true /* requireTryAgain */); - mCurrentDialog.showTryAgainButton(true /* show */); + mCurrentDialog.onAuthenticationFailed(failureReason); } } - private void handleBiometricHelp(String message, boolean requireTryAgain) { + private void handleBiometricHelp(String message) { if (DEBUG) Log.d(TAG, "handleBiometricHelp: " + message); - mCurrentDialog.showHelpMessage(message, requireTryAgain); + mCurrentDialog.onHelpReceived(message); } private void handleBiometricError(String error) { @@ -273,7 +270,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba if (DEBUG) Log.d(TAG, "Dialog already dismissed"); return; } - mCurrentDialog.showErrorMessage(error); + mCurrentDialog.onErrorReceived(error); } private void handleHideDialog(boolean userCanceled) { diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java index 32a76784930f..f17fcbab31c4 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java @@ -21,7 +21,6 @@ import android.content.Context; import android.content.res.TypedArray; import android.graphics.PixelFormat; import android.graphics.PorterDuff; -import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.Drawable; import android.hardware.biometrics.BiometricPrompt; import android.os.Binder; @@ -62,7 +61,7 @@ public abstract class BiometricDialogView extends LinearLayout { private static final int ANIMATION_DURATION_SHOW = 250; // ms private static final int ANIMATION_DURATION_AWAY = 350; // ms - private static final int MSG_CLEAR_MESSAGE = 1; + protected static final int MSG_CLEAR_MESSAGE = 1; protected static final int STATE_IDLE = 0; protected static final int STATE_AUTHENTICATING = 1; @@ -78,7 +77,7 @@ public abstract class BiometricDialogView extends LinearLayout { private final float mAnimationTranslationOffset; private final int mErrorColor; private final float mDialogWidth; - private final DialogViewCallback mCallback; + protected final DialogViewCallback mCallback; protected final ViewGroup mLayout; protected final LinearLayout mDialog; @@ -105,11 +104,10 @@ public abstract class BiometricDialogView extends LinearLayout { protected abstract int getHintStringResourceId(); protected abstract int getAuthenticatedAccessibilityResourceId(); protected abstract int getIconDescriptionResourceId(); - protected abstract Drawable getAnimationForTransition(int oldState, int newState); - protected abstract boolean shouldAnimateForTransition(int oldState, int newState); protected abstract int getDelayAfterAuthenticatedDurationMs(); protected abstract boolean shouldGrayAreaDismissDialog(); - protected abstract void handleClearMessage(boolean requireTryAgain); + protected abstract void handleClearMessage(); + protected abstract void updateIcon(int oldState, int newState); private final Runnable mShowAnimationRunnable = new Runnable() { @Override @@ -125,16 +123,17 @@ public abstract class BiometricDialogView extends LinearLayout { .setDuration(ANIMATION_DURATION_SHOW) .setInterpolator(mLinearOutSlowIn) .withLayer() + .withEndAction(() -> onDialogAnimatedIn()) .start(); } }; - private Handler mHandler = new Handler() { + protected Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { switch(msg.what) { case MSG_CLEAR_MESSAGE: - handleClearMessage((boolean) msg.obj /* requireTryAgain */); + handleClearMessage(); break; default: Log.e(TAG, "Unhandled message: " + msg.what); @@ -224,8 +223,9 @@ public abstract class BiometricDialogView extends LinearLayout { }); mTryAgainButton.setOnClickListener((View v) -> { + updateState(STATE_AUTHENTICATING); showTryAgainButton(false /* show */); - handleClearMessage(false /* requireTryAgain */); + handleClearMessage(); mCallback.onTryAgainPressed(); }); @@ -314,25 +314,6 @@ public abstract class BiometricDialogView extends LinearLayout { mSkipIntro = false; } - protected void updateIcon(int lastState, int newState) { - final Drawable icon = getAnimationForTransition(lastState, newState); - if (icon == null) { - Log.e(TAG, "Animation not found, " + lastState + " -> " + newState); - return; - } - - final AnimatedVectorDrawable animation = icon instanceof AnimatedVectorDrawable - ? (AnimatedVectorDrawable) icon - : null; - - mBiometricIcon.setImageDrawable(icon); - - if (animation != null && shouldAnimateForTransition(lastState, newState)) { - animation.forceAnimationOnUI(); - animation.start(); - } - } - private void setDismissesDialog(View v) { v.setClickable(true); v.setOnTouchListener((View view, MotionEvent event) -> { @@ -353,7 +334,7 @@ public abstract class BiometricDialogView extends LinearLayout { mWindowManager.removeView(BiometricDialogView.this); mAnimatingAway = false; // Set the icons / text back to normal state - handleClearMessage(false /* requireTryAgain */); + handleClearMessage(); showTryAgainButton(false /* show */); updateState(STATE_IDLE); } @@ -424,29 +405,44 @@ public abstract class BiometricDialogView extends LinearLayout { } // Shows an error/help message - private void showTemporaryMessage(String message, boolean requireTryAgain) { + protected void showTemporaryMessage(String message) { mHandler.removeMessages(MSG_CLEAR_MESSAGE); - updateState(STATE_ERROR); mErrorText.setText(message); mErrorText.setTextColor(mErrorColor); mErrorText.setContentDescription(message); - mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_MESSAGE, requireTryAgain), + mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_MESSAGE), BiometricPrompt.HIDE_DIALOG_DELAY); } public void clearTemporaryMessage() { mHandler.removeMessages(MSG_CLEAR_MESSAGE); - mHandler.obtainMessage(MSG_CLEAR_MESSAGE, false /* requireTryAgain */).sendToTarget(); + mHandler.obtainMessage(MSG_CLEAR_MESSAGE).sendToTarget(); } - public void showHelpMessage(String message, boolean requireTryAgain) { - showTemporaryMessage(message, requireTryAgain); + /** + * Transient help message (acquire) is received, dialog stays showing. Sensor stays in + * "authenticating" state. + * @param message + */ + public void onHelpReceived(String message) { + updateState(STATE_ERROR); + showTemporaryMessage(message); } - public void showErrorMessage(String error) { - showTemporaryMessage(error, false /* requireTryAgain */); + public void onAuthenticationFailed(String message) { + updateState(STATE_ERROR); + showTemporaryMessage(message); + } + + /** + * Hard error is received, dialog will be dismissed soon. + * @param error + */ + public void onErrorReceived(String error) { + updateState(STATE_ERROR); + showTemporaryMessage(error); showTryAgainButton(false /* show */); - mCallback.onErrorShown(); + mCallback.onErrorShown(); // TODO: Split between fp and face } public void updateState(int newState) { @@ -471,6 +467,9 @@ public abstract class BiometricDialogView extends LinearLayout { public void showTryAgainButton(boolean show) { } + public void onDialogAnimatedIn() { + } + public void restoreState(Bundle bundle) { mTryAgainButton.setVisibility(bundle.getInt(KEY_TRY_AGAIN_VISIBILITY)); mPositiveButton.setVisibility(bundle.getInt(KEY_CONFIRM_VISIBILITY)); diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java index 28156daaec08..9a0b1906dd4a 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java @@ -22,10 +22,14 @@ import android.animation.AnimatorSet; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Outline; +import android.graphics.drawable.Animatable2; +import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.Drawable; +import android.hardware.biometrics.BiometricPrompt; import android.os.Bundle; import android.text.TextUtils; import android.util.DisplayMetrics; +import android.util.Log; import android.view.View; import android.view.ViewOutlineProvider; @@ -54,6 +58,64 @@ public class FaceDialogView extends BiometricDialogView { private int mSize; private float mIconOriginalY; private DialogOutlineProvider mOutlineProvider = new DialogOutlineProvider(); + private IconController mIconController; + private boolean mDialogAnimatedIn; + + /** + * Class that handles the biometric icon animations. + */ + private final class IconController extends Animatable2.AnimationCallback { + + private boolean mLastPulseDirection; // false = dark to light, true = light to dark + + int mState; + + IconController() { + mState = STATE_IDLE; + } + + public void animateOnce(int iconRes) { + animateIcon(iconRes, false); + } + + public void startPulsing() { + mLastPulseDirection = false; + animateIcon(R.drawable.face_dialog_pulse_dark_to_light, true); + } + + public void showIcon(int iconRes) { + final Drawable drawable = mContext.getDrawable(iconRes); + mBiometricIcon.setImageDrawable(drawable); + } + + private void animateIcon(int iconRes, boolean repeat) { + final AnimatedVectorDrawable icon = + (AnimatedVectorDrawable) mContext.getDrawable(iconRes); + mBiometricIcon.setImageDrawable(icon); + icon.forceAnimationOnUI(); + if (repeat) { + icon.registerAnimationCallback(this); + } + icon.start(); + } + + private void pulseInNextDirection() { + int iconRes = mLastPulseDirection ? R.drawable.face_dialog_pulse_dark_to_light + : R.drawable.face_dialog_pulse_light_to_dark; + animateIcon(iconRes, true /* repeat */); + mLastPulseDirection = !mLastPulseDirection; + } + + @Override + public void onAnimationEnd(Drawable drawable) { + super.onAnimationEnd(drawable); + + if (mState == STATE_AUTHENTICATING) { + // Still authenticating, pulse the icon + pulseInNextDirection(); + } + } + } private final class DialogOutlineProvider extends ViewOutlineProvider { @@ -79,9 +141,15 @@ public class FaceDialogView extends BiometricDialogView { } } + private final Runnable mErrorToIdleAnimationRunnable = () -> { + updateState(STATE_IDLE); + mErrorText.setVisibility(View.INVISIBLE); + }; + public FaceDialogView(Context context, DialogViewCallback callback) { super(context, callback); + mIconController = new IconController(); } private void updateSize(int newSize) { @@ -212,18 +280,9 @@ public class FaceDialogView extends BiometricDialogView { @Override - protected void handleClearMessage(boolean requireTryAgain) { - // Clears the temporary message and shows the help message. If requireTryAgain is true, - // we will start the authenticating state again. - if (!requireTryAgain) { - updateState(STATE_AUTHENTICATING); - mErrorText.setText(getHintStringResourceId()); - mErrorText.setTextColor(mTextColor); - mErrorText.setVisibility(View.VISIBLE); - } else { - updateState(STATE_IDLE); - mErrorText.setVisibility(View.INVISIBLE); - } + protected void handleClearMessage() { + mErrorText.setText(getHintStringResourceId()); + mErrorText.setTextColor(mTextColor); } @Override @@ -270,9 +329,8 @@ public class FaceDialogView extends BiometricDialogView { } @Override - public void showErrorMessage(String error) { - super.showErrorMessage(error); - + public void onErrorReceived(String error) { + super.onErrorReceived(error); // All error messages will cause the dialog to go from small -> big. Error messages // are messages such as lockout, auth failed, etc. if (mSize == SIZE_SMALL) { @@ -281,6 +339,12 @@ public class FaceDialogView extends BiometricDialogView { } @Override + public void onAuthenticationFailed(String message) { + super.onAuthenticationFailed(message); + showTryAgainButton(true); + } + + @Override public void showTryAgainButton(boolean show) { if (show && mSize == SIZE_SMALL) { // Do not call super, we will nicely animate the alpha together with the rest @@ -321,27 +385,39 @@ public class FaceDialogView extends BiometricDialogView { } @Override - protected boolean shouldAnimateForTransition(int oldState, int newState) { - if (oldState == STATE_ERROR && newState == STATE_IDLE) { - return true; - } else if (oldState == STATE_IDLE && newState == STATE_AUTHENTICATING) { - return false; - } else if (oldState == STATE_AUTHENTICATING && newState == STATE_ERROR) { - return true; - } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATING) { - return true; - } else if (oldState == STATE_AUTHENTICATING && newState == STATE_PENDING_CONFIRMATION) { - return true; + protected void updateIcon(int oldState, int newState) { + mIconController.mState = newState; + + if (oldState == STATE_IDLE && newState == STATE_AUTHENTICATING) { + if (mDialogAnimatedIn) { + mIconController.startPulsing(); + mErrorText.setVisibility(View.VISIBLE); + } else { + mIconController.showIcon(R.drawable.face_dialog_pulse_dark_to_light); + } } else if (oldState == STATE_PENDING_CONFIRMATION && newState == STATE_AUTHENTICATED) { - return true; + mIconController.animateOnce(R.drawable.face_dialog_dark_to_checkmark); + } else if (oldState == STATE_ERROR && newState == STATE_IDLE) { + mIconController.animateOnce(R.drawable.face_dialog_error_to_idle); + } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATING) { + mHandler.removeCallbacks(mErrorToIdleAnimationRunnable); + mIconController.startPulsing(); + } else if (oldState == STATE_AUTHENTICATING && newState == STATE_ERROR) { + mIconController.animateOnce(R.drawable.face_dialog_dark_to_error); + mHandler.postDelayed(mErrorToIdleAnimationRunnable, BiometricPrompt.HIDE_DIALOG_DELAY); } else if (oldState == STATE_AUTHENTICATING && newState == STATE_AUTHENTICATED) { - return true; - } else if (oldState == STATE_ERROR && newState == STATE_PENDING_CONFIRMATION) { - return true; - } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATED) { - return true; + mIconController.animateOnce(R.drawable.face_dialog_dark_to_checkmark); + } else if (oldState == STATE_AUTHENTICATING && newState == STATE_PENDING_CONFIRMATION) { + mIconController.animateOnce(R.drawable.face_dialog_wink_from_dark); + } else { + Log.w(TAG, "Unknown animation from " + oldState + " -> " + newState); } - return false; + } + + @Override + public void onDialogAnimatedIn() { + mDialogAnimatedIn = true; + mIconController.startPulsing(); } @Override @@ -357,33 +433,6 @@ public class FaceDialogView extends BiometricDialogView { return true; } - @Override - protected Drawable getAnimationForTransition(int oldState, int newState) { - int iconRes; - if (oldState == STATE_ERROR && newState == STATE_IDLE) { - iconRes = R.drawable.face_dialog_error_to_face; - } else if (oldState == STATE_IDLE && newState == STATE_AUTHENTICATING) { - iconRes = R.drawable.face_dialog_face_to_error; - } else if (oldState == STATE_AUTHENTICATING && newState == STATE_ERROR) { - iconRes = R.drawable.face_dialog_face_to_error; - } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATING) { - iconRes = R.drawable.face_dialog_error_to_face; - } else if (oldState == STATE_AUTHENTICATING && newState == STATE_PENDING_CONFIRMATION) { - iconRes = R.drawable.face_dialog_face_gray_to_face_blue; - } else if (oldState == STATE_PENDING_CONFIRMATION && newState == STATE_AUTHENTICATED) { - iconRes = R.drawable.face_dialog_face_blue_to_checkmark; - } else if (oldState == STATE_AUTHENTICATING && newState == STATE_AUTHENTICATED) { - iconRes = R.drawable.face_dialog_face_gray_to_checkmark; - } else if (oldState == STATE_ERROR && newState == STATE_PENDING_CONFIRMATION) { - iconRes = R.drawable.face_dialog_face_gray_to_face_blue; - } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATED) { - iconRes = R.drawable.face_dialog_face_blue_to_checkmark; - } else { - return null; - } - return mContext.getDrawable(iconRes); - } - private float dpToPixels(float dp) { return dp * ((float) mContext.getResources().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT); diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java index 412da1428eca..607266440617 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java @@ -17,7 +17,9 @@ package com.android.systemui.biometrics; import android.content.Context; +import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.Drawable; +import android.util.Log; import com.android.systemui.R; @@ -28,13 +30,15 @@ import com.android.systemui.R; */ public class FingerprintDialogView extends BiometricDialogView { + private static final String TAG = "FingerprintDialogView"; + public FingerprintDialogView(Context context, DialogViewCallback callback) { super(context, callback); } @Override - protected void handleClearMessage(boolean requireTryAgain) { + protected void handleClearMessage() { updateState(STATE_AUTHENTICATING); mErrorText.setText(getHintStringResourceId()); mErrorText.setTextColor(mTextColor); @@ -56,6 +60,25 @@ public class FingerprintDialogView extends BiometricDialogView { } @Override + protected void updateIcon(int lastState, int newState) { + final Drawable icon = getAnimationForTransition(lastState, newState); + if (icon == null) { + Log.e(TAG, "Animation not found, " + lastState + " -> " + newState); + return; + } + + final AnimatedVectorDrawable animation = icon instanceof AnimatedVectorDrawable + ? (AnimatedVectorDrawable) icon + : null; + + mBiometricIcon.setImageDrawable(icon); + + if (animation != null && shouldAnimateForTransition(lastState, newState)) { + animation.forceAnimationOnUI(); + animation.start(); + } + } + protected boolean shouldAnimateForTransition(int oldState, int newState) { if (oldState == STATE_IDLE && newState == STATE_AUTHENTICATING) { return false; @@ -84,7 +107,6 @@ public class FingerprintDialogView extends BiometricDialogView { return true; } - @Override protected Drawable getAnimationForTransition(int oldState, int newState) { int iconRes; if (oldState == STATE_IDLE && newState == STATE_AUTHENTICATING) { diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BadgedImageView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BadgedImageView.java index 98f446dea9b1..f15e8e47649c 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BadgedImageView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BadgedImageView.java @@ -23,6 +23,7 @@ import android.graphics.Rect; import android.util.AttributeSet; import android.widget.ImageView; +import com.android.internal.graphics.ColorUtils; import com.android.systemui.R; /** @@ -101,7 +102,7 @@ public class BadgedImageView extends ImageView { * The colour to use for the dot. */ public void setDotColor(int color) { - mUpdateDotColor = color; + mUpdateDotColor = ColorUtils.setAlphaComponent(color, 255 /* alpha */); invalidate(); } diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java index 9ecc6f448f17..3c5c1028763b 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java @@ -27,7 +27,6 @@ import static android.view.View.VISIBLE; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static com.android.systemui.statusbar.StatusBarState.SHADE; -import static com.android.systemui.statusbar.notification.NotificationAlertingManager.alertAgain; import static java.lang.annotation.RetentionPolicy.SOURCE; @@ -464,7 +463,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi if (!shouldBubble && mBubbleData.hasBubbleWithKey(entry.key)) { // It was previously a bubble but no longer a bubble -- lets remove it removeBubble(entry.key, DISMISS_NO_LONGER_BUBBLE); - } else if (shouldBubble && alertAgain(entry, entry.notification.getNotification())) { + } else if (shouldBubble) { updateShowInShadeForSuppressNotification(entry); entry.setBubbleDismissed(false); // updates come back as bubbles even if dismissed updateBubble(entry); diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java index 38ba91e0d81d..f15ba6ee673b 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java @@ -354,7 +354,7 @@ public class BubbleData { return false; } if (mExpanded && bubble != null) { - mSelectedBubble.markAsAccessedAt(mTimeSource.currentTimeMillis()); + bubble.markAsAccessedAt(mTimeSource.currentTimeMillis()); } mSelectedBubble = bubble; dispatchOnSelectionChanged(mSelectedBubble); diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java index 67f327490a6e..39867c3a0bdb 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java @@ -22,8 +22,6 @@ import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERR import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__DOCUMENT_LAUNCH_NOT_ALWAYS; import static android.view.Display.INVALID_DISPLAY; -import android.animation.LayoutTransition; -import android.animation.ObjectAnimator; import android.annotation.Nullable; import android.app.ActivityOptions; import android.app.ActivityView; @@ -41,9 +39,7 @@ import android.graphics.Color; import android.graphics.Insets; import android.graphics.Point; import android.graphics.drawable.Drawable; -import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.ShapeDrawable; -import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; import android.provider.Settings; @@ -54,13 +50,9 @@ import android.util.StatsLog; import android.view.View; import android.view.ViewGroup; import android.view.WindowInsets; -import android.widget.FrameLayout; -import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.TextView; import com.android.systemui.Dependency; -import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.recents.TriangleShape; import com.android.systemui.statusbar.AlphaOptimizedButton; @@ -80,10 +72,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList private AlphaOptimizedButton mSettingsIcon; - // Permission view - private View mPermissionView; - private TextView mPermissionPrompt; - // Views for expanded state private ExpandableNotificationRow mNotifRow; private ActivityView mActivityView; @@ -97,7 +85,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList private int mMinHeight; private int mSettingsIconHeight; private int mBubbleHeight; - private int mPermissionHeight; private int mPointerWidth; private int mPointerHeight; @@ -194,36 +181,11 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList triangleDrawable.setTint(bgColor); mPointerView.setBackground(triangleDrawable); - FrameLayout permissionOrSettings = findViewById(R.id.permission_or_settings); - - LayoutTransition transition = new LayoutTransition(); - transition.setDuration(200); - - ObjectAnimator appearAnimator = ObjectAnimator.ofFloat(null, View.ALPHA, 0f, 1f); - transition.setAnimator(LayoutTransition.APPEARING, appearAnimator); - transition.setInterpolator(LayoutTransition.APPEARING, Interpolators.ALPHA_IN); - - ObjectAnimator disappearAnimator = ObjectAnimator.ofFloat(null, View.ALPHA, 1f, 0f); - transition.setAnimator(LayoutTransition.DISAPPEARING, disappearAnimator); - transition.setInterpolator(LayoutTransition.DISAPPEARING, Interpolators.ALPHA_OUT); - - transition.setAnimateParentHierarchy(false); - permissionOrSettings.setLayoutTransition(transition); - permissionOrSettings.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING); - mSettingsIconHeight = getContext().getResources().getDimensionPixelSize( R.dimen.bubble_expanded_header_height); mSettingsIcon = findViewById(R.id.settings_button); mSettingsIcon.setOnClickListener(this); - mPermissionHeight = getContext().getResources().getDimensionPixelSize( - R.dimen.bubble_permission_height); - mPermissionView = findViewById(R.id.permission_layout); - mPermissionPrompt = mPermissionView.findViewById(R.id.prompt); - - findViewById(R.id.no_bubbles_button).setOnClickListener(this); - findViewById(R.id.yes_bubbles_button).setOnClickListener(this); - mActivityView = new ActivityView(mContext, null /* attrs */, 0 /* defStyle */, true /* singleTaskInstance */); addView(mActivityView); @@ -273,23 +235,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList } /** - * Creates a background with corners rounded based on how the view is configured to display - */ - private Drawable createPermissionBackground(int bgColor) { - TypedArray ta2 = getContext().obtainStyledAttributes( - new int[] {android.R.attr.dialogCornerRadius}); - final float cr = ta2.getDimension(0, 0f); - ta2.recycle(); - - float[] radii = new float[] {cr, cr, cr, cr, 0, 0, 0, 0}; - GradientDrawable chromeBackground = new GradientDrawable(); - chromeBackground.setShape(GradientDrawable.RECTANGLE); - chromeBackground.setCornerRadii(radii); - chromeBackground.setColor(bgColor); - return chromeBackground; - } - - /** * Sets the listener to notify when a bubble has been blocked. */ public void setOnBlockedListener(OnBubbleBlockedListener listener) { @@ -323,7 +268,7 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList mAppIcon = mPm.getDefaultActivityIcon(); } updateTheme(); - togglePermissionOrSettings(); + showSettingsIcon(); updateExpandedView(); } @@ -370,10 +315,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList int foregroundColor = ta.getColor(1, Color.BLACK /* default */); ta.recycle(); - // Update permission prompt color. - mPermissionView.setBackground(createPermissionBackground(backgroundColor)); - mPermissionPrompt.setTextColor(foregroundColor); - // Update triangle color. ShapeDrawable triangleDrawable = new ShapeDrawable( TriangleShape.create(mPointerWidth, mPointerHeight, false /* pointUp */)); @@ -381,22 +322,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList mPointerView.setBackground(triangleDrawable); } - void togglePermissionOrSettings() { - boolean hasUserApprovedBubblesForPackage = false; - try { - hasUserApprovedBubblesForPackage = - mNotificationManagerService.hasUserApprovedBubblesForPackage( - mEntry.notification.getPackageName(), mEntry.notification.getUid()); - } catch (RemoteException e) { - Log.w(TAG, e); - } - if (hasUserApprovedBubblesForPackage) { - showSettingsIcon(); - } else { - showPermissionView(); - } - } - private void updateExpandedView() { mBubbleIntent = getBubbleIntent(mEntry); if (mBubbleIntent != null) { @@ -427,11 +352,8 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList * @return total height that the expanded view occupies. */ int getExpandedSize() { - int chromeHeight = mPermissionView.getVisibility() != View.VISIBLE - ? mSettingsIconHeight - : mPermissionHeight; return mBubbleHeight + mPointerView.getHeight() + mPointerMargin - + chromeHeight; + + mSettingsIconHeight; } void updateHeight() { @@ -455,11 +377,8 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList } desiredHeight = desiredPx > 0 ? desiredPx : mMinHeight; } - int chromeHeight = mPermissionView.getVisibility() != View.VISIBLE - ? mSettingsIconHeight - : mPermissionHeight; - int max = mStackView.getMaxExpandedHeight() - chromeHeight - mPointerView.getHeight() - - mPointerMargin; + int max = mStackView.getMaxExpandedHeight() - mSettingsIconHeight + - mPointerView.getHeight() - mPointerMargin; float height = Math.min(desiredHeight, max); height = Math.max(height, mMinHeight); LayoutParams lp = (LayoutParams) mActivityView.getLayoutParams(); @@ -492,30 +411,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList logBubbleClickEvent(mEntry, StatsLog.BUBBLE_UICHANGED__ACTION__HEADER_GO_TO_SETTINGS); }); - } else if (id == R.id.no_bubbles_button) { - setBubblesAllowed(false); - } else if (id == R.id.yes_bubbles_button) { - setBubblesAllowed(true); - } - } - - private void setBubblesAllowed(boolean allowed) { - try { - mNotificationManagerService.setBubblesAllowed( - mEntry.notification.getPackageName(), - mEntry.notification.getUid(), - allowed); - if (allowed) { - showSettingsIcon(); - } else if (mOnBubbleBlockedListener != null) { - mOnBubbleBlockedListener.onBubbleBlocked(mEntry); - } - mStackView.onExpandedHeightChanged(); - logBubbleClickEvent(mEntry, - allowed ? StatsLog.BUBBLE_UICHANGED__ACTION__PERMISSION_OPT_IN : - StatsLog.BUBBLE_UICHANGED__ACTION__PERMISSION_OPT_OUT); - } catch (RemoteException e) { - Log.w(TAG, e); } } @@ -526,23 +421,9 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList void showSettingsIcon() { updateSettingsContentDescription(); - - mPermissionView.setVisibility(GONE); mSettingsIcon.setVisibility(VISIBLE); } - void showPermissionView() { - ((ImageView) mPermissionView.findViewById(R.id.pkgicon)).setImageDrawable(mAppIcon); - ((TextView) mPermissionView.findViewById(R.id.pkgname)).setText(mAppName); - mPermissionPrompt.setText( - getResources().getString(R.string.bubbles_prompt, mAppName)); - logBubbleClickEvent(mEntry, - StatsLog.BUBBLE_UICHANGED__ACTION__PERMISSION_DIALOG_SHOWN); - - mSettingsIcon.setVisibility(GONE); - mPermissionView.setVisibility(VISIBLE); - } - /** * Update appearance of the expanded view being displayed. */ diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerFactory.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerFactory.java new file mode 100644 index 000000000000..0e7c65a8165d --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2015 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 com.android.systemui.classifier; + +import android.content.Context; +import android.net.Uri; +import android.view.MotionEvent; + +import java.io.PrintWriter; + +/** + * When the phone is locked, listens to touch, sensor and phone events and sends them to + * DataCollector and HumanInteractionClassifier. + * + * It does not collect touch events when the bouncer shows up. + */ +public class FalsingManagerFactory { + private static FalsingManager sInstance = null; + + private FalsingManagerFactory() {} + + public static FalsingManager getInstance(Context context) { + if (sInstance == null) { + sInstance = new FalsingManagerImpl(context); + } + return sInstance; + } + + public interface FalsingManager { + void onSucccessfulUnlock(); + + void onNotificationActive(); + + void setShowingAod(boolean showingAod); + + void onNotificatonStartDraggingDown(); + + boolean isUnlockingDisabled(); + + boolean isFalseTouch(); + + void onNotificatonStopDraggingDown(); + + void setNotificationExpanded(); + + boolean isClassiferEnabled(); + + void onQsDown(); + + void setQsExpanded(boolean expanded); + + boolean shouldEnforceBouncer(); + + void onTrackingStarted(boolean secure); + + void onTrackingStopped(); + + void onLeftAffordanceOn(); + + void onCameraOn(); + + void onAffordanceSwipingStarted(boolean rightCorner); + + void onAffordanceSwipingAborted(); + + void onStartExpandingFromPulse(); + + void onExpansionFromPulseStopped(); + + Uri reportRejectedTouch(); + + void onScreenOnFromTouch(); + + boolean isReportingEnabled(); + + void onUnlockHintStarted(); + + void onCameraHintStarted(); + + void onLeftAffordanceHintStarted(); + + void onScreenTurningOn(); + + void onScreenOff(); + + void onNotificatonStopDismissing(); + + void onNotificationDismissed(); + + void onNotificatonStartDismissing(); + + void onNotificationDoubleTap(boolean accepted, float dx, float dy); + + void onBouncerShown(); + + void onBouncerHidden(); + + void onTouchEvent(MotionEvent ev, int width, int height); + + void dump(PrintWriter pw); + } +} diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerImpl.java index d4e7bbca1107..9052093346cb 100644 --- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java +++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Android Open Source Project + * 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. @@ -11,7 +11,7 @@ * 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 + * limitations under the License. */ package com.android.systemui.classifier; @@ -49,7 +49,7 @@ import java.io.PrintWriter; * * It does not collect touch events when the bouncer shows up. */ -public class FalsingManager implements SensorEventListener, StateListener { +public class FalsingManagerImpl implements FalsingManagerFactory.FalsingManager { private static final String ENFORCE_BOUNCER = "falsing_manager_enforce_bouncer"; private static final int[] CLASSIFIER_SENSORS = new int[] { @@ -75,8 +75,6 @@ public class FalsingManager implements SensorEventListener, StateListener { private final AccessibilityManager mAccessibilityManager; private final UiOffloadThread mUiOffloadThread; - private static FalsingManager sInstance = null; - private boolean mEnforceBouncer = false; private boolean mBouncerOn = false; private boolean mBouncerOffOnDown = false; @@ -89,6 +87,33 @@ public class FalsingManager implements SensorEventListener, StateListener { private int mIsFalseTouchCalls; private MetricsLogger mMetricsLogger; + private SensorEventListener mSensorEventListener = new SensorEventListener() { + @Override + public synchronized void onSensorChanged(SensorEvent event) { + mDataCollector.onSensorChanged(event); + mHumanInteractionClassifier.onSensorChanged(event); + } + + @Override + public void onAccuracyChanged(Sensor sensor, int accuracy) { + mDataCollector.onAccuracyChanged(sensor, accuracy); + } + }; + + public StateListener mStatusBarStateListener = new StateListener() { + @Override + public void onStateChanged(int newState) { + if (FalsingLog.ENABLED) { + FalsingLog.i("setStatusBarState", new StringBuilder() + .append("from=").append(StatusBarState.toShortString(mState)) + .append(" to=").append(StatusBarState.toShortString(newState)) + .toString()); + } + mState = newState; + updateSessionActive(); + } + }; + protected final ContentObserver mSettingsObserver = new ContentObserver(mHandler) { @Override public void onChange(boolean selfChange) { @@ -96,7 +121,7 @@ public class FalsingManager implements SensorEventListener, StateListener { } }; - private FalsingManager(Context context) { + FalsingManagerImpl(Context context) { mContext = context; mSensorManager = Dependency.get(AsyncSensorManager.class); mAccessibilityManager = context.getSystemService(AccessibilityManager.class); @@ -112,14 +137,7 @@ public class FalsingManager implements SensorEventListener, StateListener { UserHandle.USER_ALL); updateConfiguration(); - Dependency.get(StatusBarStateController.class).addCallback(this); - } - - public static FalsingManager getInstance(Context context) { - if (sInstance == null) { - sInstance = new FalsingManager(context); - } - return sInstance; + Dependency.get(StatusBarStateController.class).addCallback(mStatusBarStateListener); } private void updateConfiguration() { @@ -128,13 +146,14 @@ public class FalsingManager implements SensorEventListener, StateListener { } private boolean shouldSessionBeActive() { - if (FalsingLog.ENABLED && FalsingLog.VERBOSE) + if (FalsingLog.ENABLED && FalsingLog.VERBOSE) { FalsingLog.v("shouldBeActive", new StringBuilder() .append("enabled=").append(isEnabled() ? 1 : 0) .append(" mScreenOn=").append(mScreenOn ? 1 : 0) .append(" mState=").append(StatusBarState.toShortString(mState)) .toString() ); + } return isEnabled() && mScreenOn && (mState == StatusBarState.KEYGUARD) && !mShowingAod; } @@ -160,7 +179,7 @@ public class FalsingManager implements SensorEventListener, StateListener { // This can be expensive, and doesn't need to happen on the main thread. mUiOffloadThread.submit(() -> { - mSensorManager.unregisterListener(this); + mSensorManager.unregisterListener(mSensorEventListener); }); } } @@ -200,7 +219,8 @@ public class FalsingManager implements SensorEventListener, StateListener { // This can be expensive, and doesn't need to happen on the main thread. mUiOffloadThread.submit(() -> { - mSensorManager.registerListener(this, s, SensorManager.SENSOR_DELAY_GAME); + mSensorManager.registerListener( + mSensorEventListener, s, SensorManager.SENSOR_DELAY_GAME); }); } } @@ -284,16 +304,6 @@ public class FalsingManager implements SensorEventListener, StateListener { } } - @Override - public synchronized void onSensorChanged(SensorEvent event) { - mDataCollector.onSensorChanged(event); - mHumanInteractionClassifier.onSensorChanged(event); - } - - @Override - public void onAccuracyChanged(Sensor sensor, int accuracy) { - mDataCollector.onAccuracyChanged(sensor, accuracy); - } public boolean shouldEnforceBouncer() { return mEnforceBouncer; @@ -304,18 +314,6 @@ public class FalsingManager implements SensorEventListener, StateListener { updateSessionActive(); } - @Override - public void onStateChanged(int newState) { - if (FalsingLog.ENABLED) { - FalsingLog.i("setStatusBarState", new StringBuilder() - .append("from=").append(StatusBarState.toShortString(mState)) - .append(" to=").append(StatusBarState.toShortString(newState)) - .toString()); - } - mState = newState; - updateSessionActive(); - } - public void onScreenTurningOn() { if (FalsingLog.ENABLED) { FalsingLog.i("onScreenTurningOn", new StringBuilder() @@ -399,8 +397,8 @@ public class FalsingManager implements SensorEventListener, StateListener { if (FalsingLog.ENABLED) { FalsingLog.i("onTrackingStarted", ""); } - mHumanInteractionClassifier.setType(secure ? - Classifier.BOUNCER_UNLOCK : Classifier.UNLOCK); + mHumanInteractionClassifier.setType(secure + ? Classifier.BOUNCER_UNLOCK : Classifier.UNLOCK); mDataCollector.onTrackingStarted(); } diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java b/packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java index 5196ec639453..8694d2ad607c 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java @@ -28,7 +28,7 @@ import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.SystemUIApplication; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; import com.android.systemui.dock.DockManager; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.util.AsyncSensorManager; @@ -63,7 +63,7 @@ public class DozeFactory { DozeMachine machine = new DozeMachine(wrappedService, config, wakeLock); machine.setParts(new DozeMachine.Part[]{ new DozePauser(handler, machine, alarmManager, params.getPolicy()), - new DozeFalsingManagerAdapter(FalsingManager.getInstance(context)), + new DozeFalsingManagerAdapter(FalsingManagerFactory.getInstance(context)), createDozeTriggers(context, sensorManager, host, alarmManager, config, params, handler, wakeLock, machine, dockManager), createDozeUi(context, host, wakeLock, machine, handler, alarmManager, params), diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeFalsingManagerAdapter.java b/packages/SystemUI/src/com/android/systemui/doze/DozeFalsingManagerAdapter.java index 00ca9a48386e..f6df9062d9f4 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeFalsingManagerAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeFalsingManagerAdapter.java @@ -16,7 +16,7 @@ package com.android.systemui.doze; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; /** * Notifies FalsingManager of whether or not AOD is showing. diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index d6c897186628..1ffed4c35e14 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -80,6 +80,7 @@ import com.android.internal.telephony.TelephonyProperties; import com.android.internal.util.EmergencyAffordanceManager; import com.android.internal.util.ScreenRecordHelper; import com.android.internal.util.ScreenshotHelper; +import com.android.internal.view.RotationPolicy; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.Dependency; import com.android.systemui.Interpolators; @@ -1498,6 +1499,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private boolean mKeyguardShowing; private boolean mShowing; private float mScrimAlpha; + private ResetOrientationData mResetOrientationData; ActionsDialog(Context context, MyAdapter adapter, GlobalActionsPanelPlugin.PanelViewController plugin) { @@ -1531,27 +1533,50 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } private boolean shouldUsePanel() { - if (!isPanelEnabled(mContext) || mPanelController == null) { - return false; - } - if (mPanelController.getPanelContent() == null) { - return false; - } - return true; + return isPanelEnabled(mContext) + && mPanelController != null + && mPanelController.getPanelContent() != null; } private void initializePanel() { - FrameLayout panelContainer = new FrameLayout(mContext); - FrameLayout.LayoutParams panelParams = - new FrameLayout.LayoutParams( - FrameLayout.LayoutParams.MATCH_PARENT, - FrameLayout.LayoutParams.WRAP_CONTENT); - panelContainer.addView(mPanelController.getPanelContent(), panelParams); - addContentView( - panelContainer, - new ViewGroup.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT)); + int rotation = RotationUtils.getRotation(mContext); + boolean rotationLocked = RotationPolicy.isRotationLocked(mContext); + if (rotation != RotationUtils.ROTATION_NONE) { + if (rotationLocked) { + if (mResetOrientationData == null) { + mResetOrientationData = new ResetOrientationData(); + mResetOrientationData.locked = true; + mResetOrientationData.rotation = rotation; + } + + // Unlock rotation, so user can choose to rotate to portrait to see the panel. + RotationPolicy.setRotationLockAtAngle( + mContext, false, RotationUtils.ROTATION_NONE); + } + } else { + if (!rotationLocked) { + if (mResetOrientationData == null) { + mResetOrientationData = new ResetOrientationData(); + mResetOrientationData.locked = false; + } + + // Lock to portrait, so the user doesn't accidentally hide the panel. + RotationPolicy.setRotationLockAtAngle( + mContext, true, RotationUtils.ROTATION_NONE); + } + + FrameLayout panelContainer = new FrameLayout(mContext); + FrameLayout.LayoutParams panelParams = + new FrameLayout.LayoutParams( + FrameLayout.LayoutParams.MATCH_PARENT, + FrameLayout.LayoutParams.WRAP_CONTENT); + panelContainer.addView(mPanelController.getPanelContent(), panelParams); + addContentView( + panelContainer, + new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT)); + } } private void initializeLayout() { @@ -1683,19 +1708,30 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mBackgroundDrawable.setAlpha(alpha); }) .start(); - if (mPanelController != null) { - mPanelController.onDismissed(); - } + dismissPanel(); + resetOrientation(); } void dismissImmediately() { super.dismiss(); mShowing = false; + dismissPanel(); + resetOrientation(); + } + + private void dismissPanel() { if (mPanelController != null) { mPanelController.onDismissed(); } } + private void resetOrientation() { + if (mResetOrientationData != null) { + RotationPolicy.setRotationLockAtAngle(mContext, mResetOrientationData.locked, + mResetOrientationData.rotation); + } + } + @Override public void onColorsChanged(ColorExtractor extractor, int which) { if (mKeyguardShowing) { @@ -1725,6 +1761,11 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, refreshDialog(); } } + + private static class ResetOrientationData { + public boolean locked; + public int rotation; + } } /** diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 1fa6ad6d30ca..98f36e466ce5 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -83,7 +83,7 @@ import com.android.systemui.Dependency; import com.android.systemui.SystemUI; import com.android.systemui.SystemUIFactory; import com.android.systemui.UiOffloadThread; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; import com.android.systemui.statusbar.phone.BiometricUnlockController; import com.android.systemui.statusbar.phone.NotificationPanelView; import com.android.systemui.statusbar.phone.StatusBar; @@ -1594,7 +1594,7 @@ public class KeyguardViewMediator extends SystemUI { Trace.beginSection("KeyguardViewMediator#handleMessage START_KEYGUARD_EXIT_ANIM"); StartKeyguardExitAnimParams params = (StartKeyguardExitAnimParams) msg.obj; handleStartKeyguardExitAnimation(params.startTime, params.fadeoutDuration); - FalsingManager.getInstance(mContext).onSucccessfulUnlock(); + FalsingManagerFactory.getInstance(mContext).onSucccessfulUnlock(); Trace.endSection(); break; case KEYGUARD_DONE_PENDING_TIMEOUT: diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java index e92aa519b9b7..89b0d71dc485 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java @@ -575,10 +575,6 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { d.setPositiveButton(com.android.internal.R.string.confirm_battery_saver, (dialog, which) -> { final ContentResolver resolver = mContext.getContentResolver(); - Secure.putInt( - resolver, - Secure.LOW_POWER_WARNING_ACKNOWLEDGED, - 1); Settings.Global.putInt( resolver, Global.AUTOMATIC_POWER_SAVE_MODE, @@ -587,6 +583,10 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { resolver, Global.LOW_POWER_MODE_TRIGGER_LEVEL, batterySaverTriggerLevel); + Secure.putInt( + resolver, + Secure.LOW_POWER_WARNING_ACKNOWLEDGED, + 1); }); } else { d.setTitle(R.string.battery_saver_confirmation_title); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java index 8a86826cd01d..0dc80bf3cc6e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java @@ -29,7 +29,8 @@ import com.android.systemui.ExpandHelper; import com.android.systemui.Gefingerpoken; import com.android.systemui.Interpolators; import com.android.systemui.R; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.statusbar.notification.row.ExpandableView; /** @@ -65,7 +66,7 @@ public class DragDownHelper implements Gefingerpoken { mCallback = callback; mDragDownCallback = dragDownCallback; mHost = host; - mFalsingManager = FalsingManager.getInstance(context); + mFalsingManager = FalsingManagerFactory.getInstance(context); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt b/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt index e5dbcd374169..952f30f9e9c0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt @@ -30,7 +30,8 @@ import android.view.ViewConfiguration import com.android.systemui.Gefingerpoken import com.android.systemui.Interpolators import com.android.systemui.R -import com.android.systemui.classifier.FalsingManager +import com.android.systemui.classifier.FalsingManagerFactory +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableView @@ -81,7 +82,7 @@ constructor(context: Context, mMinDragDistance = context.resources.getDimensionPixelSize( R.dimen.keyguard_drag_down_min_distance) mTouchSlop = ViewConfiguration.get(context).scaledTouchSlop.toFloat() - mFalsingManager = FalsingManager.getInstance(context) + mFalsingManager = FalsingManagerFactory.getInstance(context) mPowerManager = context.getSystemService(PowerManager::class.java) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java index c34d567da0be..53d6efbea4e9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java @@ -19,7 +19,6 @@ package com.android.systemui.statusbar.notification.row; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; -import android.animation.TimeAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; @@ -36,7 +35,8 @@ import android.view.animation.PathInterpolator; import com.android.systemui.Interpolators; import com.android.systemui.R; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.notification.FakeShadowView; import com.android.systemui.statusbar.notification.NotificationUtils; @@ -174,7 +174,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView setClipChildren(false); setClipToPadding(false); updateColors(); - mFalsingManager = FalsingManager.getInstance(context); + mFalsingManager = FalsingManagerFactory.getInstance(context); mAccessibilityManager = AccessibilityManager.getInstance(mContext); mDoubleTapHelper = new DoubleTapHelper(this, (active) -> { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 1ef29c1b8080..24c7b2917360 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -76,7 +76,8 @@ import com.android.internal.widget.CachingIconView; import com.android.systemui.Dependency; import com.android.systemui.Interpolators; import com.android.systemui.R; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.plugins.PluginListener; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem; @@ -1646,7 +1647,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView public ExpandableNotificationRow(Context context, AttributeSet attrs) { super(context, attrs); - mFalsingManager = FalsingManager.getInstance(context); + mFalsingManager = FalsingManagerFactory.getInstance(context); mNotificationInflater = new NotificationContentInflater(this); mMenuRow = new NotificationMenuRow(mContext); mImageResolver = new NotificationInlineImageResolver(context, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 0e7feaa30cdb..642e2e483d89 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -84,7 +84,8 @@ import com.android.systemui.ExpandHelper; import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.SwipeHelper; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem; @@ -534,7 +535,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd getContext(), mMenuEventListener); mStackScrollAlgorithm = createStackScrollAlgorithm(context); initView(context); - mFalsingManager = FalsingManager.getInstance(context); + mFalsingManager = FalsingManagerFactory.getInstance(context); mShouldDrawNotificationBackground = res.getBoolean(R.bool.config_drawNotificationBackground); mFadeNotificationsOnDismiss = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java index cd0a43ed3bf6..dd70321c8c30 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java @@ -27,7 +27,8 @@ import android.view.ViewConfiguration; import com.android.systemui.Interpolators; import com.android.systemui.R; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.statusbar.FlingAnimationUtils; import com.android.systemui.statusbar.KeyguardAffordanceView; @@ -101,7 +102,7 @@ public class KeyguardAffordanceHelper { mHintGrowAmount = mContext.getResources().getDimensionPixelSize(R.dimen.hint_grow_amount_sideways); mFlingAnimationUtils = new FlingAnimationUtils(mContext, 0.4f); - mFalsingManager = FalsingManager.getInstance(mContext); + mFalsingManager = FalsingManagerFactory.getInstance(mContext); } private void initIcons() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index 3c2881d14f91..1a43eec3e601 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -43,7 +43,7 @@ import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.keyguard.R; import com.android.keyguard.ViewMediatorCallback; import com.android.systemui.DejankUtils; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.keyguard.DismissCallbackRegistry; import java.io.PrintWriter; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index d52180993b33..9d24e1efc66a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -59,7 +59,8 @@ import com.android.systemui.DejankUtils; import com.android.systemui.Dependency; import com.android.systemui.Interpolators; import com.android.systemui.R; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.fragments.FragmentHostManager.FragmentListener; import com.android.systemui.plugins.qs.QS; @@ -348,7 +349,7 @@ public class NotificationPanelView extends PanelView implements super(context, attrs); setWillNotDraw(!DEBUG); mInjectionInflationController = injectionInflationController; - mFalsingManager = FalsingManager.getInstance(context); + mFalsingManager = FalsingManagerFactory.getInstance(context); mPowerManager = context.getSystemService(PowerManager.class); mWakeUpCoordinator = coordinator; mAccessibilityManager = context.getSystemService(AccessibilityManager.class); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 24389f2fec8e..38c5f2ec5c44 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -42,7 +42,8 @@ import com.android.systemui.DejankUtils; import com.android.systemui.Dependency; import com.android.systemui.Interpolators; import com.android.systemui.R; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.doze.DozeLog; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.FlingAnimationUtils; @@ -212,7 +213,7 @@ public abstract class PanelView extends FrameLayout { 0.5f /* maxLengthSeconds */, 0.2f /* speedUpFactor */, 0.6f /* x2 */, 0.84f /* y2 */); mBounceInterpolator = new BounceInterpolator(); - mFalsingManager = FalsingManager.getInstance(context); + mFalsingManager = FalsingManagerFactory.getInstance(context); mNotificationsDragEnabled = getResources().getBoolean(R.bool.config_enableNotificationShadeDrag); mVibratorHelper = Dependency.get(VibratorHelper.class); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 1fc40b42c552..c01367a4d213 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -148,7 +148,8 @@ import com.android.systemui.assist.AssistManager; import com.android.systemui.bubbles.BubbleController; import com.android.systemui.charging.WirelessChargingAnimation; import com.android.systemui.classifier.FalsingLog; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.doze.DozeHost; import com.android.systemui.doze.DozeLog; @@ -760,7 +761,7 @@ public class StatusBar extends SystemUI implements DemoMode, putComponent(DozeHost.class, mDozeServiceHost); mScreenPinningRequest = new ScreenPinningRequest(mContext); - mFalsingManager = FalsingManager.getInstance(mContext); + mFalsingManager = FalsingManagerFactory.getInstance(mContext); Dependency.get(ActivityStarterDelegate.class).setActivityStarterImpl(this); @@ -2353,7 +2354,7 @@ public class StatusBar extends SystemUI implements DemoMode, mKeyguardUpdateMonitor.dump(fd, pw, args); } - FalsingManager.getInstance(mContext).dump(pw); + FalsingManagerFactory.getInstance(mContext).dump(pw); FalsingLog.dump(pw); pw.println("SharedPreferences:"); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index 44996acafc63..6185b4c5cff7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -62,7 +62,8 @@ import com.android.internal.widget.FloatingToolbar; import com.android.systemui.Dependency; import com.android.systemui.ExpandHelper; import com.android.systemui.R; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.StatusBarState; @@ -153,7 +154,7 @@ public class StatusBarWindowView extends FrameLayout { setMotionEventSplittingEnabled(false); mTransparentSrcPaint.setColor(0); mTransparentSrcPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); - mFalsingManager = FalsingManager.getInstance(context); + mFalsingManager = FalsingManagerFactory.getInstance(context); mGestureDetector = new GestureDetector(context, mGestureListener); mStatusBarStateController = Dependency.get(StatusBarStateController.class); Dependency.get(TunerService.class).addTunable(mTunable, diff --git a/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextControllerTest.java index e312990c7f8e..db45ad788bfc 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextControllerTest.java @@ -118,6 +118,7 @@ public class CarrierTextControllerTest extends SysuiTestCase { mKeyguardUpdateMonitor); // This should not start listening on any of the real dependencies mCarrierTextController.setListening(mCarrierTextCallback); + mCarrierTextController.updateDisplayOpportunisticSubscriptionCarrierText(false); } @Test @@ -358,7 +359,7 @@ public class CarrierTextControllerTest extends SysuiTestCase { .thenReturn(IccCardConstants.State.READY); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); - mCarrierTextController.updateDisplayOpportunisticSubscriptionCarrierText(); + mCarrierTextController.updateDisplayOpportunisticSubscriptionCarrierText(true); when(mSubscriptionManager.getActiveSubscriptionInfoList(anyBoolean())).thenReturn(list); ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor = @@ -386,10 +387,5 @@ public class CarrierTextControllerTest extends SysuiTestCase { super.setListening(callback); mKeyguardUpdateMonitor = mKUM; } - - @Override - public void updateDisplayOpportunisticSubscriptionCarrierText() { - mDisplayOpportunisticSubscriptionCarrierText = true; - } } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java index 8fe0c706b1ea..c4891ecd034b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java @@ -48,7 +48,7 @@ import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.ViewMediatorCallback; import com.android.systemui.DejankUtils; import com.android.systemui.SysuiTestCase; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.keyguard.DismissCallbackRegistry; import com.android.systemui.plugins.ActivityStarter.OnDismissAction; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java index fb16465d3486..747d75b4cdc1 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java @@ -78,7 +78,7 @@ import com.android.systemui.UiOffloadThread; import com.android.systemui.appops.AppOpsController; import com.android.systemui.assist.AssistManager; import com.android.systemui.bubbles.BubbleController; -import com.android.systemui.classifier.FalsingManager; +import com.android.systemui.classifier.FalsingManagerFactory.FalsingManager; import com.android.systemui.doze.DozeHost; import com.android.systemui.doze.DozeLog; import com.android.systemui.keyguard.KeyguardViewMediator; diff --git a/packages/overlays/NavigationBarModeGesturalOverlay/res/values/config.xml b/packages/overlays/NavigationBarModeGesturalOverlay/res/values/config.xml index 637637ad6fdd..9694e76e138b 100644 --- a/packages/overlays/NavigationBarModeGesturalOverlay/res/values/config.xml +++ b/packages/overlays/NavigationBarModeGesturalOverlay/res/values/config.xml @@ -37,4 +37,8 @@ {@link Window#setEnsuringNavigationBarContrastWhenTransparent}. --> <bool name="config_navBarNeedsScrim">false</bool> + <!-- Controls whether the side edge gestures can always trigger the transient nav bar to + show. --> + <bool name="config_navBarAlwaysShowOnSideEdgeGesture">true</bool> + </resources> diff --git a/proto/src/metrics_constants/metrics_constants.proto b/proto/src/metrics_constants/metrics_constants.proto index 10387f10615f..65338cb2126f 100644 --- a/proto/src/metrics_constants/metrics_constants.proto +++ b/proto/src/metrics_constants/metrics_constants.proto @@ -7216,6 +7216,12 @@ message MetricsEvent { // Settings > Apps and notifications > Notifications > Gentle notifications GENTLE_NOTIFICATIONS_SCREEN = 1715; + // Assistant + // TYPE: OPEN, CLOSE or UPDATE. + // For OPEN, the subtype is the innovation type for the assistant. + // OS: Q + ASSISTANT = 1716; + // ---- End Q Constants, all Q constants go above this line ---- // Add new aosp constants above this line. // END OF AOSP CONSTANTS diff --git a/services/core/java/com/android/server/am/TEST_MAPPING b/services/core/java/com/android/server/am/TEST_MAPPING index d56cb7914b9a..21d4925722d0 100644 --- a/services/core/java/com/android/server/am/TEST_MAPPING +++ b/services/core/java/com/android/server/am/TEST_MAPPING @@ -10,6 +10,9 @@ "include-annotation": "android.platform.test.annotations.Presubmit" }, { + "exclude-annotation": "androidx.test.filters.LargeTest" + }, + { "exclude-annotation": "androidx.test.filters.FlakyTest" } ] diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java index 6933ee84837b..88919df04f00 100644 --- a/services/core/java/com/android/server/biometrics/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/BiometricService.java @@ -1313,6 +1313,10 @@ public class BiometricService extends SystemService { } if (acquiredInfo != BiometricConstants.BIOMETRIC_ACQUIRED_GOOD) { + if (message == null) { + Slog.w(TAG, "Ignoring null message: " + acquiredInfo); + return; + } try { mStatusBarService.onBiometricHelp(message); } catch (RemoteException e) { diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java index d93dddfcffb8..c91f66b78a32 100644 --- a/services/core/java/com/android/server/location/GnssLocationProvider.java +++ b/services/core/java/com/android/server/location/GnssLocationProvider.java @@ -180,9 +180,10 @@ public class GnssLocationProvider extends AbstractLocationProvider implements private static final int SET_REQUEST = 3; private static final int INJECT_NTP_TIME = 5; - private static final int DOWNLOAD_XTRA_DATA = 6; + // PSDS stands for Predicted Satellite Data Service + private static final int DOWNLOAD_PSDS_DATA = 6; private static final int UPDATE_LOCATION = 7; // Handle external location from network listener - private static final int DOWNLOAD_XTRA_DATA_FINISHED = 11; + private static final int DOWNLOAD_PSDS_DATA_FINISHED = 11; private static final int SUBSCRIPTION_OR_CARRIER_CONFIG_CHANGED = 12; private static final int INITIALIZE_HANDLER = 13; private static final int REQUEST_LOCATION = 16; @@ -295,19 +296,19 @@ public class GnssLocationProvider extends AbstractLocationProvider implements // Typical hot TTTF is ~5 seconds, so 10 seconds seems sane. private static final int GPS_POLLING_THRESHOLD_INTERVAL = 10 * 1000; - // how long to wait if we have a network error in NTP or XTRA downloading + // how long to wait if we have a network error in NTP or PSDS downloading // the initial value of the exponential backoff // current setting - 5 minutes private static final long RETRY_INTERVAL = 5 * 60 * 1000; - // how long to wait if we have a network error in NTP or XTRA downloading + // how long to wait if we have a network error in NTP or PSDS downloading // the max value of the exponential backoff // current setting - 4 hours private static final long MAX_RETRY_INTERVAL = 4 * 60 * 60 * 1000; - // Timeout when holding wakelocks for downloading XTRA data. - private static final long DOWNLOAD_XTRA_DATA_TIMEOUT_MS = 60 * 1000; + // Timeout when holding wakelocks for downloading PSDS data. + private static final long DOWNLOAD_PSDS_DATA_TIMEOUT_MS = 60 * 1000; - private final ExponentialBackOff mXtraBackOff = new ExponentialBackOff(RETRY_INTERVAL, + private final ExponentialBackOff mPsdsBackOff = new ExponentialBackOff(RETRY_INTERVAL, MAX_RETRY_INTERVAL); // true if we are enabled, protected by this @@ -315,14 +316,14 @@ public class GnssLocationProvider extends AbstractLocationProvider implements private boolean mShutdown; - // states for injecting ntp and downloading xtra data + // states for injecting ntp and downloading psds data private static final int STATE_PENDING_NETWORK = 0; private static final int STATE_DOWNLOADING = 1; private static final int STATE_IDLE = 2; - // flags to trigger NTP or XTRA data download when network becomes available - // initialized to true so we do NTP and XTRA when the network comes up after booting - private int mDownloadXtraDataPending = STATE_PENDING_NETWORK; + // flags to trigger NTP or PSDS data download when network becomes available + // initialized to true so we do NTP and PSDS when the network comes up after booting + private int mDownloadPsdsDataPending = STATE_PENDING_NETWORK; // true if GPS is navigating private boolean mNavigating; @@ -346,8 +347,8 @@ public class GnssLocationProvider extends AbstractLocationProvider implements // capabilities reported through the top level IGnssCallback.hal private volatile int mTopHalCapabilities; - // true if XTRA is supported - private boolean mSupportsXtra; + // true if PSDS is supported + private boolean mSupportsPsds; // for calculating time to first fix private long mFixRequestTime = 0; @@ -404,8 +405,8 @@ public class GnssLocationProvider extends AbstractLocationProvider implements // Wakelocks private final static String WAKELOCK_KEY = "GnssLocationProvider"; private final PowerManager.WakeLock mWakeLock; - private static final String DOWNLOAD_EXTRA_WAKELOCK_KEY = "GnssLocationProviderXtraDownload"; - private final PowerManager.WakeLock mDownloadXtraWakeLock; + private static final String DOWNLOAD_EXTRA_WAKELOCK_KEY = "GnssLocationProviderPsdsDownload"; + private final PowerManager.WakeLock mDownloadPsdsWakeLock; // Alarms private final static String ALARM_WAKEUP = "com.android.internal.location.ALARM_WAKEUP"; @@ -592,10 +593,10 @@ public class GnssLocationProvider extends AbstractLocationProvider implements mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKELOCK_KEY); mWakeLock.setReferenceCounted(true); - // Create a separate wake lock for xtra downloader as it may be released due to timeout. - mDownloadXtraWakeLock = mPowerManager.newWakeLock( + // Create a separate wake lock for psds downloader as it may be released due to timeout. + mDownloadPsdsWakeLock = mPowerManager.newWakeLock( PowerManager.PARTIAL_WAKE_LOCK, DOWNLOAD_EXTRA_WAKELOCK_KEY); - mDownloadXtraWakeLock.setReferenceCounted(true); + mDownloadPsdsWakeLock.setReferenceCounted(true); mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE); mWakeupIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(ALARM_WAKEUP), 0); @@ -701,10 +702,10 @@ public class GnssLocationProvider extends AbstractLocationProvider implements */ private void onNetworkAvailable() { mNtpTimeHelper.onNetworkAvailable(); - if (mDownloadXtraDataPending == STATE_PENDING_NETWORK) { - if (mSupportsXtra) { + if (mDownloadPsdsDataPending == STATE_PENDING_NETWORK) { + if (mSupportsPsds) { // Download only if supported, (prevents an unnecessary on-boot download) - xtraDownloadRequest(); + psdsDownloadRequest(); } } } @@ -811,61 +812,61 @@ public class GnssLocationProvider extends AbstractLocationProvider implements return false; } - private void handleDownloadXtraData() { - if (!mSupportsXtra) { - // native code reports xtra not supported, don't try - Log.d(TAG, "handleDownloadXtraData() called when Xtra not supported"); + private void handleDownloadPsdsData() { + if (!mSupportsPsds) { + // native code reports psds not supported, don't try + Log.d(TAG, "handleDownloadPsdsData() called when PSDS not supported"); return; } - if (mDownloadXtraDataPending == STATE_DOWNLOADING) { + if (mDownloadPsdsDataPending == STATE_DOWNLOADING) { // already downloading data return; } if (!mNetworkConnectivityHandler.isDataNetworkConnected()) { // try again when network is up - mDownloadXtraDataPending = STATE_PENDING_NETWORK; + mDownloadPsdsDataPending = STATE_PENDING_NETWORK; return; } - mDownloadXtraDataPending = STATE_DOWNLOADING; + mDownloadPsdsDataPending = STATE_DOWNLOADING; // hold wake lock while task runs - mDownloadXtraWakeLock.acquire(DOWNLOAD_XTRA_DATA_TIMEOUT_MS); - Log.i(TAG, "WakeLock acquired by handleDownloadXtraData()"); + mDownloadPsdsWakeLock.acquire(DOWNLOAD_PSDS_DATA_TIMEOUT_MS); + Log.i(TAG, "WakeLock acquired by handleDownloadPsdsData()"); AsyncTask.THREAD_POOL_EXECUTOR.execute(() -> { - GpsXtraDownloader xtraDownloader = new GpsXtraDownloader( + GpsPsdsDownloader psdsDownloader = new GpsPsdsDownloader( mGnssConfiguration.getProperties()); - byte[] data = xtraDownloader.downloadXtraData(); + byte[] data = psdsDownloader.downloadPsdsData(); if (data != null) { - if (DEBUG) Log.d(TAG, "calling native_inject_xtra_data"); - native_inject_xtra_data(data, data.length); - mXtraBackOff.reset(); + if (DEBUG) Log.d(TAG, "calling native_inject_psds_data"); + native_inject_psds_data(data, data.length); + mPsdsBackOff.reset(); } - sendMessage(DOWNLOAD_XTRA_DATA_FINISHED, 0, null); + sendMessage(DOWNLOAD_PSDS_DATA_FINISHED, 0, null); if (data == null) { // try again later // since this is delayed and not urgent we do not hold a wake lock here - mHandler.sendEmptyMessageDelayed(DOWNLOAD_XTRA_DATA, - mXtraBackOff.nextBackoffMillis()); + mHandler.sendEmptyMessageDelayed(DOWNLOAD_PSDS_DATA, + mPsdsBackOff.nextBackoffMillis()); } // Release wake lock held by task, synchronize on mLock in case multiple // download tasks overrun. synchronized (mLock) { - if (mDownloadXtraWakeLock.isHeld()) { + if (mDownloadPsdsWakeLock.isHeld()) { // This wakelock may have time-out, if a timeout was specified. // Catch (and ignore) any timeout exceptions. try { - mDownloadXtraWakeLock.release(); - if (DEBUG) Log.d(TAG, "WakeLock released by handleDownloadXtraData()"); + mDownloadPsdsWakeLock.release(); + if (DEBUG) Log.d(TAG, "WakeLock released by handleDownloadPsdsData()"); } catch (Exception e) { Log.i(TAG, "Wakelock timeout & release race exception in " - + "handleDownloadXtraData()", e); + + "handleDownloadPsdsData()", e); } } else { Log.e(TAG, "WakeLock expired before release in " - + "handleDownloadXtraData()"); + + "handleDownloadPsdsData()"); } } }); @@ -920,7 +921,7 @@ public class GnssLocationProvider extends AbstractLocationProvider implements if (inited) { mEnabled = true; - mSupportsXtra = native_supports_xtra(); + mSupportsPsds = native_supports_psds(); // TODO: remove the following native calls if we can make sure they are redundant. if (mSuplServerHost != null) { @@ -1162,9 +1163,9 @@ public class GnssLocationProvider extends AbstractLocationProvider implements deleteAidingData(extras); } else if ("force_time_injection".equals(command)) { requestUtcTime(); - } else if ("force_xtra_injection".equals(command)) { - if (mSupportsXtra) { - xtraDownloadRequest(); + } else if ("force_psds_injection".equals(command)) { + if (mSupportsPsds) { + psdsDownloadRequest(); } } else { Log.w(TAG, "sendExtraCommand: unknown command " + command); @@ -1677,9 +1678,9 @@ public class GnssLocationProvider extends AbstractLocationProvider implements } @NativeEntryPoint - private void xtraDownloadRequest() { - if (DEBUG) Log.d(TAG, "xtraDownloadRequest"); - sendMessage(DOWNLOAD_XTRA_DATA, 0, null); + private void psdsDownloadRequest() { + if (DEBUG) Log.d(TAG, "psdsDownloadRequest"); + sendMessage(DOWNLOAD_PSDS_DATA, 0, null); } /** @@ -2012,11 +2013,11 @@ public class GnssLocationProvider extends AbstractLocationProvider implements case REQUEST_LOCATION: handleRequestLocation(msg.arg1 == 1, (boolean) msg.obj); break; - case DOWNLOAD_XTRA_DATA: - handleDownloadXtraData(); + case DOWNLOAD_PSDS_DATA: + handleDownloadPsdsData(); break; - case DOWNLOAD_XTRA_DATA_FINISHED: - mDownloadXtraDataPending = STATE_IDLE; + case DOWNLOAD_PSDS_DATA_FINISHED: + mDownloadPsdsDataPending = STATE_IDLE; break; case UPDATE_LOCATION: handleUpdateLocation((Location) msg.obj); @@ -2166,10 +2167,10 @@ public class GnssLocationProvider extends AbstractLocationProvider implements return "INJECT_NTP_TIME"; case REQUEST_LOCATION: return "REQUEST_LOCATION"; - case DOWNLOAD_XTRA_DATA: - return "DOWNLOAD_XTRA_DATA"; - case DOWNLOAD_XTRA_DATA_FINISHED: - return "DOWNLOAD_XTRA_DATA_FINISHED"; + case DOWNLOAD_PSDS_DATA: + return "DOWNLOAD_PSDS_DATA"; + case DOWNLOAD_PSDS_DATA_FINISHED: + return "DOWNLOAD_PSDS_DATA_FINISHED"; case UPDATE_LOCATION: return "UPDATE_LOCATION"; case SUBSCRIPTION_OR_CARRIER_CONFIG_CHANGED: @@ -2266,12 +2267,12 @@ public class GnssLocationProvider extends AbstractLocationProvider implements private native void native_inject_location(double latitude, double longitude, float accuracy); - // XTRA Support + // PSDS Support private native void native_inject_time(long time, long timeReference, int uncertainty); - private native boolean native_supports_xtra(); + private native boolean native_supports_psds(); - private native void native_inject_xtra_data(byte[] data, int length); + private native void native_inject_psds_data(byte[] data, int length); // DEBUG Support private native String native_get_internal_state(); diff --git a/services/core/java/com/android/server/location/GpsXtraDownloader.java b/services/core/java/com/android/server/location/GpsPsdsDownloader.java index 7dffcb4c32a9..6fcb7d1af2ce 100644 --- a/services/core/java/com/android/server/location/GpsXtraDownloader.java +++ b/services/core/java/com/android/server/location/GpsPsdsDownloader.java @@ -32,26 +32,26 @@ import java.util.Random; import java.util.concurrent.TimeUnit; /** - * A class for downloading GPS XTRA data. + * A class for downloading GPS PSDS data. * * {@hide} */ -public class GpsXtraDownloader { +public class GpsPsdsDownloader { - private static final String TAG = "GpsXtraDownloader"; + private static final String TAG = "GpsPsdsDownloader"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private static final long MAXIMUM_CONTENT_LENGTH_BYTES = 1000000; // 1MB. private static final String DEFAULT_USER_AGENT = "Android"; private static final int CONNECTION_TIMEOUT_MS = (int) TimeUnit.SECONDS.toMillis(30); private static final int READ_TIMEOUT_MS = (int) TimeUnit.SECONDS.toMillis(60); - private final String[] mXtraServers; + private final String[] mPsdsServers; // to load balance our server requests private int mNextServerIndex; private final String mUserAgent; - GpsXtraDownloader(Properties properties) { - // read XTRA servers from the Properties object + GpsPsdsDownloader(Properties properties) { + // read PSDS servers from the Properties object int count = 0; String server1 = properties.getProperty("XTRA_SERVER_1"); String server2 = properties.getProperty("XTRA_SERVER_2"); @@ -69,14 +69,14 @@ public class GpsXtraDownloader { } if (count == 0) { - Log.e(TAG, "No XTRA servers were specified in the GPS configuration"); - mXtraServers = null; + Log.e(TAG, "No PSDS servers were specified in the GPS configuration"); + mPsdsServers = null; } else { - mXtraServers = new String[count]; + mPsdsServers = new String[count]; count = 0; - if (server1 != null) mXtraServers[count++] = server1; - if (server2 != null) mXtraServers[count++] = server2; - if (server3 != null) mXtraServers[count++] = server3; + if (server1 != null) mPsdsServers[count++] = server1; + if (server2 != null) mPsdsServers[count++] = server2; + if (server3 != null) mPsdsServers[count++] = server3; // randomize first server Random random = new Random(); @@ -84,11 +84,11 @@ public class GpsXtraDownloader { } } - byte[] downloadXtraData() { + byte[] downloadPsdsData() { byte[] result = null; int startIndex = mNextServerIndex; - if (mXtraServers == null) { + if (mPsdsServers == null) { return null; } @@ -97,14 +97,14 @@ public class GpsXtraDownloader { final int oldTag = TrafficStats.getAndSetThreadStatsTag( TrafficStatsConstants.TAG_SYSTEM_GPS); try { - result = doDownload(mXtraServers[mNextServerIndex]); + result = doDownload(mPsdsServers[mNextServerIndex]); } finally { TrafficStats.setThreadStatsTag(oldTag); } // increment mNextServerIndex and wrap around if necessary mNextServerIndex++; - if (mNextServerIndex == mXtraServers.length) { + if (mNextServerIndex == mPsdsServers.length) { mNextServerIndex = 0; } // break if we have tried all the servers @@ -115,7 +115,7 @@ public class GpsXtraDownloader { } protected byte[] doDownload(String url) { - if (DEBUG) Log.d(TAG, "Downloading XTRA data from " + url); + if (DEBUG) Log.d(TAG, "Downloading PSDS data from " + url); HttpURLConnection connection = null; try { @@ -132,7 +132,7 @@ public class GpsXtraDownloader { connection.connect(); int statusCode = connection.getResponseCode(); if (statusCode != HttpURLConnection.HTTP_OK) { - if (DEBUG) Log.d(TAG, "HTTP error downloading gps XTRA: " + statusCode); + if (DEBUG) Log.d(TAG, "HTTP error downloading gps PSDS: " + statusCode); return null; } @@ -143,14 +143,14 @@ public class GpsXtraDownloader { while ((count = in.read(buffer)) != -1) { bytes.write(buffer, 0, count); if (bytes.size() > MAXIMUM_CONTENT_LENGTH_BYTES) { - if (DEBUG) Log.d(TAG, "XTRA file too large"); + if (DEBUG) Log.d(TAG, "PSDS file too large"); return null; } } return bytes.toByteArray(); } } catch (IOException ioe) { - if (DEBUG) Log.d(TAG, "Error downloading gps XTRA: ", ioe); + if (DEBUG) Log.d(TAG, "Error downloading gps PSDS: ", ioe); } finally { if (connection != null) { connection.disconnect(); diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 3364b8ad27d5..3e26e013a0a5 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -7340,8 +7340,7 @@ public class NotificationManagerService extends SystemService { static final String TAG_ENABLED_NOTIFICATION_ASSISTANTS = "enabled_assistants"; private static final String ATT_USER_SET = "user_set"; - // TODO: STOPSHIP (b/127994217) switch to final value when onboarding flow is implemented - private static final String TAG_ALLOWED_ADJUSTMENT_TYPES = "allowed_adjustments_tmp2"; + private static final String TAG_ALLOWED_ADJUSTMENT_TYPES = "allowed_adjustments"; private static final String ATT_TYPES = "types"; private final Object mLock = new Object(); @@ -7354,7 +7353,6 @@ public class NotificationManagerService extends SystemService { IPackageManager pm) { super(context, lock, up, pm); - // TODO: STOPSHIP (b/127994217) remove when the onboarding flow is implemented // Add all default allowed adjustment types. Will be overwritten by values in xml, // if they exist for (int i = 0; i < DEFAULT_ALLOWED_ADJUSTMENTS.length; i++) { @@ -7423,9 +7421,9 @@ public class NotificationManagerService extends SystemService { protected void readExtraTag(String tag, XmlPullParser parser) throws IOException { if (TAG_ALLOWED_ADJUSTMENT_TYPES.equals(tag)) { final String types = XmlUtils.readStringAttribute(parser, ATT_TYPES); - if (!TextUtils.isEmpty(types)) { - synchronized (mLock) { - mAllowedAdjustments.clear(); + synchronized (mLock) { + mAllowedAdjustments.clear(); + if (!TextUtils.isEmpty(types)) { mAllowedAdjustments.addAll(Arrays.asList(types.split(","))); } } diff --git a/services/core/java/com/android/server/notification/PreferencesHelper.java b/services/core/java/com/android/server/notification/PreferencesHelper.java index 627b65c48ba7..3f1a2487fe2f 100644 --- a/services/core/java/com/android/server/notification/PreferencesHelper.java +++ b/services/core/java/com/android/server/notification/PreferencesHelper.java @@ -92,13 +92,13 @@ public class PreferencesHelper implements RankingConfig { private static final String ATT_APP_USER_LOCKED_FIELDS = "app_user_locked_fields"; private static final String ATT_ENABLED = "enabled"; private static final String ATT_USER_ALLOWED = "allowed"; - private static final String ATT_HIDE_SILENT = "hide_silent"; + private static final String ATT_HIDE_SILENT = "hide_gentle"; private static final int DEFAULT_PRIORITY = Notification.PRIORITY_DEFAULT; private static final int DEFAULT_VISIBILITY = NotificationManager.VISIBILITY_NO_OVERRIDE; private static final int DEFAULT_IMPORTANCE = NotificationManager.IMPORTANCE_UNSPECIFIED; @VisibleForTesting - static final boolean DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS = true; + static final boolean DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS = false; private static final boolean DEFAULT_SHOW_BADGE = true; private static final boolean DEFAULT_ALLOW_BUBBLE = true; private static final boolean DEFAULT_OEM_LOCKED_IMPORTANCE = false; diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index a64ae9c5fe85..c20172d0599a 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -20062,6 +20062,7 @@ public class PackageManagerService extends IPackageManager.Stub final Intent intent = new Intent(Intent.ACTION_PREFERRED_ACTIVITY_CHANGED); intent.putExtra(Intent.EXTRA_USER_HANDLE, userId); + intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); try { am.broadcastIntent(null, intent, null, null, 0, null, null, null, android.app.AppOpsManager.OP_NONE, diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index c23cdbba7706..b6295e194aac 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -124,6 +124,7 @@ import android.content.res.Resources; import android.graphics.Insets; import android.graphics.PixelFormat; import android.graphics.Rect; +import android.graphics.Region; import android.hardware.input.InputManager; import android.hardware.power.V1_0.PowerHint; import android.os.Handler; @@ -230,7 +231,6 @@ public class DisplayPolicy { private int mBottomGestureAdditionalInset; @Px private int mSideGestureInset; - private boolean mNavigationBarLetsThroughTaps; private StatusBarManagerInternal getStatusBarManagerInternal() { synchronized (mServiceAcquireLock) { @@ -252,6 +252,8 @@ public class DisplayPolicy { private volatile boolean mHasNavigationBar; // Can the navigation bar ever move to the side? private volatile boolean mNavigationBarCanMove; + private volatile boolean mNavigationBarLetsThroughTaps; + private volatile boolean mNavigationBarAlwaysShowOnSideGesture; // Written by vr manager thread, only read in this class. private volatile boolean mPersistentVrModeEnabled; @@ -463,22 +465,31 @@ public class DisplayPolicy { @Override public void onSwipeFromBottom() { - if (mNavigationBar != null - && mNavigationBarPosition == NAV_BAR_BOTTOM) { + if (mNavigationBar != null && mNavigationBarPosition == NAV_BAR_BOTTOM) { requestTransientBars(mNavigationBar); } } @Override public void onSwipeFromRight() { - if (mNavigationBar != null && mNavigationBarPosition == NAV_BAR_RIGHT) { + final Region excludedRegion = + mDisplayContent.calculateSystemGestureExclusion(); + final boolean sideAllowed = mNavigationBarAlwaysShowOnSideGesture + || mNavigationBarPosition == NAV_BAR_RIGHT; + if (mNavigationBar != null && sideAllowed + && !mSystemGestures.currentGestureStartedInRegion(excludedRegion)) { requestTransientBars(mNavigationBar); } } @Override public void onSwipeFromLeft() { - if (mNavigationBar != null && mNavigationBarPosition == NAV_BAR_LEFT) { + final Region excludedRegion = + mDisplayContent.calculateSystemGestureExclusion(); + final boolean sideAllowed = mNavigationBarAlwaysShowOnSideGesture + || mNavigationBarPosition == NAV_BAR_LEFT; + if (mNavigationBar != null && sideAllowed + && !mSystemGestures.currentGestureStartedInRegion(excludedRegion)) { requestTransientBars(mNavigationBar); } } @@ -2696,6 +2707,8 @@ public class DisplayPolicy { mNavBarOpacityMode = res.getInteger(R.integer.config_navBarOpacityMode); mSideGestureInset = res.getDimensionPixelSize(R.dimen.config_backGestureInset); mNavigationBarLetsThroughTaps = res.getBoolean(R.bool.config_navBarTapThrough); + mNavigationBarAlwaysShowOnSideGesture = + res.getBoolean(R.bool.config_navBarAlwaysShowOnSideEdgeGesture); // This should calculate how much above the frame we accept gestures. mBottomGestureAdditionalInset = Math.max(0, diff --git a/services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java b/services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java index 35afaedb0b43..854537b4618f 100644 --- a/services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java +++ b/services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java @@ -18,6 +18,7 @@ package com.android.server.wm; import android.content.Context; import android.graphics.Rect; +import android.graphics.Region; import android.hardware.display.DisplayManagerGlobal; import android.os.Handler; import android.os.SystemClock; @@ -201,6 +202,10 @@ class SystemGesturesPointerEventListener implements PointerEventListener { } } + protected boolean currentGestureStartedInRegion(Region r) { + return r.contains((int) mDownX[0], (int) mDownY[0]); + } + private int findIndex(int pointerId) { for (int i = 0; i < mDownPointers; i++) { if (mDownPointerId[i] == pointerId) { diff --git a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp index 98c620c50f54..89a1ec8507d6 100644 --- a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp +++ b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp @@ -62,7 +62,7 @@ static jmethodID method_reportNmea; static jmethodID method_setTopHalCapabilities; static jmethodID method_setGnssYearOfHardware; static jmethodID method_setGnssHardwareModelName; -static jmethodID method_xtraDownloadRequest; +static jmethodID method_psdsDownloadRequest; static jmethodID method_reportNiNotification; static jmethodID method_requestLocation; static jmethodID method_requestRefLocation; @@ -802,7 +802,7 @@ class GnssXtraCallback : public IGnssXtraCallback { */ Return<void> GnssXtraCallback::downloadRequestCb() { JNIEnv* env = getJniEnv(); - env->CallVoidMethod(mCallbacksObj, method_xtraDownloadRequest); + env->CallVoidMethod(mCallbacksObj, method_psdsDownloadRequest); checkAndClearExceptionFromCallback(env, __FUNCTION__); return Void(); } @@ -1525,7 +1525,7 @@ static void android_location_GnssLocationProvider_init_once(JNIEnv* env, jclass method_setGnssYearOfHardware = env->GetMethodID(clazz, "setGnssYearOfHardware", "(I)V"); method_setGnssHardwareModelName = env->GetMethodID(clazz, "setGnssHardwareModelName", "(Ljava/lang/String;)V"); - method_xtraDownloadRequest = env->GetMethodID(clazz, "xtraDownloadRequest", "()V"); + method_psdsDownloadRequest = env->GetMethodID(clazz, "psdsDownloadRequest", "()V"); method_reportNiNotification = env->GetMethodID(clazz, "reportNiNotification", "(IIIIILjava/lang/String;Ljava/lang/String;II)V"); method_requestLocation = env->GetMethodID(clazz, "requestLocation", "(ZZ)V"); @@ -2190,12 +2190,12 @@ static void android_location_GnssLocationProvider_inject_location(JNIEnv* /* env } } -static jboolean android_location_GnssLocationProvider_supports_xtra( +static jboolean android_location_GnssLocationProvider_supports_psds( JNIEnv* /* env */, jobject /* obj */) { return (gnssXtraIface != nullptr) ? JNI_TRUE : JNI_FALSE; } -static void android_location_GnssLocationProvider_inject_xtra_data(JNIEnv* env, jobject /* obj */, +static void android_location_GnssLocationProvider_inject_psds_data(JNIEnv* env, jobject /* obj */, jbyteArray data, jint length) { if (gnssXtraIface == nullptr) { ALOGE("XTRA Interface not supported"); @@ -3047,10 +3047,10 @@ static const JNINativeMethod sMethods[] = { android_location_GnssLocationProvider_inject_best_location)}, {"native_inject_location", "(DDF)V", reinterpret_cast<void *>( android_location_GnssLocationProvider_inject_location)}, - {"native_supports_xtra", "()Z", reinterpret_cast<void *>( - android_location_GnssLocationProvider_supports_xtra)}, - {"native_inject_xtra_data", "([BI)V", reinterpret_cast<void *>( - android_location_GnssLocationProvider_inject_xtra_data)}, + {"native_supports_psds", "()Z", reinterpret_cast<void *>( + android_location_GnssLocationProvider_supports_psds)}, + {"native_inject_psds_data", "([BI)V", reinterpret_cast<void *>( + android_location_GnssLocationProvider_inject_psds_data)}, {"native_agps_set_id", "(ILjava/lang/String;)V", reinterpret_cast<void *>( android_location_GnssLocationProvider_agps_set_id)}, {"native_agps_set_ref_location_cellid", "(IIIII)V", reinterpret_cast<void *>( diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 903e53394c03..aa9883d54a6a 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -4897,24 +4897,20 @@ public class TelephonyManager { boolean notifyNow = (getITelephony() != null); ITelephonyRegistry registry = getTelephonyRegistry(); if (registry != null) { - int subId; - // subId from phonestatelistner is deprecated Q on forward, use the subId from - // TelephonyManager instance. - if (VMRuntime.getRuntime().getTargetSdkVersion() >= Build.VERSION_CODES.Q - || listener.mSubId == null) { - subId = mSubId; - } else { + // subId from PhoneStateListener is deprecated Q on forward, use the subId from + // TelephonyManager instance. keep using subId from PhoneStateListener for pre-Q. + int subId = mSubId; + if (VMRuntime.getRuntime().getTargetSdkVersion() >= Build.VERSION_CODES.Q) { + // since mSubId in PhoneStateListener is deprecated from Q on forward, this is + // the only place to set mSubId and its for "informational" only. + // TODO: remove this once we completely get rid of mSubId in PhoneStateListener + listener.mSubId = (events == PhoneStateListener.LISTEN_NONE) + ? SubscriptionManager.INVALID_SUBSCRIPTION_ID : subId; + } else if (listener.mSubId != null) { subId = listener.mSubId; } - registry.listenForSubscriber(subId, getOpPackageName(), listener.callback, events, notifyNow); - // TODO: remove this once we remove PhoneStateListener constructor with subId. - if (events == PhoneStateListener.LISTEN_NONE) { - listener.mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; - } else { - listener.mSubId = subId; - } } else { Rlog.w(TAG, "telephony registry not ready."); } |