blob: 77caeb96534d3d1b034045f5e9d19b0c3e969902 [file] [log] [blame]
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.cts.verifier.instantapps;
import android.os.Bundle;
import android.os.SystemProperties;
import android.content.pm.PackageManager;
import android.widget.TextView;
import com.android.cts.verifier.R;
/**
* Test for manual verification of Instant Apps notification.
*
* The test verifies that an Instant App notification will be shown when
* an Instant App is at foreground.
*/
public class NotificationTestActivity extends BaseTestActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setInfoResources(R.string.ia_notification, R.string.ia_notification_info, -1);
TextView extraText = (TextView) findViewById(R.id.instruction_extra_text);
if (isNoGooglePlayStore()) {
extraText.setText(R.string.ia_notification_instruction_label_no_app_market_version);
} else {
extraText.setText(R.string.ia_notification_instruction_label);
}
}
private boolean isNoGooglePlayStore() {
boolean isCnGmsVersion =
getApplicationContext().getPackageManager().hasSystemFeature("cn.google.services");
boolean isNoGmsVersion =
(SystemProperties.get("ro.com.google.gmsversion", null) == null);
return isCnGmsVersion || isNoGmsVersion;
}
}