Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #41 from beaufortfrancois/master
Browse files Browse the repository at this point in the history
Keep the Screen On when advertising
  • Loading branch information
g-ortuno committed Jul 14, 2015
2 parents 0086d05 + 945f633 commit 21e747e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;
import android.widget.TextView;
import android.widget.Toast;

Expand Down Expand Up @@ -171,6 +172,7 @@ public void onCharacteristicWriteRequest(BluetoothDevice device, int requestId,
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_peripherals);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
mAdvStatus = (TextView) findViewById(R.id.textView_advertisingStatus);
mConnectionStatus = (TextView) findViewById(R.id.textView_connectionStatus);
mBluetoothDevices = new HashSet<>();
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<!-- Adv -->
<string name="label_advertisingStatus">Advertising Status</string>
<string name="status_advertising">Advertising</string>
<string name="status_advertising">Advertising (Keep Screen On)</string>
<string name="status_notAdvertising">Not Advertising</string>
<string name="status_advDataTooLarge">Not Advertising. Advertisement is larger than 31 bytes.</string>
<string name="status_advFeatureUnsupported">Not Advertising. Advertising not supported.</string>
Expand Down

0 comments on commit 21e747e

Please sign in to comment.